File tree Expand file tree Collapse file tree 4 files changed +73
-6
lines changed
Expand file tree Collapse file tree 4 files changed +73
-6
lines changed Original file line number Diff line number Diff line change 1+ name : E2E Tests
2+
3+ on :
4+ push :
5+ branches :
6+ - develop
7+ pull_request :
8+ branches :
9+ - develop
10+
11+ jobs :
12+ e2e :
13+ runs-on : ubuntu-latest
14+
15+ env :
16+ DATABASE_URL : " postgresql://postgres:secret@localhost:5432/postgres"
17+ NEXTAUTH_URL : http://localhost:3000/api/auth
18+ GITHUB_ID : ${{ secrets.E2E_GITHUB_ID }}
19+ GITHUB_SECRET : ${{ secrets.E2E_GITHUB_SECRET }}
20+ NEXTAUTH_SECRET : " please_keep_this_secret"
21+
22+ steps :
23+ - name : Checkout repository
24+ uses : actions/checkout@v3
25+
26+ - name : Setup Node.js
27+ uses : actions/setup-node@v3
28+ with :
29+ node-version : ' lts/*'
30+
31+ - name : Run docker-compose
32+ uses : hoverkraft-tech/compose-action@v2.0.1
33+ with :
34+ compose-file : " ./docker-compose.yml"
35+ services : |
36+ db
37+
38+ - name : Wait for DB to be ready
39+ run : |
40+ until nc -z localhost 5432; do
41+ echo "Waiting for database connection..."
42+ sleep 5
43+ done
44+
45+ - name : Install dependencies
46+ run : npm install
47+
48+ - name : Install Playwright browsers
49+ run : npx playwright install --with-deps
50+
51+ - name : Seed database
52+ run : |
53+ npm run db:push
54+ npm run db:seed
55+
56+ - name : Run Playwright tests
57+ run : npx playwright test --reporter=html
58+
59+ - uses : actions/upload-artifact@v4
60+ if : ${{ !cancelled() }}
61+ with :
62+ name : playwright-report
63+ path : playwright-report/
64+ retention-days : 30
Original file line number Diff line number Diff line change 11import { test , expect } from "playwright/test" ;
22
3- test . describe ( "Articles" , ( ) => {
3+ test . skip ( "Articles" , ( ) => {
44 test ( "Should load more articles when scrolling to the end of the page" , async ( {
55 page,
66 } ) => {
Original file line number Diff line number Diff line change 44 "private" : true ,
55 "scripts" : {
66 "dev" : " next dev" ,
7+ "dev:e2e" : " ENV=E2E next dev" ,
78 "build" : " next build" ,
89 "ci-build" : " next build" ,
910 "start" : " next start" ,
Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ export default defineConfig({
4949 // },
5050
5151 /* Test against mobile viewports. */
52- {
53- name : "Mobile Chrome" ,
54- use : { ...devices [ "Pixel 5" ] } ,
55- } ,
52+ // {
53+ // name: "Mobile Chrome",
54+ // use: { ...devices["Pixel 5"] },
55+ // },
5656 // {
5757 // name: 'Mobile Safari',
5858 // use: { ...devices['iPhone 12'] },
@@ -69,9 +69,11 @@ export default defineConfig({
6969 // },
7070 ] ,
7171
72+ outputDir : "playwright-report" ,
73+
7274 /* Run your local dev server before starting the tests */
7375 webServer : {
74- command : "npm run dev" ,
76+ command : "npm run dev:e2e " ,
7577 url : "http://127.0.0.1:3000" ,
7678 reuseExistingServer : ! process . env . CI ,
7779 } ,
You can’t perform that action at this time.
0 commit comments