Skip to content

Commit

Permalink
Run e2e tests on Vercel deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tehnix committed Jan 10, 2024
1 parent d332ed2 commit a7be0bf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/vercel-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,15 @@ jobs:
run: |
echo "Preview URLs:" >> $GITHUB_STEP_SUMMARY
url="$(bunx vercel deploy --prod --scope=${{ secrets.VERCEL_ORG_ID }} --token=${{ secrets.VERCEL_TOKEN }})"
echo "url=$url" >> $GITHUB_OUTPUT
echo "- Direct URL: $url" >> $GITHUB_STEP_SUMMARY
echo $GITHUB_STEP_SUMMARY
- name: Install dependencies and setup Playwright
run: just setup deployment

- name: End-to-end tests
working-directory: ./deployment
env:
UI_INTERNAL_E2E_URL: ${{ steps.deployment.outputs.url }}
run: just e2e deployment ui-internal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';

const SERVER = `https://${process.env.DOMAIN}`;
const SERVER = process.env.UI_APP_E2E_URL ?? `https://${process.env.DOMAIN}`;

test('localization translates text when changing language', async ({ page }) => {
await page.goto(`${SERVER}/`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';

const SERVER = `https://internal.${process.env.DOMAIN}`;
const SERVER = process.env.UI_INTERNAL_E2E_URL ?? `https://internal.${process.env.DOMAIN}`;

test('localization translates text when changing language', async ({ page }) => {
await page.goto(`${SERVER}/`);
Expand Down
16 changes: 8 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,17 @@ test project:
just _test-{{project}}

# Run End-to-End tests for <project>, e.g. `just e2e ui-internal`.
e2e project:
just _e2e-{{project}}
e2e project +tests="":
just _e2e-{{project}} {{tests}}

_e2e-deployment:
cd deployment/end2end && bun run e2e
_e2e-deployment +tests="":
cd deployment/end2end && bun run e2e {{tests}}

_e2e-ui-app:
cd ui-app/end2end && bun run e2e
_e2e-ui-app +tests="":
cd ui-app/end2end && bun run e2e {{tests}}

_e2e-ui-internal:
cd ui-internal/end2end && bun run e2e
_e2e-ui-internal +tests="":
cd ui-internal/end2end && bun run e2e {{tests}}

# Run <project> development server, e.g. `just dev ui-app`.
dev project:
Expand Down

0 comments on commit a7be0bf

Please sign in to comment.