@@ -2,6 +2,7 @@ name: E2E Tests
22
33permissions :
44 contents : read
5+ id-token : write # Required for AWS OIDC authentication
56
67on :
78 # Manual trigger for development iteration
1920 branches :
2021 - main
2122
23+ env :
24+ AWS_REGION : eu-west-1
25+ ENV : dev
26+
2227jobs :
2328 e2e-tests :
2429 runs-on : ubuntu-latest
2833 github.event.workflow_run.conclusion == 'success'
2934
3035 steps :
31- - name : E2E Tests Placeholder
32- run : echo "TODO"
36+ - name : Checkout code
37+ uses : actions/checkout@v4
38+
39+ - name : Configure AWS credentials
40+ uses : aws-actions/configure-aws-credentials@v4
41+ with :
42+ role-to-assume : ${{ secrets.AWS_ROLE_ARN }}
43+ role-session-name : GitHub_E2E_Tests
44+ aws-region : ${{ env.AWS_REGION }}
45+
46+ - name : Get deployment URL from CDK stack
47+ id : get-url
48+ run : |
49+ BASE_URL=$(aws cloudformation describe-stacks \
50+ --stack-name "StickerlandiaSharedResources-${{ env.ENV }}" \
51+ --query "Stacks[0].Outputs[?OutputKey=='BaseUrl'].OutputValue" \
52+ --output text)
53+ echo "BASE_URL=${BASE_URL}" >> $GITHUB_OUTPUT
54+ echo "Deployment URL: ${BASE_URL}"
55+
56+ - name : Setup Node.js
57+ uses : actions/setup-node@v4
58+ with :
59+ node-version : ' 22'
60+ cache : ' npm'
61+ cache-dependency-path : e2e/package-lock.json
62+
63+ - name : Install Playwright dependencies
64+ working-directory : e2e
65+ run : npm ci
66+
67+ - name : Install Playwright browsers
68+ working-directory : e2e
69+ run : npx playwright install --with-deps chromium
70+
71+ - name : Run E2E tests against AWS
72+ working-directory : e2e
73+ run : npx playwright test
74+ env :
75+ CI : true
76+ BASE_URL : ${{ steps.get-url.outputs.BASE_URL }}
77+
78+ - name : Upload Playwright report
79+ uses : actions/upload-artifact@v4
80+ if : always()
81+ with :
82+ name : playwright-report
83+ path : e2e/playwright-report/
84+ retention-days : 7
85+
86+ - name : Upload test results
87+ uses : actions/upload-artifact@v4
88+ if : failure()
89+ with :
90+ name : test-results
91+ path : e2e/test-results/
92+ retention-days : 7
0 commit comments