Skip to content

Commit 18d5318

Browse files
committed
chore(ui-testing): Trigger in workflow
1 parent b1d3d9a commit 18d5318

1 file changed

Lines changed: 62 additions & 2 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: E2E Tests
22

33
permissions:
44
contents: read
5+
id-token: write # Required for AWS OIDC authentication
56

67
on:
78
# Manual trigger for development iteration
@@ -19,6 +20,10 @@ on:
1920
branches:
2021
- main
2122

23+
env:
24+
AWS_REGION: eu-west-1
25+
ENV: dev
26+
2227
jobs:
2328
e2e-tests:
2429
runs-on: ubuntu-latest
@@ -28,5 +33,60 @@ jobs:
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

Comments
 (0)