Skip to content

Commit 0036612

Browse files
committed
Add GitHub Actions pipeline
1 parent 8105cd0 commit 0036612

File tree

5 files changed

+102
-12
lines changed

5 files changed

+102
-12
lines changed

Diff for: .github/workflows/e2e-test-automation.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: E2E Test Automation
2+
3+
on: [ push ]
4+
5+
jobs:
6+
chrome:
7+
timeout-minutes: 30
8+
runs-on: ubuntu-latest
9+
container:
10+
image: mcr.microsoft.com/playwright:v1.38.1-jammy
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 'latest'
17+
18+
- name: Install dependencies
19+
run: npm ci
20+
21+
- name: Run Chrome scenarios
22+
run: npm run test:chrome
23+
env:
24+
BASE_URL: ${{ vars.BASE_URL }}
25+
HEADLESS: ${{ vars.HEADLESS }}
26+
OUTPUT_PATH: output-chrome
27+
28+
- uses: actions/upload-artifact@v3
29+
if: always()
30+
with:
31+
name: chrome-artifacts
32+
path: output-chrome
33+
retention-days: 30
34+
35+
firefox:
36+
timeout-minutes: 30
37+
runs-on: ubuntu-latest
38+
container:
39+
image: mcr.microsoft.com/playwright:v1.38.1-jammy
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-node@v3
44+
with:
45+
node-version: 'latest'
46+
47+
- name: Install dependencies
48+
run: npm ci
49+
50+
- name: Run Firefox scenarios
51+
run: npm run test:firefox
52+
env:
53+
BASE_URL: ${{ vars.BASE_URL }}
54+
HEADLESS: ${{ vars.HEADLESS }}
55+
OUTPUT_PATH: output-firefox
56+
# Workaround to fix GitHub Actions issue:
57+
# Running Nightly as root in a regular user's session is not supported.
58+
# See https://github.com/microsoft/playwright/issues/6500
59+
HOME: /root
60+
61+
- uses: actions/upload-artifact@v3
62+
if: always()
63+
with:
64+
name: firefox-artifacts
65+
path: output-firefox
66+
retention-days: 30
67+
68+
safari:
69+
timeout-minutes: 30
70+
runs-on: ubuntu-latest
71+
container:
72+
image: mcr.microsoft.com/playwright:v1.38.1-jammy
73+
74+
steps:
75+
- uses: actions/checkout@v4
76+
- uses: actions/setup-node@v3
77+
with:
78+
node-version: 'latest'
79+
80+
- name: Install dependencies
81+
run: npm ci
82+
83+
- name: Run Safari scenarios
84+
run: npm run test:safari
85+
env:
86+
BASE_URL: ${{ vars.BASE_URL }}
87+
HEADLESS: ${{ vars.HEADLESS }}
88+
OUTPUT_PATH: output-safari
89+
90+
- uses: actions/upload-artifact@v3
91+
if: always()
92+
with:
93+
name: safari-artifacts
94+
path: output-safari
95+
retention-days: 30

Diff for: codecept.conf.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'dotenv/config'
2-
import { devices } from 'playwright'
32
import { setHeadlessWhen, setWindowSize } from '@codeceptjs/configure'
43

54
setHeadlessWhen(process.env.HEADLESS === 'true')
@@ -8,7 +7,7 @@ setWindowSize(1600, 1200)
87
export const config: CodeceptJS.MainConfig = {
98
name: 'codeceptjs-playwright-typescript-boilerplate',
109
tests: './tests/**/**.spec.ts',
11-
output: './output',
10+
output: process.env.OUTPUT_PATH,
1211
helpers: {
1312
Playwright: {
1413
url: process.env.BASE_URL,

Diff for: package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
"version": "1.0.0",
44
"description": "CodeceptJS Playwright Typescript Boilerplate",
55
"scripts": {
6-
"test": "npm run test:chrome",
7-
"test:parallel": "npx codeceptjs run-workers 2",
8-
"test:all": "npx codeceptjs run-multiple desktop --steps",
9-
"test:chrome": "npx codeceptjs run-multiple desktop:chromium --steps",
10-
"test:firefox": "npx codeceptjs run-multiple desktop:firefox --steps",
11-
"test:safari": "npx codeceptjs run-multiple desktop:webkit --steps"
6+
"test": "npx codeceptjs run-multiple desktop --steps",
7+
"test:chrome": "npx codeceptjs run-workers 2 desktop:chromium",
8+
"test:firefox": "npx codeceptjs run-workers 2 desktop:firefox",
9+
"test:safari": "npx codeceptjs run-workers 2 desktop:webkit"
1210
},
1311
"keywords": [
1412
"qa",
@@ -29,7 +27,7 @@
2927
"axe-playwright": "^1.2.3",
3028
"codeceptjs": "^3.5.5",
3129
"dotenv": "^16.3.1",
32-
"playwright": "^1.37.1",
30+
"playwright": "^1.38.1",
3331
"ts-node": "^10.9.1",
3432
"typescript": "^5.1.6"
3533
}

Diff for: pages/HomePage.ts

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ const { I } = inject()
33
export = {
44
assert: () => {
55
I.seeTitleEquals('Bear Plus | Award Winning Digital Agency')
6-
7-
I.see('We support worldwide businesses and startups by turning their visions into digital products that drive substantial results.')
86
},
97
}

0 commit comments

Comments
 (0)