-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
import { expect, test } from "@playwright/test" | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test.describe.configure({ mode: "serial" }) | ||
test.describe.configure({ mode: "serial" }); | ||
|
||
let publicLogUrl: string | ||
let publicLogUrl: string; | ||
|
||
test("make a log public", async ({ page, context }) => { | ||
await context.grantPermissions(["clipboard-read", "clipboard-write"]) | ||
await context.grantPermissions(["clipboard-read", "clipboard-write"]); | ||
|
||
await page.goto("/logs") | ||
await page.goto("/logs"); | ||
|
||
await page.waitForLoadState("networkidle") | ||
await page.waitForLoadState("networkidle"); | ||
|
||
await page.getByText("xyzTESTxyz").click() | ||
await page.getByText("xyzTESTxyz").click(); | ||
|
||
await page.getByTestId("make-log-public-switch").click() | ||
await page.getByTestId("selected-run-menu").click(); | ||
await page.getByTestId("toggle-run-visibility").click(); | ||
|
||
publicLogUrl = await page.evaluate(() => { | ||
const urlParams = new URLSearchParams(window.location.search) | ||
const selected = urlParams.get("selected") | ||
return `${window.location.origin}/logs/${selected}` | ||
}) | ||
}) | ||
const urlParams = new URLSearchParams(window.location.search); | ||
const selected = urlParams.get("selected"); | ||
return `${window.location.origin}/logs/${selected}`; | ||
}); | ||
}); | ||
|
||
test("unauthenticated user can access public log URL", async ({ browser }) => { | ||
const context = await browser.newContext() | ||
const page = await context.newPage() | ||
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
|
||
await page.goto(publicLogUrl) | ||
await page.waitForLoadState("networkidle") | ||
await page.goto(publicLogUrl); | ||
await page.waitForLoadState("networkidle"); | ||
|
||
await expect(page.getByText("xyzTESTxyz")).toBeVisible() | ||
await expect(page.getByText("xyzTESTxyz")).toBeVisible(); | ||
|
||
await context.close() | ||
}) | ||
await context.close(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters