test(auth): capture deployed split login layouts in release acceptance
This commit is contained in:
@@ -27,6 +27,26 @@ const assert=require('node:assert/strict');
|
||||
}
|
||||
if(checkLegacy&&!process.argv.includes('--diagnose'))assert.deepEqual(metrics.filter(m=>m.overflow.length),[],'Default copy must fit every native slot');
|
||||
await page.goto(base+'/',{waitUntil:'networkidle'});await page.getByRole('heading',{name:/想法不该停在对话里/}).waitFor();await page.screenshot({path:dir+'/landing-desktop.png',fullPage:true});
|
||||
// Verify the public account flow in this fresh context, without submitting credentials.
|
||||
await page.setViewportSize({width:1128,height:959});
|
||||
await page.goto(base+'/account?next=/workspace',{waitUntil:'domcontentloaded'});
|
||||
await page.locator('button[data-theme-ready="true"]').waitFor();
|
||||
await page.getByLabel('邮箱地址',{exact:true}).waitFor();
|
||||
assert.equal(await page.locator('aside').count(),0,'Authentication must not include a workspace sidebar');
|
||||
assert.equal(await page.getByRole('link',{name:'创建文档',exact:true}).count(),0);
|
||||
assert.equal(await page.locator('.endoleap-brand').count(),1,'Only one brand belongs on the account page');
|
||||
const accountSections=await page.locator('#account-content > div > section').evaluateAll(elements=>elements.map(el=>{const r=el.getBoundingClientRect();return {x:r.x,right:r.right,width:r.width}}));
|
||||
assert.equal(accountSections.length,2);
|
||||
assert.ok(accountSections[0].right<=accountSections[1].x,'Brand panel and credentials occupy separate columns');
|
||||
await page.screenshot({path:dir+'/account-desktop.png',fullPage:true});
|
||||
await page.getByRole('button',{name:'创建账户',exact:true}).click();
|
||||
await page.getByRole('heading',{name:'创建你的账户',exact:true}).waitFor();
|
||||
await page.screenshot({path:dir+'/account-register.png',fullPage:true});
|
||||
await page.getByRole('button',{name:'登录',exact:true}).click();
|
||||
await page.setViewportSize({width:390,height:844});
|
||||
assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),'Mobile account page must not overflow horizontally');
|
||||
await page.screenshot({path:dir+'/account-mobile.png',fullPage:true});
|
||||
await page.setViewportSize({width:1100,height:1000});
|
||||
await page.goto(base+'/graphic',{waitUntil:'networkidle'});
|
||||
assert.equal(new URL(page.url()).pathname,'/graphic');
|
||||
await page.getByRole('button',{name:'添加文字',exact:true}).waitFor({state:'visible'});
|
||||
|
||||
Reference in New Issue
Block a user