Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: e2eテストのタイムアウトの指定を修正 #1286

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tests/e2e/example.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ test("起動したら「利用規約に関するお知らせ」が表示され
VITE_DEV_SERVER_URL: "http://localhost:5173",
},
});
const sut = await app.firstWindow();

// FIXME:
// firstWindowにタイムアウトが設定できないのでワークアラウンドを使用している。
// (cf: https://github.com/microsoft/playwright/issues/21846#issuecomment-1479106814)
// 正式版でタイムアウトを設定できるようになったら(cf: https://github.com/microsoft/playwright/pull/21863 )
// app.firstWindowを使うようにする。
// const sut = await app.firstWindow();
let sut = app.windows()[0];
if (!sut) sut = await app.waitForEvent("window", { timeout: 0 });
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved

// エンジンが起動し「利用規約に関するお知らせ」が表示されるのを待つ
await sut.waitForSelector("text=利用規約に関するお知らせ");
await sut.waitForSelector("text=利用規約に関するお知らせ", { timeout: 0 });
await app.close();
});