diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 1a0fb94..2c6c20d 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -10,6 +10,8 @@ jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest + env: + NODE_ENV: test steps: - uses: actions/checkout@v4 diff --git a/tests/blog-app.spec.ts b/tests/blog-app.spec.ts index 6c62676..90e3363 100644 --- a/tests/blog-app.spec.ts +++ b/tests/blog-app.spec.ts @@ -460,8 +460,8 @@ test.describe("Blog Application", () => { // Generate new token without reloading await page.getByTestId("generate-token-button").click() - // Wait for token to potentially change - await page.waitForTimeout(500) + // Wait for the token text to actually change (server action + revalidate) + await expect(page.getByTestId("api-token")).not.toHaveText(firstToken!) const secondToken = await page.getByTestId("api-token").textContent() // Tokens should be different