Skip to content

Commit 84ed8bc

Browse files
committed
test(project-bootstrap): try make test more reliable
1 parent 0a0c5b8 commit 84ed8bc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/project-bootstrap.browser-authenticated.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ const baseURL = new URL(process.env.BASE_URL as string);
1111
baseURL.pathname = process.env.BASE_PATH ?? "/";
1212

1313
test("Project bootstrap works", async ({ page, baseURL }) => {
14-
// Display any logs to terminal (for debug)
15-
page.on("console", async (msg) => {
16-
console.log("Browser Log: ", msg);
17-
});
18-
1914
// Go to http://localhost:3000/
2015
// This needs to come before the unit fetch request below so there isn't a cors issue
2116
await page.goto(baseURL ?? "/");
@@ -90,10 +85,14 @@ test("Project bootstrap works", async ({ page, baseURL }) => {
9085
// Click button:has-text("Create")
9186
await page.locator(`button:has-text("Create")`).click();
9287

88+
await page.locator(`button:has-text("Create")`).isDisabled();
89+
90+
await page.getByRole("alert", { name: "Project created" }).isVisible();
91+
9392
const regexp = new RegExp(
9493
baseURL + "/?\\?project=project-[\\w\\d]+-[\\w\\d]+-[\\w\\d]+-[\\w\\d]+-[\\w\\d]+",
9594
);
96-
await expect(page).toHaveURL(regexp);
95+
await expect(page).toHaveURL(regexp, { timeout: 30_000 });
9796

9897
// Click [aria-label="Settings"]
9998
await page.locator(`[aria-label="Settings"]`).click();

0 commit comments

Comments
 (0)