Skip to content

Commit

Permalink
BC-5468 update cypress config file
Browse files Browse the repository at this point in the history
  • Loading branch information
UzaeirKhan committed Nov 13, 2023
1 parent 8fd3fa6 commit 133f768
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,25 @@ const webpack = require('@cypress/webpack-preprocessor')
const preprocessor = require('@badeball/cypress-cucumber-preprocessor')

async function setupNodeEvents (on, config) {
let environmentFilename
const isCI = config.env.environmentName === 'ci'
if (isCI) {
const environmentFilename = `./env_variables/combined_credentials.env.json`
console.log('loading %s', environmentFilename)
const settings = require(environmentFilename)
environmentFilename = `./env_variables/combined_credentials.env.json`
} else {
const environmentName = config.env.environmentName || 'local'
environmentFilename = `./env_variables/${environmentName}.env.json`
}
console.log('loading %s', environmentFilename)
const settings = require(environmentFilename)

if (settings.env) {
config.env = {
...config.env,
...settings.env
}
} else {
const environmentName = config.env.environmentName || 'local'
const environmentFilename = `./env_variables/${environmentName}.env.json`
console.log('loading %s', environmentFilename)
const settings = require(environmentFilename)

if (settings.env) {
config.env = {
...config.env,
...settings.env
}
}

console.log('loaded settings for environment %s', environmentName)
}
console.log(settings.env)
console.log('loaded settings for environment %s', environmentName)

// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await preprocessor.addCucumberPreprocessorPlugin(on, config)
Expand Down

0 comments on commit 133f768

Please sign in to comment.