Skip to content

Commit

Permalink
fix: debug workflow of playwright (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyutaotao authored Dec 16, 2024
1 parent bd24344 commit 9326330
Show file tree
Hide file tree
Showing 8 changed files with 459 additions and 554 deletions.
2 changes: 1 addition & 1 deletion playwright-demo/e2e/online-order-zh.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test.beforeEach(async ({ page }) => {
});

test("ai online order", async ({ page, ai }) => {
await ai("点击左上角语言切换按钮(英文、中文),在弹出的下拉列表中点击中文");
await ai("点击左上角语言切换按钮(English、中文),在弹出的下拉列表中点击中文");
await ai("向下滚动一屏");
await ai("直接点击多肉葡萄的规格按钮");
await ai("点击不使用吸管、点击冰沙推荐、点击正常冰推荐");
Expand Down
10 changes: 4 additions & 6 deletions playwright-demo/e2e/todo-mvc-en.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ test.beforeEach(async ({ page }) => {
await page.goto("https://todomvc.com/examples/react/dist/");
});

test("ai todo - English Prompt - should fail", async ({
ai,
aiQuery,
aiAssert,
}) => {
test("ai todo - English Prompt", async ({ ai, aiQuery, aiAssert }) => {
await ai(
"Input 'Study JS today' in the task box input and press the Enter key"
);
Expand All @@ -29,5 +25,7 @@ test("ai todo - English Prompt - should fail", async ({

expect(list.length).toEqual(1);

await aiAssert('At the bottom of the page, it shows "1 item left".');
await aiAssert(
'Near the bottom of the page, there is a tip shows "1 item left".'
);
});
8 changes: 2 additions & 6 deletions playwright-demo/e2e/todo-mvc-zh.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ test.beforeEach(async ({ page }) => {
await page.goto("https://todomvc.com/examples/react/dist/");
});

test("ai todo - Chinese Prompt - should fail", async ({
ai,
aiQuery,
aiAssert,
}) => {
test("ai todo - Chinese Prompt", async ({ ai, aiQuery, aiAssert }) => {
await ai("在任务框 input 输入 今天学习 JS,按回车键");
await ai("在任务框 input 输入 明天学习 Rust,按回车键");
await ai("在任务框 input 输入后天学习 AI,按回车键");
Expand All @@ -20,5 +16,5 @@ test("ai todo - Chinese Prompt - should fail", async ({
const list = await aiQuery("string[], 完整的任务列表");
expect(list.length).toEqual(1);

await aiAssert('页面底部显示有 "1 item left"');
await aiAssert('页面下方有一个区域显示有 "1 item left"');
});
Loading

0 comments on commit 9326330

Please sign in to comment.