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
+73 -10
View File
@@ -1,10 +1,73 @@
const {start,BASE,assert,sanitized}=require('./portal-visual-qa-lib.cjs');
(async()=>{const q=await start('c37-qa18-chromium-20261010');try{
q.phase('QA18 password → MFA → authenticated investment session');let {ctx,page}=await q.context('investor18');
await q.login(page,'investor18');await q.open(page,'/investimentos');await page.getByRole('heading',{name:'Preparar um investimento',exact:true}).waitFor();
await page.reload({waitUntil:'domcontentloaded'});await page.getByRole('heading',{name:'Preparar um investimento',exact:true}).waitFor();await q.shot(page,'investments-reloaded',false);
q.proof.cookies=(await ctx.cookies(BASE)).map(({name,domain,path,secure,httpOnly,sameSite})=>({name,domain,path,secure,httpOnly,sameSite}));
q.proof.checks.login_mfa_redirect_reload=true;await q.logout(page);assert.equal((await q.json(page,'/investimentos')).status,401);await ctx.close();
({ctx,page}=await q.context('investor18-new-session'));await q.login(page,'investor18');await q.open(page,'/investimentos');await page.getByRole('heading',{name:'Preparar um investimento',exact:true}).waitFor();await q.shot(page,'new-session',false);q.proof.checks.logout_revokes_new_login_succeeds=true;
q.proof.result='passed';q.proof.manual_user_context_confirmed=false;await q.logout(page);await ctx.close();
}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,checks:q.proof.checks,receipt:q.receipt}));if(q.proof.result!=='passed')process.exitCode=1;}})();
const {
start,
BASE,
assert,
sanitized,
} = require('./portal-visual-qa-lib.cjs');
void (async () => {
const q = await start('c37-qa18-chromium-20261010');
try {
q.phase('QA18 password → MFA → authenticated investment session');
let { ctx, page } = await q.context('investor18');
await q.login(page, 'investor18');
await q.open(page, '/investimentos');
await page
.getByRole('heading', {
name: 'Preparar um investimento',
exact: true,
})
.waitFor();
await page.reload({ waitUntil: 'domcontentloaded' });
await page
.getByRole('heading', {
name: 'Preparar um investimento',
exact: true,
})
.waitFor();
await q.shot(page, 'investments-reloaded', false);
q.proof.cookies = (await ctx.cookies(BASE)).map(
({ name, domain, path, secure, httpOnly, sameSite }) => ({
name,
domain,
path,
secure,
httpOnly,
sameSite,
}),
);
q.proof.checks.login_mfa_redirect_reload = true;
await q.logout(page);
assert.equal((await q.json(page, '/investimentos')).status, 401);
await ctx.close();
({ ctx, page } = await q.context('investor18-new-session'));
await q.login(page, 'investor18');
await q.open(page, '/investimentos');
await page
.getByRole('heading', {
name: 'Preparar um investimento',
exact: true,
})
.waitFor();
await q.shot(page, 'new-session', false);
q.proof.checks.logout_revokes_new_login_succeeds = true;
q.proof.result = 'passed';
q.proof.manual_user_context_confirmed = false;
await q.logout(page);
await ctx.close();
} 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,
checks: q.proof.checks,
receipt: q.receipt,
}),
);
if (q.proof.result !== 'passed') process.exitCode = 1;
}
})();