-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.75 KB
/
test-e2e.yml
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
name: Run Test E2E
on:
# push:
# branches:
# - release
pull_request:
branches:
- master
jobs:
test-e2e:
runs-on: ubuntu-latest
steps:
# action clones the repository into this environment,
# making your code available for the workflow steps that follow.
- name: Checkout Repository Test E2E
uses: actions/checkout@v4
with:
repository: NitichaiSawangsai/cypress-ex1 # เปลี่ยนเป็น repository
ref: master # ตรวจสอบจาก branch
token: ${{ github.token }} # ใช้ Personal Access Token ที่มีสิทธิ์ในการอ่าน Repository
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
# https://github.com/cypress-io/github-action
- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: chrome
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
# after the test run completes
# store videos and any screenshots
# NOTE: screenshots will be generated only if E2E test failed
# thus we store screenshots only on failures
# Alternative: create and commit an empty cypress/screenshots folder
# to always have something to upload
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos
path: cypress/videos