run demo test (#3484)
* run demo test * Improve ifs * add type chioce, remove leftovers * add test case with upper case
This commit is contained in:
parent
d5d96b79cb
commit
7a3d311aaf
1 changed files with 34 additions and 3 deletions
35
.github/workflows/percy-demo-tests.yml
vendored
35
.github/workflows/percy-demo-tests.yml
vendored
|
@ -11,6 +11,15 @@ on:
|
||||||
required: true
|
required: true
|
||||||
description: 'Environment api to run tests against'
|
description: 'Environment api to run tests against'
|
||||||
default: 'https://staging-demo.saleor.io/graphql/'
|
default: 'https://staging-demo.saleor.io/graphql/'
|
||||||
|
testsKind:
|
||||||
|
required: true
|
||||||
|
description: 'What kind of tests'
|
||||||
|
type: choice
|
||||||
|
default: "all"
|
||||||
|
options:
|
||||||
|
- "percy"
|
||||||
|
- "functional"
|
||||||
|
- "all"
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '00 2 * * 1-5'
|
- cron: '00 2 * * 1-5'
|
||||||
|
@ -19,11 +28,14 @@ on:
|
||||||
types: [demo-tests]
|
types: [demo-tests]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cypress-run-test-percy:
|
cypress-run-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TEST_KIND: ${{ github.event.inputs.testsKind || github.event.client_payload.testsKind }}
|
||||||
container: cypress/browsers:node18.12.0-chrome106-ff106
|
container: cypress/browsers:node18.12.0-chrome106-ff106
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Get environments urls
|
- name: Get environments urls
|
||||||
id: get-env-urls
|
id: get-env-urls
|
||||||
env:
|
env:
|
||||||
|
@ -34,7 +46,7 @@ jobs:
|
||||||
echo "API_URL=${{ github.event.inputs.apiUrl || env.DEFAULT_API_URL }}" >> $GITHUB_OUTPUT
|
echo "API_URL=${{ github.event.inputs.apiUrl || env.DEFAULT_API_URL }}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Cache node modules
|
- name: Cache node modules
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
|
@ -52,6 +64,8 @@ jobs:
|
||||||
run: NODE_OPTIONS=--max_old_space_size=4096 npm install
|
run: NODE_OPTIONS=--max_old_space_size=4096 npm install
|
||||||
|
|
||||||
- name: Cypress run test percy
|
- name: Cypress run test percy
|
||||||
|
if: contains(fromJSON('["percy", "all"]'), env.TEST_KIND)
|
||||||
|
continue-on-error: true
|
||||||
uses: cypress-io/github-action@v4
|
uses: cypress-io/github-action@v4
|
||||||
env:
|
env:
|
||||||
API_URI: ${{ steps.get-env-urls.outputs.API_URL }}
|
API_URI: ${{ steps.get-env-urls.outputs.API_URL }}
|
||||||
|
@ -66,3 +80,20 @@ jobs:
|
||||||
with:
|
with:
|
||||||
group: "UI - Chrome"
|
group: "UI - Chrome"
|
||||||
command: npx percy exec -- npx cypress run --record
|
command: npx percy exec -- npx cypress run --record
|
||||||
|
|
||||||
|
- name: Cypress run test functional
|
||||||
|
if: contains(fromJSON('["functional", "all"]'), env.TEST_KIND)
|
||||||
|
continue-on-error: true
|
||||||
|
uses: cypress-io/github-action@v4
|
||||||
|
env:
|
||||||
|
API_URI: ${{ steps.get-env-urls.outputs.API_URL }}
|
||||||
|
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
|
||||||
|
CYPRESS_DEMO_URI: ${{ steps.get-env-urls.outputs.DASHBOARD_URL }}
|
||||||
|
CYPRESS_USER_NAME: admin@example.com
|
||||||
|
CYPRESS_USER_PASSWORD: admin
|
||||||
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||||
|
COMMIT_INFO_MESSAGE: Demo dashboard tests - ${{github.event.inputs.dashboardUrl}} - ${{ steps.get-env-urls.outputs.DASHBOARD_URL }}
|
||||||
|
CYPRESS_grepTags: "@demo-dashboard"
|
||||||
|
with:
|
||||||
|
group: 'UI - Chrome'
|
||||||
|
record: true
|
||||||
|
|
Loading…
Reference in a new issue