diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f6fdf0a4a..6ca28afc3 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,11 +1,14 @@ name: Playwright Tests on: + push: + branches: [master] pull_request: branches: [master] env: URL: "https://deploy-preview-${{ github.event.number }}.muckcloud.com" + PLAYWRIGHT_TEST_BASE_URL: "https://deploy-preview-${{ github.event.number }}.muckcloud.com" jobs: wait: @@ -29,6 +32,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + - name: Install dependencies run: npm ci diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 28af529a0..000000000 --- a/netlify.toml +++ /dev/null @@ -1,5 +0,0 @@ -[[context.deploy-preview.plugins]] - package = "netlify-plugin-playwright-cache" - -[[context.deploy-preview.plugins]] - package = "/plugins/test" diff --git a/tests/anonymous/viewer/document.spec.js b/tests/anonymous/viewer/document.spec.js index 842f86bc6..88f99167d 100644 --- a/tests/anonymous/viewer/document.spec.js +++ b/tests/anonymous/viewer/document.spec.js @@ -9,6 +9,8 @@ test("test", async ({ page }) => { "/documents/20000007-finalseasonal_allergies_pollen_and_mold_2023__en"; await page.goto(url); + expect(new URL(page.url()).pathname).toBe(url); + await expect(page.locator(".sidebar").getByRole("heading")).toHaveText(title); await page.getByRole("link", { name: "Original Document (PDF) ยป" }).click(); @@ -17,9 +19,7 @@ test("test", async ({ page }) => { await page.getByRole("link", { name: "p. 1" }).click(); - const currentUrl = new URL(page.url()); - - expect(currentUrl.hash).toEqual("#document/p1"); + expect(new URL(page.url()).hash).toEqual("#document/p1"); await page .locator("div")