Automatically run automation test (#2110)
* add workflow for automatically run tests * add event name * add repository dispatch event to nightly tests * fix not equal * fix run on correct domain * Run only on sandboxes and demo
This commit is contained in:
parent
349133d922
commit
6098bd293f
1 changed files with 40 additions and 4 deletions
44
.github/workflows/tests-nightly.yml
vendored
44
.github/workflows/tests-nightly.yml
vendored
|
@ -37,7 +37,7 @@ on:
|
|||
jobs:
|
||||
|
||||
revert-automation-env-to-snap:
|
||||
if: github.event.inputs.environment == null
|
||||
if: ${{ github.event.inputs.environment == null && github.event_name != 'repository_dispatch' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
|
@ -156,13 +156,49 @@ jobs:
|
|||
group: 'UI - Chrome'
|
||||
command: npx cypress run --record --env tags=critical --spec cypress/e2e/navigation.js,cypress/e2e/products/createProduct.js,cypress/e2e/products/productsVariants.js --parallel --tag ${{ steps.get-env-uri.outputs.ENV_URI }}, Critical
|
||||
|
||||
run-tests-on-release:
|
||||
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.project != 'PROD' && github.event.client_payload.project != 'ENTERPRISE'}}
|
||||
runs-on: ubuntu-latest
|
||||
container: cypress/browsers:node14.16.0-chrome89-ff86
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# run copies of the current job in parallel
|
||||
containers: [1, 2, 3, 4]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get formatted version
|
||||
id: version
|
||||
env:
|
||||
version: ${{github.event.client_payload.version}}
|
||||
pattern: \\.
|
||||
run: |
|
||||
echo "::set-output name=version::$(echo $version | sed s/$pattern// | head -n 1 )"
|
||||
|
||||
- name: Get formatted version - demo
|
||||
if: ${{ github.event.client_payload.project == 'DEMO' }}
|
||||
id: version-demo
|
||||
env:
|
||||
version: ${{github.event.client_payload.version}}
|
||||
pattern: demo-
|
||||
run: |
|
||||
echo "::set-output name=version::$(echo $version | sed s/$pattern// | head -n 1 )"
|
||||
|
||||
- name: Get domain
|
||||
id: domain
|
||||
env:
|
||||
correct-version: ${{ steps.version-demo.outputs.version-demo || steps.version.outputs.version }}
|
||||
run: |
|
||||
echo "::set-output name=version::$(echo https://v${{ steps.version-demo.outputs.version-demo }}.staging.saleor.cloud/ | head -n 1 )"
|
||||
|
||||
- name: Cypress run - automatically
|
||||
if: ${{ github.event_name == 'repository_dispatch'}}
|
||||
uses: cypress-io/github-action@v4
|
||||
env:
|
||||
API_URI: ${{ github.event.client_payload.environment }}graphql/
|
||||
API_URI: ${{ steps.domain.outputs.domain }}graphql/
|
||||
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
|
||||
CYPRESS_baseUrl: ${{ github.event.client_payload.environment }}dashboard/
|
||||
CYPRESS_baseUrl: ${{ steps.domain.outputs.domain }}dashboard/
|
||||
CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
|
||||
CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }}
|
||||
CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }}
|
||||
|
|
Loading…
Reference in a new issue