/
action.yml
62 lines (56 loc) · 1.59 KB
/
action.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
name: Setup and Run UI tests
description: Setup a UI Tests Environment and run tests
inputs:
# TEST Config inputs
TESTS_DIR:
required: false
description: Tests Folder on PrestaShop
default: './tests/UI/'
ENABLE_SSL:
required: false
description: True to Run with SSL
default: 'true'
TEST_CAMPAIGN:
required: true
description: Campaign To Run
NODE_VERSION:
required: false
description: Node Version for tests
default: '16'
BROWSER:
required: false
description: Bowser for tests
default: 'chromium'
INSTALL_BROWSERS:
required: false
description: True To Install Browsers
default: 'true'
runs:
using: 'composite'
steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.NODE_VERSION }}
- name: Use .env.ci
working-directory: ${{ inputs.TESTS_DIR }}
shell: bash
run: cp .env.ci .env
- name: Install dependencies
working-directory: ${{ inputs.TESTS_DIR }}
shell: bash
run: npm ci
- name: Install browsers
if: inputs.INSTALL_BROWSERS == 'true'
working-directory: ${{ inputs.TESTS_DIR }}
shell: bash
run: npx playwright install ${{ inputs.BROWSER }} --with-deps
# Run tests
- name: Run tests
working-directory: ${{ inputs.TESTS_DIR }}
env:
BROWSER: ${{ inputs.BROWSER }}
ENABLE_SSL: ${{ inputs.ENABLE_SSL }}
URL_FO: ${{ (inputs.ENABLE_SSL == 'false') && 'http://localhost:8001/' || 'https://localhost:8002/' }}
shell: bash
run: npm run test:${{ inputs.TEST_CAMPAIGN }}