Skip to content

Commit

Permalink
Try wait-on package to get tests to run in Github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjarling committed Mar 29, 2024
1 parent 6c07dda commit 10f232d
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
node-version: 18
- name: Install dependencies
run: npm ci
env:
BASE_URL: ${{ secrets.BASE_URL }}

- name: Install Playwright Browsers
run: npx playwright install --with-deps
Expand All @@ -25,10 +23,15 @@ jobs:
run: npm run build

- name: Start app
run: npm run start
run: npm run start &

- name: Wait for server
run: npx wait-on http://localhost:3000

- name: Run Playwright tests
run: npx playwright test
env:
BASE_URL: ${{ secrets.BASE_URL }}

- uses: actions/upload-artifact@v3
if: always()
Expand Down
71 changes: 70 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
"next-router-mock": "^0.9.1-beta.0",
"prettier": "^3.0.1",
"ts-jest": "^29.0.5",
"typescript": "^5.4.2"
"typescript": "^5.4.2",
"wait-on": "^7.2.0"
},
"optionalDependencies": {
"fsevents": "^2.3.2"
Expand Down

0 comments on commit 10f232d

Please sign in to comment.