-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (81 loc) · 2.75 KB
/
playwright.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
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
name: Playwright Tests
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
push:
branches:
- main # Trigger on pushes to the main branch
workflow_dispatch: # Allow manual triggering of the workflow
inputs:
environment:
description: 'Select environment'
required: true
type: choice
default: 'obdev5'
options:
- obdev3
- obdev5
- stg
pull_request:
branches:
- main # Trigger when a pull request targets the main branch
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pages: write
environment: ${{ inputs.environment }} # Assign environment dynamically
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '14'
- name: Install dependencies
run: npm install
- name: Install Playwright browsers
run: npx playwright install
- name: Run Playwright tests
env:
APP_BASE_URL: ${{ secrets.APP_BASE_URL }}
CI: true
USER_MAIN_USERNAME: ${{ secrets.USER_MAIN_USERNAME }}
USER_MAIN_PASSWORD: ${{ secrets.USER_MAIN_PASSWORD }}
USER_ALT_USERNAME: ${{ secrets.USER_ALT_USERNAME }}
USER_ALT_PASSWORD: ${{ secrets.USER_ALT_PASSWORD }}
USER_MANAGER_USERNAME: ${{ secrets.USER_MANAGER_USERNAME }}
USER_MANAGER_PASSWORD: ${{ secrets.USER_MANAGER_PASSWORD }}
LOCATION_MAIN: ${{ secrets.LOCATION_MAIN }}
LOCATION_NO_MANAGE_INVENOTRY_DEPOT: ${{ secrets.LOCATION_NO_MANAGE_INVENOTRY_DEPOT }}
LOCATION_SUPPLIER: ${{ secrets.LOCATION_SUPPLIER }}
LOCATION_SUPPLIER_ALT: ${{ secrets.LOCATION_SUPPLIER_ALT }}
LOCATION_DEPOT: ${{ secrets.LOCATION_DEPOT }}
LOCATION_WARD: ${{ secrets.LOCATION_WARD }}
LOCATION_NO_PICK_AND_PUTAWAY_STOCK_DEPOT: ${{ secrets.LOCATION_NO_PICK_AND_PUTAWAY_STOCK_DEPOT }}
PRODUCT_ONE: ${{ secrets.PRODUCT_ONE }}
PRODUCT_TWO: ${{ secrets.PRODUCT_TWO }}
run: |
echo "Running playwright tests on the ${{ inputs.environment || 'obdev5' }} server"
npx playwright test
- name: Upload Playwright Report to Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report/
- name: Save Pages
if: ${{ always() }}
uses: actions/configure-pages@v2
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-pages-artifact@v1
with:
path: playwright-report/
- name: Deploy to Github Pages
if: ${{ always() }}
id: deployment
uses: actions/deploy-pages@v1