-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (114 loc) · 4.03 KB
/
selenium_test.yml
File metadata and controls
142 lines (114 loc) · 4.03 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Java CI with Maven
on:
pull_request:
branches: [ main ]
permissions:
contents: write
pages: write
id-token: write
actions: read
checks: write
jobs:
build:
name: Build On
strategy:
max-parallel: 4
matrix:
os: [ ubuntu-latest, windows-latest, macos-13 ]
runs-on: ${{ matrix.os }}
steps:
- name: Clone code from repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Cache m2 dependencies
uses: actions/cache@v4.0.2
with:
path: .m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install Firefox on MacOS
if: ${{ matrix.os == 'macos-13' }}
run: brew install --cask firefox
- name: Build with Maven for Ubuntu and macOS
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13' }}
run: mvn clean -e install -Dmaven.test.skip=true
- name: Build with Maven for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: mvn clean -e install '-Dmaven.test.skip=true'
- name: Set CI_RUN Environment Variable
run: echo "CI_RUN=true" >> $GITHUB_ENV
- name: Run Framework test
run: mvn test -Dtest=FrameworkTest
- name: Run tests with Maven on Windows with Firefox
if: ${{ matrix.os == 'windows-latest' }}
run: mvn test -Pfirefox '-Dsurefire.reportNameSuffix=firefox'
- name: Run tests with Maven on macOS with Firefox
if: ${{ matrix.os == 'macos-13' }}
run: mvn test -Pfirefox -Dsurefire.reportNameSuffix=firefox
- name: Run tests with Maven on Windows with Chrome
if: ${{ matrix.os == 'windows-latest' }}
run: mvn test -Pchrome '-Dsurefire.reportNameSuffix=chrome'
- name: Run tests with Maven on macOS with Chrome
if: ${{ matrix.os == 'macos-13' }}
run: mvn test -Pchrome -Dsurefire.reportNameSuffix=chrome
- name: Run 'Smoke' group tests on Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: mvn test -Psmoke
- name: Run 'Regression' group tests on Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: mvn test -Pregression
- name: Run cross-browser testing on Ubuntu with Chrome and Firefox
if: ${{ matrix.os == 'ubuntu-latest' }}
run: mvn test -PcrossBrowser
- name: Run File loading test
if: ${{ matrix.os == 'ubuntu-latest' }}
run: mvn test -Dtest=FileLoadingTest
- name: Test Reporter
uses: dorny/test-reporter@v1.9.1
if: success() || failure()
with:
name: Opencart project test report for ${{ matrix.os }}
path: target/surefire-reports/TEST-*.xml
reporter: java-junit
- name: Load Allure test report history
uses: actions/checkout@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Build Allure test report
uses: simple-elf/allure-report-action@v1.7
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
gh_pages: gh-pages
allure_history: allure-history
allure_results: target/allure-results
- name: Publish Allure test report
uses: peaceiris/actions-gh-pages@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
- name: Attach screenshots
uses: actions/upload-artifact@v4
if: always()
with:
path: screenshots
check-java-code-style:
name: Check Java code style
runs-on: ubuntu-latest
steps:
- name: Clone code from repo
uses: actions/checkout@v4
with:
fetch-depth: 0