Skip to content

Commit

Permalink
BC-5468 tried some solution
Browse files Browse the repository at this point in the history
  • Loading branch information
UzaeirKhan committed Nov 13, 2023
1 parent 5426f1a commit 2c06691
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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:
Expand All @@ -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()
Expand Down
12 changes: 2 additions & 10 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 0 additions & 1 deletion cypress/support/custom_commands/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2c06691

Please sign in to comment.