diff --git a/.github/workflows/tests-nightly.yml b/.github/workflows/tests-nightly.yml index 81910d1e1..757f5e6a5 100644 --- a/.github/workflows/tests-nightly.yml +++ b/.github/workflows/tests-nightly.yml @@ -3,6 +3,14 @@ name: Execute nightly tests on: workflow_dispatch: inputs: + tests: + required: true + description: 'Select tests to run' + default: 'All' + type: choice + options: + - 'All' + - 'Critical' environment: required: true description: 'Environment to run tests against' @@ -96,6 +104,7 @@ jobs: node-version: 14 - name: Cypress run + if: ${{ github.event.inputs.tests == 'All' }} uses: cypress-io/github-action@v2 env: API_URI: ${{ steps.get-env-uri.outputs.ENV_URI }}graphql/ @@ -112,5 +121,23 @@ jobs: group: 'UI - Chrome' command: npm run cy:run:allEnv:parallel + - name: Cypress run + if: ${{ github.event.inputs.tests == 'Critical' }} + uses: cypress-io/github-action@v2 + env: + API_URI: ${{ steps.get-env-uri.outputs.ENV_URI }}graphql/ + APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }} + CYPRESS_baseUrl: ${{ steps.get-env-uri.outputs.ENV_URI }}dashboard/ + CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} + CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }} + CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} + CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + parallel: true + group: 'UI - Chrome' + command: npm run cy:run:critical:parallel + diff --git a/package.json b/package.json index 504dd3638..4acfb91bb 100644 --- a/package.json +++ b/package.json @@ -273,6 +273,7 @@ "cy:run:refactored:locally": "cypress run --env tags=refactored --spec 'cypress/integration/navigation.js','cypress/integration/products/createProduct.js', 'cypress/integration/products/productsVariants.js', --reporter cypress-mochawesome-reporter --reporter-options reportDir='cypress/reports',overwrite=true,charts=true", "cy:run:critical": "cypress run --record --env tags=critical --spec 'cypress/integration/navigation.js','cypress/integration/products/createProduct.js', 'cypress/integration/products/productsVariants.js'", "cy:run:allEnv": "cypress run --record --env tags=all", + "cy:run:critical:parallel": "cypress run --record --env tags=critical --spec 'cypress/integration/navigation.js','cypress/integration/products/createProduct.js', 'cypress/integration/products/productsVariants.js' --parallel", "cy:run:allEnv:parallel": "cypress run --record --env tags=all --parallel", "test:e2e:run": "start-server-and-test start http://localhost:9000 cy:run", "test:e2e:run:record": "start-server-and-test start http://localhost:9000 cy:run:record",