【发布时间】:2022-08-09 23:37:56
【问题描述】:
我正在使用剧作家进行 e2e 测试以检查电子邮件是否存在,并且在我运行测试时它说: \"已完成测试流程,状态通过\"
但它告诉我测试失败了,因为我有断言错误而不是因为我做错了什么
这是我的一段代码:
const fillEmail = async (page: Page, value: string) =>
await page.fill(\"email-for-test\", value);
const fillPassword = async (page: Page, value: string) =>
await page.fill(\"password-for-test\", value);
await fillName(page, name);
await fillEmail(page, email);
const res = await page.locator(\'.email-error\').innerText(); // return error string
expect(res).toContain(\"Email is already in used\");
标签: testing e2e-testing playwright playwright-test