This repository was archived by the owner on Feb 12, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathOGCIO-tests.yml
More file actions
117 lines (99 loc) · 3.42 KB
/
Copy pathOGCIO-tests.yml
File metadata and controls
117 lines (99 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# OGCIO E2E Tests Pipeline
trigger:
- dev
- uat
- prod
pr:
autoCancel: true
branches:
include:
- "*"
parameters:
- name: validEnvironments
type: object
displayName: List of valid environments to run tests (do not change)
default: ['dev', 'uat', 'prod']
variables:
- ${{ if containsValue(parameters.validEnvironments ,variables['Build.SourceBranchName']) }}:
- template: pipeline-variables/${{ coalesce(variables['Build.SourceBranchName'], 'fallback') }}.yml
- ${{ else }}:
- template: pipeline-variables/dev.yml
- group: ogcio-e2e-test-credentials
resources:
repositories:
- repository: pipeline-templates
type: github
name: ogcio/building-blocks-pipelines
ref: refs/tags/v0.5.2
endpoint: ogcio
stages:
- stage: SecurityScan
displayName: Security Scans
jobs:
- template: security/gitleaks.yml@pipeline-templates
- stage: OGCIO_E2E_Tests
displayName: OGCIO E2E Tests
dependsOn: SecurityScan
jobs:
- job: PlaywrightTests
displayName: Run Playwright E2E Tests
pool:
vmImage: 'ubuntu-latest'
variables:
LOGTO_ADMIN_URL: 'https://logto-admin-$(environment).ogcio.gov.ie'
TEST_USERNAME: $(TEST_USERNAME)
TEST_PASSWORD: $(TEST_PASSWORD)
steps:
- checkout: self
displayName: 'Checkout source code'
- task: NodeTool@0
displayName: 'Setup Node.js'
inputs:
versionSpec: '20.x'
- script: |
npm install -g pnpm
displayName: 'Install pnpm'
- script: |
pnpm install --frozen-lockfile
displayName: 'Install dependencies'
- script: |
npx playwright install chromium
displayName: 'Install Playwright browsers'
- script: |
echo "Running tests against: $(LOGTO_ADMIN_URL)"
echo "Environment: $(environment)"
pnpm exec playwright test --project=chromium --reporter=junit
displayName: 'Run Playwright Tests'
env:
LOGTO_ADMIN_URL: $(LOGTO_ADMIN_URL)
TEST_USERNAME: $(TEST_USERNAME)
TEST_PASSWORD: $(TEST_PASSWORD)
CI: true
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: always()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'test-results/results.xml'
testRunTitle: 'OGCIO E2E Tests - $(environment)'
mergeTestResults: true
- task: PublishHtmlReport@1
displayName: 'Publish Playwright HTML Report'
condition: always()
inputs:
reportDir: 'playwright-report'
tabName: 'Playwright Report'
- task: PublishPipelineArtifact@1
displayName: 'Upload Playwright Report'
condition: always()
inputs:
targetPath: 'playwright-report'
artifact: 'playwright-report-$(environment)-$(System.JobId)'
publishLocation: 'pipeline'
- task: PublishPipelineArtifact@1
displayName: 'Upload Test Results'
condition: always()
inputs:
targetPath: 'test-results'
artifact: 'test-results-$(environment)-$(System.JobId)'
publishLocation: 'pipeline'