diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11135861..4a730b22 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,6 +113,13 @@ jobs: echo "$json_output" > ${{ github.workspace }}/e2e-system-tests/env_variables/combined_credentials.env.json + - name: JSON to variables + uses: rgarcia-phi/json-to-variables@v1.1.0 + with: + filename: ${{ github.workspace }}/e2e-system-tests/env_variables/combined_credentials.env.json + prefix: variables + masked: true + - name: Clean up previous report uses: cypress-io/github-action@v5 with: @@ -125,6 +132,10 @@ jobs: working-directory: e2e-system-tests command: npm run ${{ steps.read_variables.outputs.tag }} browser: chrome + env: + CYPRESS_BRB: ${{env.variables_CYPRESS_BRB}} + CYPRESS_DEFAULT: ${{env.variables_CYPRESS_DEFAULT}} + CYPRESS_NBC: ${{env.variables_CYPRESS_NBC}} - name: Generate Report if: always() diff --git a/cypress.config.js b/cypress.config.js index d42be49a..97ce5c13 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -5,17 +5,9 @@ const preprocessor = require('@badeball/cypress-cucumber-preprocessor') async function setupNodeEvents (on, config) { const isCI = config.env.environmentName === 'ci' if (isCI) { - const environmentFilename = `./env_variables/combined_credentials.env.json` - console.log('loading CI env variables %s', environmentFilename) - const settings = require(environmentFilename) - - if (settings.env) { - config.env = { - ...config.env, - ...settings.env - } + config.env = { + ...config.env } - console.log('loaded CI env variables %s', environmentFilename) } else { const environmentName = config.env.environmentName || 'local' const environmentFilename = `./env_variables/${environmentName}.env.json` diff --git a/cypress/support/custom_commands/login.js b/cypress/support/custom_commands/login.js index 31c09705..3fab6d79 100644 --- a/cypress/support/custom_commands/login.js +++ b/cypress/support/custom_commands/login.js @@ -16,7 +16,6 @@ const titleOnDashboardPage = '[id="page-title"]' Cypress.Commands.add('login', (username, environment) => { cy.session([username, environment], () => { const env = Cypress.env() - console.log(env) const environmentUpperCased = environment.toUpperCase() const link = Cypress.config('baseUrl', env[environmentUpperCased]) cy.log(link)