Skip to content

Commit

Permalink
Playwright (#1407)
Browse files Browse the repository at this point in the history
* chore: remove cypress related stuff

* feat: set up Playwright & create an example test

* feat: add the `Playwright Tests` GitHub Action

* fix(gh action): add Build step

* cleanup(.gitignore): remove unnecessary line

* fix(gh action): install browsers before dependencies

* cleanup(fixtures): remove `console.log`

* fix(gh action): provide envs

* feat: run workflow on successful deployment

* feat: use `navigator.userAgent` to detect test user

* fix(gh action): run for specific URLs & pass deployment URL as env var

* fix(env): add `NEXT_PUBLIC_E2E_WALLET_MNEMONIC`

* fix(gh action): more specific url

* fix invalid workflow file

* trigger

* fix(gh action): negate `contains`

* fix(gh action): install dependencies

* fix(playwright.config): webServer config

* debug: temporarily log deployment_url

* fix(playwright): always generate html report

* fix(gh action): use `deployment_status.target_url`

* cleanup: revert env changes

* cleanup: remove unnecessary steps from workflow file

* fix: install `@playwright/test` globally

* fix: copy playwright to node_modules

* fix: install `@playwright/test` only

* cleanup: remove fake success returns in onchain tx related tests

* chore: upgrade `@playwright/test`

* fix: revert workflow changes, just run `npm ci`

* fix(gh action): concurrency
  • Loading branch information
BrickheadJohnny authored Jul 24, 2024
1 parent dc06aab commit 1514f37
Show file tree
Hide file tree
Showing 37 changed files with 457 additions and 1,715 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ALCHEMY_KEY=""
ARBITRUM_ALCHEMY_KEY=""
BALANCY_TOKEN=""
BASE_ALCHEMY_KEY=""
CYPRESS_RECORD_KEY=""
EDGE_CONFIG=""
GOERLI_ALCHEMY_KEY=""
GUILD_API_KEY=""
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Playwright Tests
on:
deployment_status:
workflow_dispatch:

concurrency:
group: "playwright"

jobs:
test:
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
env:
DEPLOYMENT_URL: ${{ github.event.deployment_status.target_url }}
run: npm run test
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ yarn-error.log*

.vercel

cypress/screenshots
cypress/videos

.idea
*.tsbuildinfo

*storybook.log
storybook-static

bun.lockb

/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
/playwright/results
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"attributePosition": "auto"
},
"files": {
"include": ["src", "cypress"],
"include": ["src", "playwright", "playwright.config.ts"],
"ignore": ["node_modules", ".next", "public", ".out", "package-lock.json"]
},
"organizeImports": {
Expand Down
53 changes: 0 additions & 53 deletions cypress.config.ts

This file was deleted.

167 changes: 0 additions & 167 deletions cypress/e2e/1-roles-requirements-rewards/0-manage-roles.spec.ts

This file was deleted.

98 changes: 0 additions & 98 deletions cypress/e2e/2-guild-checkout/0-payment-requirement.spec.ts

This file was deleted.

Loading

0 comments on commit 1514f37

Please sign in to comment.