File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 ./others/cicd/simci portainer-stack-delete gitlab-simfeatures "${{ secrets.PORTAINER_URL }}"
2121 ./others/cicd/simci portainer-stack-deploy -f ./others/cicd/portainer-stack.yml gitlab-simfeatures "${{ secrets.PORTAINER_URL }}"
2222
23+ playwright-tests :
24+ runs-on : ubuntu-latest
25+ needs : deploy-test
26+ steps :
27+ - name : Checkout
28+ uses : actions/checkout@v4
29+
30+ - name : Set up Node.js
31+ uses : actions/setup-node@v4
32+ with :
33+ node-version : ' 20'
34+
35+ - name : Install Playwright dependencies
36+ working-directory : ./others/playwright
37+ run : npm ci
38+
39+ - name : Install Playwright browsers
40+ working-directory : ./others/playwright
41+ run : npx playwright install --with-deps chromium
42+
43+ - name : Wait for app to be ready
44+ run : |
45+ APP_URL="https://gitlab-simfeatures.${{ secrets.PORTAINER_URL }}/ui"
46+ for i in $(seq 1 30); do
47+ if curl -sf -o /dev/null "$APP_URL"; then
48+ echo "App is ready"
49+ break
50+ fi
51+ echo "Waiting for app... ($i/30)"
52+ sleep 10
53+ done
54+ curl -sf -o /dev/null "$APP_URL" || (echo "App failed to become ready" && exit 1)
55+
56+ - name : Run Playwright tests
57+ working-directory : ./others/playwright
58+ env :
59+ CI : true
60+ BASE_URL : " https://gitlab-simfeatures.${{ secrets.PORTAINER_URL }}/ui"
61+ USER_NAME : playwright
62+ PASSWORD : ${{ secrets.PLAYWRIGHT_PASSWORD }}
63+ run : npx playwright test --project=chromium
64+
65+ - name : Upload Playwright report
66+ uses : actions/upload-artifact@v4
67+ if : failure()
68+ with :
69+ name : playwright-report
70+ path : others/playwright/playwright-report/
71+ retention-days : 7
72+
2373 unit-tests :
2474 runs-on : ubuntu-latest
2575 needs : deploy-test
Original file line number Diff line number Diff line change @@ -14,6 +14,35 @@ deploy-test:
1414 - ./others/cicd/simci portainer-stack-delete gitlab-simfeatures $PORTAINER_URL
1515 - ./others/cicd/simci portainer-stack-deploy -f ./others/cicd/portainer-stack.yml gitlab-simfeatures $PORTAINER_URL
1616
17+ playwright-tests :
18+ stage : test
19+ needs : [deploy-test]
20+ image : mcr.microsoft.com/playwright:v1.56.1-jammy
21+ variables :
22+ BASE_URL : " https://gitlab-simfeatures.${PORTAINER_URL}/ui"
23+ USER_NAME : playwright
24+ PASSWORD : " ${PLAYWRIGHT_PASSWORD}"
25+ before_script :
26+ - cd others/playwright
27+ - npm ci
28+ script :
29+ - |
30+ for i in $(seq 1 30); do
31+ if curl -sf -o /dev/null "$BASE_URL"; then
32+ echo "App is ready"
33+ break
34+ fi
35+ echo "Waiting for app... ($i/30)"
36+ sleep 10
37+ done
38+ curl -sf -o /dev/null "$BASE_URL" || (echo "App failed to become ready" && exit 1)
39+ - npx playwright test --project=chromium
40+ artifacts :
41+ when : on_failure
42+ paths :
43+ - others/playwright/playwright-report/
44+ expire_in : 7 days
45+
1746unit-tests :
1847 stage : test
1948 script :
Original file line number Diff line number Diff line change 1+ {
2+ "row_module_id__mdl_name" : " SimFeatures" ,
3+ "dt_name" : " PlaywrightUser" ,
4+ "dt_file" : {
5+ "path" : " others/playwright/playwright_user.xml" ,
6+ "mime" : " text/xml" ,
7+ "name" : " playwright_user.xml"
8+ },
9+ "dt_desc" : " Creates the playwright user with FT_ADMIN responsibility for Playwright E2E tests." ,
10+ "dt_exportdate_from" : null ,
11+ "dt_exportdate_to" : null ,
12+ "dt_export_format" : " xml" ,
13+ "dt_export_zip" : false
14+ }
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "description" : " " ,
55 "main" : " index.js" ,
6- "scripts" : {},
6+ "scripts" : {
7+ "test" : " playwright test"
8+ },
79 "keywords" : [],
810 "author" : " " ,
911 "license" : " ISC" ,
You can’t perform that action at this time.
0 commit comments