|
|
@@ -35,8 +35,19 @@ try{
|
|
|
});
|
|
|
const page=await context.newPage();page.on('pageerror',e=>errors.push(e.message));page.on('dialog',d=>d.accept());
|
|
|
await page.goto(origin+'/pages/home/index');await page.locator('.coach-memory-list article').waitFor();
|
|
|
- assert.match(await page.locator('.income-breakdown').innerText(),/\*\*\*/);await page.getByRole('button',{name:'显示累计收入'}).click();await page.waitForFunction(()=>document.querySelector('.income-breakdown')?.textContent.includes('¥122.00'));assert.match(await page.locator('.income-breakdown').innerText(),/¥120\.00[\s\S]*¥2\.00[\s\S]*¥122\.00/);
|
|
|
- assert.ok(calls.some(p=>p.action==='app_review_page'&&p.scope==='today'&&p.pageSize===100&&p.date===day&&p.includeMetadata===false));checks.push('首页当天范围、三项累计收入同显同隐');
|
|
|
+ assert.match(await page.locator('.commission').innerText(), /累计收入[\s\S]*\*\*\*/);
|
|
|
+ assert.match(await page.locator('.coach-footer').innerText(), /累计时长 2\.5/);
|
|
|
+ assert.equal(await page.locator('.income-breakdown').count(),0);
|
|
|
+ assert.doesNotMatch(await page.locator('.coach-hero').innerText(), /累计带课工资|累计复习工资|已记账收入|不代表已发放|工资待核对/);
|
|
|
+ await page.getByRole('button',{name:'显示累计收入'}).click();
|
|
|
+ await page.waitForFunction(()=>document.querySelector('.commission')?.textContent.includes('¥122.00'));
|
|
|
+ assert.match(await page.locator('.commission').innerText(), /¥122\.00/);
|
|
|
+ await page.getByRole('button',{name:'隐藏累计收入'}).click();
|
|
|
+ await page.waitForFunction(()=>document.querySelector('.commission')?.textContent.includes('***'));
|
|
|
+ assert.doesNotMatch(await page.locator('.commission').innerText(), /¥122/);
|
|
|
+ await page.getByRole('button',{name:'显示累计收入'}).click();
|
|
|
+ await page.waitForFunction(()=>document.querySelector('.commission')?.textContent.includes('¥122.00'));
|
|
|
+ assert.ok(calls.some(p=>p.action==='app_review_page'&&p.scope==='today'&&p.pageSize===100&&p.date===day&&p.includeMetadata===false));checks.push('首页当天范围、仅保留时长和总收入、默认隐藏且眼睛可切换');
|
|
|
await page.screenshot({path:out+'/home-390.png',fullPage:true});
|
|
|
await page.getByRole('button',{name:'查看计划',exact:true}).click();await page.locator('.record-list').waitFor();assert.equal(await page.getByRole('button',{name:'返回复习任务',exact:true}).count(),0);await page.screenshot({path:out+'/review-390.png',fullPage:true});await page.getByRole('button',{name:'返回',exact:true}).click();await page.locator('.coach-memory-list article').waitFor();assert.equal(calls.filter(p=>p.action==='app_review_page'&&p.scope==='today').length,1);await page.getByRole('button',{name:'查看计划',exact:true}).click();await page.locator('.record-list').waitFor();checks.push('复习页仅保留顶部返回,返回首页不重新加载任务');await page.getByRole('button',{name:'结束本次复习',exact:true}).click();await page.locator('.review-complete').waitFor();assert.match(await page.locator('.review-complete').innerText(),/本次收入 ¥1\.00/);await page.screenshot({path:out+'/review-complete-390.png',fullPage:true});
|
|
|
await page.getByRole('link',{name:'返回首页',exact:true}).click();await page.getByText('今天的复习任务已全部完成').waitFor();checks.push('完成结果显示服务器金额、返回首页更新缓存计数且不重新请求');
|