From 028b9636a109a780c455b4c44289089a3aa5db2b Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Thu, 4 Dec 2025 12:45:16 +0100 Subject: [PATCH 1/2] Add PR e2e workflow --- .github/workflows/endform-tests-on-prs.yml | 41 ++++++++++++++++++++++ playwright.config.ts | 3 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/endform-tests-on-prs.yml diff --git a/.github/workflows/endform-tests-on-prs.yml b/.github/workflows/endform-tests-on-prs.yml new file mode 100644 index 0000000..2c9f4c9 --- /dev/null +++ b/.github/workflows/endform-tests-on-prs.yml @@ -0,0 +1,41 @@ +name: Run end to end tests with endform + +on: + pull_request: + branches: + - main + +permissions: + contents: read + id-token: write # required for authentication with Endform + +jobs: + e2e: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Wait for Vercel deployment + uses: endformdev/actions/await-vercel-deployment@main + with: + project-name: endform-playwright-tutorial + set-url-env-var: BASE_URL # Sets the Vercel preview URL as this environment variable + + - name: Run end to end tests with endform + run: | + npx endform@latest test diff --git a/playwright.config.ts b/playwright.config.ts index 44ca464..61bf1d0 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -28,7 +28,8 @@ export default defineConfig({ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: "https://endform-playwright-tutorial.vercel.app", + baseURL: + process.env.BASE_URL || "https://endform-playwright-tutorial.vercel.app", // You can use this localhost baseURL if you are running the application locally // baseURL: "http://localhost:3000", From cabe3aa81bc2284c45fc46b99faf9edd2ccfa308 Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Mon, 15 Dec 2025 14:19:54 +0100 Subject: [PATCH 2/2] Update comment --- .github/workflows/endform-tests-on-prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/endform-tests-on-prs.yml b/.github/workflows/endform-tests-on-prs.yml index 2c9f4c9..402562d 100644 --- a/.github/workflows/endform-tests-on-prs.yml +++ b/.github/workflows/endform-tests-on-prs.yml @@ -34,7 +34,7 @@ jobs: uses: endformdev/actions/await-vercel-deployment@main with: project-name: endform-playwright-tutorial - set-url-env-var: BASE_URL # Sets the Vercel preview URL as this environment variable + set-url-env-var: BASE_URL # Sets the Vercel preview URL as the BASE_URL environment variable - name: Run end to end tests with endform run: |