diff --git a/bin/commands/runs.js b/bin/commands/runs.js index 613a92e4..8e849c4e 100644 --- a/bin/commands/runs.js +++ b/bin/commands/runs.js @@ -26,6 +26,9 @@ module.exports = function run(args) { // accept the build name from command line if provided utils.setBuildName(bsConfig, args); + // set cypress config filename + utils.setCypressConfigFilename(bsConfig, args); + // accept the specs list from command line if provided utils.setUserSpecs(bsConfig, args); diff --git a/bin/helpers/archiver.js b/bin/helpers/archiver.js index d4b5ab44..4ffcccd1 100644 --- a/bin/helpers/archiver.js +++ b/bin/helpers/archiver.js @@ -4,13 +4,14 @@ const fs = require("fs"); const archiver = require("archiver"), Constants = require('../helpers/constants'), logger = require("./logger").winstonLogger, - utils = require('../helpers/utils'); + utils = require('../helpers/utils'), + path = require('path'); const archiveSpecs = (runSettings, filePath, excludeFiles) => { return new Promise(function (resolve, reject) { var output = fs.createWriteStream(filePath); - var cypressFolderPath = runSettings.cypress_proj_dir; + var cypressFolderPath = path.dirname(runSettings.cypressConfigFilePath); var archive = archiver('zip', { zlib: { level: 9 } // Sets the compression level. @@ -59,6 +60,13 @@ const archiveSpecs = (runSettings, filePath, excludeFiles) => { archive.append(packageJSONString, { name: 'browserstack-package.json' }); } + // do not add cypress.json if arg provided is false + if (runSettings.cypress_config_file && runSettings.cypress_config_filename !== 'false') { + let cypressJSON = JSON.parse(fs.readFileSync(runSettings.cypressConfigFilePath)); + let cypressJSONString = JSON.stringify(cypressJSON, null, 4); + archive.append(cypressJSONString, { name: 'cypress.json' }); + } + archive.finalize(); }); } diff --git a/bin/helpers/capabilityHelper.js b/bin/helpers/capabilityHelper.js index 04fea139..bb7a3268 100644 --- a/bin/helpers/capabilityHelper.js +++ b/bin/helpers/capabilityHelper.js @@ -68,6 +68,10 @@ const caps = (bsConfig, zip) => { obj.projectNotifyURL = bsConfig.run_settings.project_notify_URL; obj.parallels = bsConfig.run_settings.parallels; + if (!Utils.isUndefined(bsConfig.run_settings.cypress_config_filename)) { + obj.cypress_config_filename = bsConfig.run_settings.cypress_config_filename; + } + if (!Utils.isUndefined(bsConfig.run_settings.specs)){ obj.specs = bsConfig.run_settings.specs; } @@ -78,7 +82,7 @@ const caps = (bsConfig, zip) => { } if(obj.parallels === Constants.cliMessages.RUN.DEFAULT_PARALLEL_MESSAGE) obj.parallels = undefined - + if (obj.project) logger.log(`Project name is: ${obj.project}`); if (obj.customBuildName) logger.log(`Build name is: ${obj.customBuildName}`); @@ -106,7 +110,9 @@ const validate = (bsConfig, args) => { if (!bsConfig.run_settings) reject(Constants.validationMessages.EMPTY_RUN_SETTINGS); - if (!bsConfig.run_settings.cypress_proj_dir) reject(Constants.validationMessages.EMPTY_CYPRESS_PROJ_DIR); + if (!bsConfig.run_settings.cypress_proj_dir && !bsConfig.run_settings.userProvidedCypessConfigFile) { + reject(Constants.validationMessages.EMPTY_CYPRESS_PROJ_DIR); + } // validate parallels specified in browserstack.json if parallels are not specified via arguments if (!Utils.isUndefined(args) && Utils.isUndefined(args.parallels) && !Utils.isParallelValid(bsConfig.run_settings.parallels)) reject(Constants.validationMessages.INVALID_PARALLELS_CONFIGURATION); @@ -114,18 +120,24 @@ const validate = (bsConfig, args) => { // if parallels specified via arguments validate only arguments if (!Utils.isUndefined(args) && !Utils.isUndefined(args.parallels) && !Utils.isParallelValid(args.parallels)) reject(Constants.validationMessages.INVALID_PARALLELS_CONFIGURATION); - if (!fs.existsSync(path.join(bsConfig.run_settings.cypress_proj_dir, 'cypress.json'))) reject(Constants.validationMessages.CYPRESS_JSON_NOT_FOUND + bsConfig.run_settings.cypress_proj_dir); + // validate if config file provided exists or not when cypress_config_file provided + // validate the cypressProjectDir key otherwise. + let cypressConfigFilePath = bsConfig.run_settings.cypressConfigFilePath; + + if (!fs.existsSync(cypressConfigFilePath) && bsConfig.run_settings.cypress_config_filename !== 'false') reject(Constants.validationMessages.INVALID_CYPRESS_CONFIG_FILE); try { - let cypressJson = fs.readFileSync(path.join(bsConfig.run_settings.cypress_proj_dir, 'cypress.json')); - cypressJson = JSON.parse(cypressJson); - // Cypress Json Base Url & Local true check - if (!Utils.isUndefined(cypressJson.baseUrl) && cypressJson.baseUrl.includes("localhost") && !Utils.getLocalFlag(bsConfig.connection_settings)) reject(Constants.validationMessages.LOCAL_NOT_SET); - - // Detect if the user is not using the right directory structure, and throw an error - if (!Utils.isUndefined(cypressJson.integrationFolder) && !Utils.isCypressProjDirValid(bsConfig.run_settings.cypress_proj_dir,cypressJson.integrationFolder)) reject(Constants.validationMessages.INCORRECT_DIRECTORY_STRUCTURE); - - } catch (error) { + if (bsConfig.run_settings.cypress_config_filename !== 'false') { + let cypressJsonContent = fs.readFileSync(cypressConfigFilePath); + cypressJson = JSON.parse(cypressJsonContent); + + // Cypress Json Base Url & Local true check + if (!Utils.isUndefined(cypressJson.baseUrl) && cypressJson.baseUrl.includes("localhost") && !Utils.getLocalFlag(bsConfig.connection_settings)) reject(Constants.validationMessages.LOCAL_NOT_SET); + + // Detect if the user is not using the right directory structure, and throw an error + if (!Utils.isUndefined(cypressJson.integrationFolder) && !Utils.isCypressProjDirValid(bsConfig.run_settings.cypressProjectDir,cypressJson.integrationFolder)) reject(Constants.validationMessages.INCORRECT_DIRECTORY_STRUCTURE); + } + } catch(error){ reject(Constants.validationMessages.INVALID_CYPRESS_JSON) } diff --git a/bin/helpers/constants.js b/bin/helpers/constants.js index 890c6fa1..0f89948a 100644 --- a/bin/helpers/constants.js +++ b/bin/helpers/constants.js @@ -30,6 +30,7 @@ const validationMessages = { NOT_VALID_JSON: "browerstack.json is not a valid json", INVALID_EXTENSION: "Invalid files, please remove these files and try again.", INVALID_PARALLELS_CONFIGURATION: "Invalid value specified for parallels to use. Maximum parallels to use should be a number greater than 0.", + INVALID_CYPRESS_CONFIG_FILE: "Invalid cypress_config_file", CYPRESS_JSON_NOT_FOUND: "cypress.json file is not found at cypress_proj_dir path ", INVALID_CYPRESS_JSON: "cypress.json is not a valid json", INVALID_DEFAULT_AUTH_PARAMS: "Your username and access key are required to run your tests on BrowserStack. Learn more at https://www.browserstack.com/docs/automate/cypress/authentication", @@ -60,7 +61,9 @@ const cliMessages = { PARALLEL_DESC: "The maximum number of parallels to use to run your test suite", INFO: "Run your tests on BrowserStack.", DESC: "Path to BrowserStack config", + CYPRESS_DESC: "Path to Cypress config file", CONFIG_DEMAND: "config file is required", + CYPRESS_CONFIG_DEMAND: "Cypress config file is required", BUILD_NAME: "The build name you want to use to name your test runs", EXCLUDE: "Exclude files matching a pattern from zipping and uploading", DEFAULT_PARALLEL_MESSAGE: "Here goes the number of parallels you want to run", @@ -86,7 +89,7 @@ const messageTypes = { const allowedFileTypes = ['js', 'json', 'txt', 'ts', 'feature', 'features', 'pdf', 'jpg', 'jpeg', 'png', 'zip']; -const filesToIgnoreWhileUploading = ['node_modules/**', 'package-lock.json', 'package.json', 'browserstack-package.json', 'tests.zip'] +const filesToIgnoreWhileUploading = ['node_modules/**', 'package-lock.json', 'package.json', 'browserstack-package.json', 'tests.zip', 'cypress.json'] module.exports = Object.freeze({ userMessages, diff --git a/bin/helpers/usageReporting.js b/bin/helpers/usageReporting.js index 9f2a8088..ebc703c5 100644 --- a/bin/helpers/usageReporting.js +++ b/bin/helpers/usageReporting.js @@ -127,7 +127,7 @@ function ci_environment() { } // CircleCI if (env.CI === "true" && env.CIRCLECI === "true") { - return "CircleCI"; + return "CircleCI"; } // Travis CI if (env.CI === "true" && env.TRAVIS === "true") { diff --git a/bin/helpers/utils.js b/bin/helpers/utils.js index 9b4a7c3a..1d82b4d3 100644 --- a/bin/helpers/utils.js +++ b/bin/helpers/utils.js @@ -55,6 +55,9 @@ exports.getErrorCodeFromMsg = (errMsg) => { case Constants.validationMessages.INCORRECT_DIRECTORY_STRUCTURE: errorCode = "invalid_directory_structure"; break; + case Constants.validationMessages.INVALID_CYPRESS_CONFIG_FILE: + errorCode = "invalid_cypress_config_file"; + break; } if ( errMsg.includes("Please use --config-file .") @@ -140,6 +143,43 @@ exports.setBuildName = (bsConfig, args) => { } }; +exports.searchForOption = (option) => { + return (process.argv.indexOf(option) > -1); +} + +exports.verifyCypressConfigFileOption = () => { + let ccfOptionsSet = (this.searchForOption('-ccf') || this.searchForOption('--ccf')); + let cypressConfigFileSet = (this.searchForOption('-cypress-config-file') || this.searchForOption('--cypress-config-file')); + let cypressConfigOptionsSet = (this.searchForOption('-cypressConfigFile') || this.searchForOption('--cypressConfigFile')); + return (ccfOptionsSet || cypressConfigFileSet || cypressConfigOptionsSet); +} + +// TODO: Remove when cleaningup cypress_proj_dir +// +// 1. Remove demand from runner.js for --ccf option. +// 2. Remove the strict check functions: verifyCypressConfigFileOption +// 3. Just use the args.cypressConfigFile for checking the value for cypress config file. +exports.setCypressConfigFilename = (bsConfig, args) => { + let userProvidedCypessConfigFile = this.verifyCypressConfigFileOption(); + + bsConfig.run_settings.userProvidedCypessConfigFile = (userProvidedCypessConfigFile || (!this.isUndefined(bsConfig.run_settings.cypress_config_file))); + + if (userProvidedCypessConfigFile || this.isUndefined(bsConfig.run_settings.cypress_config_file)) { + bsConfig.run_settings.cypress_config_file = args.cypressConfigFile; + bsConfig.run_settings.cypress_config_filename = path.basename(args.cypressConfigFile); + } else if (!this.isUndefined(bsConfig.run_settings.cypress_config_file)) { + bsConfig.run_settings.cypress_config_filename = path.basename(bsConfig.run_settings.cypress_config_file); + } + + if (bsConfig.run_settings.userProvidedCypessConfigFile){ + bsConfig.run_settings.cypressConfigFilePath = bsConfig.run_settings.cypress_config_file; + bsConfig.run_settings.cypressProjectDir = path.dirname(bsConfig.run_settings.cypress_config_file); + } else { + bsConfig.run_settings.cypressConfigFilePath = path.join(bsConfig.run_settings.cypress_proj_dir, 'cypress.json'); + bsConfig.run_settings.cypressProjectDir = bsConfig.run_settings.cypress_proj_dir; + } +} + // specs can be passed from bstack configuration file // specs can be passed via command line args as a string // command line args takes precedence over config diff --git a/bin/runner.js b/bin/runner.js index f97bc7d9..597eb558 100755 --- a/bin/runner.js +++ b/bin/runner.js @@ -136,6 +136,15 @@ var argv = yargs demand: true, demand: Constants.cliMessages.RUN.CONFIG_DEMAND }, + 'ccf': { + alias: 'cypress-config-file', + describe: Constants.cliMessages.RUN.CYPRESS_DESC, + default: './cypress.json', + type: 'string', + nargs: 1, + demand: true, + demand: Constants.cliMessages.RUN.CYPRESS_CONFIG_DEMAND + }, 'disable-usage-reporting': { default: undefined, description: Constants.cliMessages.COMMON.DISABLE_USAGE_REPORTING, diff --git a/bin/templates/configTemplate.js b/bin/templates/configTemplate.js index 7b3556be..883a46b0 100644 --- a/bin/templates/configTemplate.js +++ b/bin/templates/configTemplate.js @@ -52,7 +52,7 @@ module.exports = function () { } ], "run_settings": { - "cypress_proj_dir" : "/path/to/directory-that-contains--file", + "cypress_config_file" : "/path/to/.json", "project_name": "project-name", "build_name": "build-name", "exclude": [], diff --git a/test/unit/bin/commands/runs.js b/test/unit/bin/commands/runs.js index 227a80fe..dd45e9c4 100644 --- a/test/unit/bin/commands/runs.js +++ b/test/unit/bin/commands/runs.js @@ -85,6 +85,7 @@ describe("runs", () => { setUsernameStub = sandbox.stub(); setAccessKeyStub = sandbox.stub(); setBuildNameStub = sandbox.stub(); + setCypressConfigFilenameStub = sandbox.stub(); setUserSpecsStub = sandbox.stub(); setTestEnvsStub = sandbox.stub(); getConfigPathStub = sandbox.stub(); @@ -118,6 +119,7 @@ describe("runs", () => { setUsername: setUsernameStub, setAccessKey: setAccessKeyStub, setBuildName: setBuildNameStub, + setCypressConfigFilename: setCypressConfigFilenameStub, setUserSpecs: setUserSpecsStub, setTestEnvs: setTestEnvsStub, getConfigPath: getConfigPathStub, @@ -169,6 +171,7 @@ describe("runs", () => { setAccessKeyStub = sandbox.stub(); getConfigPathStub = sandbox.stub(); setBuildNameStub = sandbox.stub(); + setCypressConfigFilenameStub = sandbox.stub(); setUserSpecsStub = sandbox.stub(); setTestEnvsStub = sandbox.stub(); validateBstackJsonStub = sandbox.stub(); @@ -202,6 +205,7 @@ describe("runs", () => { setUsername: setUsernameStub, setAccessKey: setAccessKeyStub, setBuildName: setBuildNameStub, + setCypressConfigFilename: setCypressConfigFilenameStub, setUserSpecs: setUserSpecsStub, setTestEnvs: setTestEnvsStub, setUsageReportingFlag: setUsageReportingFlagStub, @@ -263,6 +267,7 @@ describe("runs", () => { setUsernameStub = sandbox.stub(); setAccessKeyStub = sandbox.stub(); setBuildNameStub = sandbox.stub(); + setCypressConfigFilenameStub = sandbox.stub(); setUserSpecsStub = sandbox.stub(); setTestEnvsStub = sandbox.stub(); getConfigPathStub = sandbox.stub(); @@ -297,6 +302,7 @@ describe("runs", () => { setUsername: setUsernameStub, setAccessKey: setAccessKeyStub, setBuildName: setBuildNameStub, + setCypressConfigFilename: setCypressConfigFilenameStub, setUserSpecs: setUserSpecsStub, setTestEnvs: setTestEnvsStub, setUsageReportingFlag: setUsageReportingFlagStub, @@ -365,6 +371,7 @@ describe("runs", () => { setUsernameStub = sandbox.stub(); setAccessKeyStub = sandbox.stub(); setBuildNameStub = sandbox.stub(); + setCypressConfigFilenameStub = sandbox.stub(); setUserSpecsStub = sandbox.stub(); setTestEnvsStub = sandbox.stub(); getConfigPathStub = sandbox.stub(); @@ -400,6 +407,7 @@ describe("runs", () => { setUsername: setUsernameStub, setAccessKey: setAccessKeyStub, setBuildName: setBuildNameStub, + setCypressConfigFilename: setCypressConfigFilenameStub, setUserSpecs: setUserSpecsStub, setTestEnvs: setTestEnvsStub, setUsageReportingFlag: setUsageReportingFlagStub, @@ -479,6 +487,7 @@ describe("runs", () => { setUsernameStub = sandbox.stub(); setAccessKeyStub = sandbox.stub(); setBuildNameStub = sandbox.stub(); + setCypressConfigFilenameStub = sandbox.stub(); setUserSpecsStub = sandbox.stub(); setTestEnvsStub = sandbox.stub(); getConfigPathStub = sandbox.stub(); @@ -517,6 +526,7 @@ describe("runs", () => { setUsername: setUsernameStub, setAccessKey: setAccessKeyStub, setBuildName: setBuildNameStub, + setCypressConfigFilename: setCypressConfigFilenameStub, setUserSpecs: setUserSpecsStub, setTestEnvs: setTestEnvsStub, setUsageReportingFlag: setUsageReportingFlagStub, diff --git a/test/unit/bin/helpers/capabilityHelper.js b/test/unit/bin/helpers/capabilityHelper.js index 93675a3d..0d68d25e 100644 --- a/test/unit/bin/helpers/capabilityHelper.js +++ b/test/unit/bin/helpers/capabilityHelper.js @@ -399,7 +399,8 @@ describe("capabilityHelper.js", () => { }, ], run_settings: { - cypress_proj_dir: "random path" + cypress_proj_dir: "random path", + cypressConfigFilePath: "random path" }, }; }); @@ -781,7 +782,9 @@ describe("capabilityHelper.js", () => { }, ], run_settings: { - cypress_proj_dir: "random path" + cypress_proj_dir: "random path", + cypressConfigFilePath: "random path", + cypressProjectDir: "random path" }, }; }); @@ -797,7 +800,7 @@ describe("capabilityHelper.js", () => { .catch((error) => { chai.assert.equal( error, - Constants.validationMessages.CYPRESS_JSON_NOT_FOUND + "random path" + Constants.validationMessages.INVALID_CYPRESS_CONFIG_FILE ); fs.existsSync.restore(); }); @@ -858,10 +861,42 @@ describe("capabilityHelper.js", () => { error, Constants.validationMessages.INCORRECT_DIRECTORY_STRUCTURE ); + fs.existsSync.restore(); fs.readFileSync.restore(); }); }); + + context("cypress config file set to false", () => { + beforeEach(function() { + readFileSpy = sinon.stub(fs, 'readFileSync'); + jsonParseSpy = sinon.stub(JSON, 'parse'); + }); + + afterEach(function() { + readFileSpy.restore(); + jsonParseSpy.restore(); + }); + + it("does not validate with cypress config filename set to false", () => { + // sinon.stub(fs, 'existsSync').returns(false); + bsConfig.run_settings.cypressConfigFilePath = 'false'; + bsConfig.run_settings.cypress_config_filename = 'false'; + + return capabilityHelper + .validate(bsConfig, {}) + .then(function (data) { + sinon.assert.notCalled(readFileSpy); + sinon.assert.notCalled(jsonParseSpy); + }) + .catch((error) => { + chai.assert.equal( + error, + Constants.validationMessages.INCORRECT_DIRECTORY_STRUCTURE + ); + }); + }) + }); }); }); }); diff --git a/test/unit/bin/helpers/usageReporting.js b/test/unit/bin/helpers/usageReporting.js index 4701374c..b7712714 100644 --- a/test/unit/bin/helpers/usageReporting.js +++ b/test/unit/bin/helpers/usageReporting.js @@ -340,7 +340,7 @@ describe("usageReporting", () => { expect(isUsageReportingEnabled()).to.be.undefined; }); }); - + describe("ci_environment", () => { afterEach(() => { delete process.env.JENKINS_URL; diff --git a/test/unit/bin/helpers/utils.js b/test/unit/bin/helpers/utils.js index 96d696f4..4413aabd 100644 --- a/test/unit/bin/helpers/utils.js +++ b/test/unit/bin/helpers/utils.js @@ -687,4 +687,126 @@ describe("utils", () => { }); }); + + describe("verifyCypressConfigFileOption", () => { + let utilsearchForOptionCypressConfigFileStub, userOption, testOption; + + beforeEach(function() { + utilsearchForOptionCypressConfigFileStub = sinon + .stub(utils, 'searchForOption') + .callsFake((...userOption) => { + return (userOption == testOption); + }); + }); + + afterEach(function() { + utilsearchForOptionCypressConfigFileStub.restore(); + }); + + it("-ccf user option", () => { + testOption = '-ccf'; + expect(utils.verifyCypressConfigFileOption()).to.be.true; + sinon.assert.calledWithExactly(utilsearchForOptionCypressConfigFileStub, testOption); + }); + + it("--ccf user option", () => { + testOption = '--ccf'; + expect(utils.verifyCypressConfigFileOption()).to.be.true; + sinon.assert.calledWithExactly(utilsearchForOptionCypressConfigFileStub, testOption); + }); + + it("-cypress-config-file user option", () => { + testOption = '-cypress-config-file'; + expect(utils.verifyCypressConfigFileOption()).to.be.true; + sinon.assert.calledWithExactly(utilsearchForOptionCypressConfigFileStub, testOption); + }); + + it("--cypress-config-file user option", () => { + testOption = '--cypress-config-file'; + expect(utils.verifyCypressConfigFileOption()).to.be.true; + sinon.assert.calledWithExactly(utilsearchForOptionCypressConfigFileStub, testOption); + }); + + it("-cypressConfigFile user option", () => { + testOption = '-cypressConfigFile'; + expect(utils.verifyCypressConfigFileOption()).to.be.true; + sinon.assert.calledWithExactly(utilsearchForOptionCypressConfigFileStub, testOption); + }); + + it("--cypressConfigFile user option", () => { + testOption = '--cypressConfigFile'; + expect(utils.verifyCypressConfigFileOption()).to.be.true; + sinon.assert.calledWithExactly(utilsearchForOptionCypressConfigFileStub, testOption); + }); + }); + + describe("setCypressConfigFilename", () => { + let verifyCypressConfigFileOptionStub, + ccfBool, args, bsConfig, cypress_config_file; + + beforeEach(function() { + verifyCypressConfigFileOptionStub = sinon + .stub(utils, 'verifyCypressConfigFileOption') + .callsFake(() => ccfBool); + + args = { + cypressConfigFile: "args_cypress_config_file" + }; + }); + + it("has user provided ccf flag", () => { + ccfBool = true; + + bsConfig = { + run_settings: { + cypress_config_file: "run_settings_cypress_config_file" + } + }; + + utils.setCypressConfigFilename(bsConfig, args); + + expect(bsConfig.run_settings.cypress_config_file).to.be.eq(args.cypressConfigFile); + expect(bsConfig.run_settings.cypress_config_filename).to.be.eq(path.basename(args.cypressConfigFile)); + expect(bsConfig.run_settings.userProvidedCypessConfigFile).to.be.true; + expect(bsConfig.run_settings.cypressConfigFilePath).to.be.eq(bsConfig.run_settings.cypress_config_file); + }); + + it("does not have user provided ccf flag, sets the value from cypress_proj_dir", () => { + ccfBool = false; + + bsConfig = { + run_settings: { + cypress_proj_dir: "cypress_proj_dir" + } + }; + + utils.setCypressConfigFilename(bsConfig, args); + + expect(bsConfig.run_settings.cypress_config_file).to.be.eq(args.cypressConfigFile); + expect(bsConfig.run_settings.cypress_config_filename).to.be.eq(path.basename(args.cypressConfigFile)); + expect(bsConfig.run_settings.userProvidedCypessConfigFile).to.be.false; + expect(bsConfig.run_settings.cypressConfigFilePath).to.be.eq(path.join(bsConfig.run_settings.cypress_proj_dir, 'cypress.json')); + }); + + it("does not have user provided ccf flag, sets from config file", () => { + cypress_config_file = "run_settings_cypress_config_file"; + ccfBool = false; + bsConfig = { + run_settings: { + cypress_config_file: cypress_config_file + } + }; + + utils.setCypressConfigFilename(bsConfig, args); + + expect(bsConfig.run_settings.cypress_config_file).to.be.eq(cypress_config_file); + expect(bsConfig.run_settings.cypress_config_filename).to.be.eq(path.basename(cypress_config_file)); + expect(bsConfig.run_settings.userProvidedCypessConfigFile).to.be.true; + expect(bsConfig.run_settings.cypressConfigFilePath).to.be.eq(bsConfig.run_settings.cypress_config_file); + }); + + afterEach(function() { + verifyCypressConfigFileOptionStub.restore(); + }) + }); }); diff --git a/test/unit/support/fixtures/testObjects.js b/test/unit/support/fixtures/testObjects.js index da19943b..432fe96e 100644 --- a/test/unit/support/fixtures/testObjects.js +++ b/test/unit/support/fixtures/testObjects.js @@ -4,7 +4,9 @@ const sampleBsConfig = { access_key: "random-access-key", }, run_settings: { - cypress_proj_dir: "random path" + cypress_proj_dir: "random path", + cypressConfigFilePath: "random path", + cypressProjectDir: "random path" } };