oportunidades 7
tests / ci (push) Waiting to run

This commit is contained in:
2026-10-13 11:40:29 +02:00
parent 20971d523f
commit 287e991486
2902 changed files with 1085456 additions and 25957 deletions
+55 -4
View File
@@ -1,4 +1,55 @@
const {start,assert,sanitized}=require('./portal-visual-qa-lib.cjs');
(async()=>{const q=await start('keyboard-chromium-20261010');let page,ctx;
try{({page,ctx}=await q.context('anonymous',390));q.proof.pages=[];for(const route of ['/agronegocio','/turismo','/manifestar-interesse']){await q.open(page,route);await page.getByRole('heading').first().waitFor();await page.keyboard.press('Tab');const focus=await page.evaluate(()=>({text:document.activeElement.textContent.trim(),href:document.activeElement.getAttribute('href'),width:document.activeElement.getBoundingClientRect().width}));assert.equal(focus.href,'#portal-content');assert(focus.width>10);await page.keyboard.press('Enter');assert.equal(await page.evaluate(()=>document.activeElement.id),'portal-content');q.proof.pages.push({route,skip_link_first:true,visible_on_focus:true,keyboard_target_reached:true});await q.shot(page,route.replace(/\W/g,'_')+'-keyboard',false);}q.proof.checks.keyboard_skip_links=true;q.proof.screen_reader_tested=false;q.proof.result='passed';
}catch(e){q.proof.result='failed';q.proof.error=sanitized(e);}finally{q.proof.finished_at=new Date().toISOString();q.save();await q.browser.close();console.log(JSON.stringify({result:q.proof.result,pages:q.proof.pages?.length,receipt:q.receipt}));if(q.proof.result!=='passed')process.exitCode=1;}})();
const { start, assert, sanitized } = require('./portal-visual-qa-lib.cjs');
void (async () => {
const q = await start('keyboard-chromium-20261010');
let page, _ctx;
try {
({ page, ctx: _ctx } = await q.context('anonymous', 390));
q.proof.pages = [];
for (const route of [
'/agronegocio',
'/turismo',
'/manifestar-interesse',
]) {
await q.open(page, route);
await page.getByRole('heading').first().waitFor();
await page.keyboard.press('Tab');
const focus = await page.evaluate(() => ({
text: document.activeElement.textContent.trim(),
href: document.activeElement.getAttribute('href'),
width: document.activeElement.getBoundingClientRect().width,
}));
assert.equal(focus.href, '#portal-content');
assert(focus.width > 10);
await page.keyboard.press('Enter');
assert.equal(
await page.evaluate(() => document.activeElement.id),
'portal-content',
);
q.proof.pages.push({
route,
skip_link_first: true,
visible_on_focus: true,
keyboard_target_reached: true,
});
await q.shot(page, route.replace(/\W/g, '_') + '-keyboard', false);
}
q.proof.checks.keyboard_skip_links = true;
q.proof.screen_reader_tested = false;
q.proof.result = 'passed';
} catch (e) {
q.proof.result = 'failed';
q.proof.error = sanitized(e);
} finally {
q.proof.finished_at = new Date().toISOString();
q.save();
await q.browser.close();
console.log(
JSON.stringify({
result: q.proof.result,
pages: q.proof.pages?.length,
receipt: q.receipt,
}),
);
if (q.proof.result !== 'passed') process.exitCode = 1;
}
})();