Skip to content

Commit 91f80b6

Browse files
committed
add code to set correct default spec folder
1 parent e90aef8 commit 91f80b6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bin/helpers/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ const packageInstallerOptions = {
358358
const specFileTypes = ["js", "ts", "feature", "jsx", "coffee", "cjsx"];
359359

360360
const DEFAULT_CYPRESS_SPEC_PATH = "cypress/integration";
361+
const DEFAULT_CYPRESS_10_SPEC_PATH = "cypress/e2e";
361362

362363
const SPEC_TOTAL_CHAR_LIMIT = 32243;
363364
const METADATA_CHAR_BUFFER_PER_SPEC = 175;
@@ -423,6 +424,7 @@ module.exports = Object.freeze({
423424
packageInstallerOptions,
424425
specFileTypes,
425426
DEFAULT_CYPRESS_SPEC_PATH,
427+
DEFAULT_CYPRESS_10_SPEC_PATH,
426428
SPEC_TOTAL_CHAR_LIMIT,
427429
METADATA_CHAR_BUFFER_PER_SPEC,
428430
usageReportingConstants,

bin/helpers/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,11 @@ exports.getFilesToIgnore = (runSettings, excludeFiles, logging = true) => {
967967
}
968968

969969
exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig) => {
970-
let testFolderPath = cypressConfig.integrationFolder || Constants.DEFAULT_CYPRESS_SPEC_PATH;
970+
let defaultSpecFolder = Constants.DEFAULT_CYPRESS_SPEC_PATH;
971+
if (bsConfig.run_settings.cypressTestSuiteType === Constants.CYPRESS_V10_AND_ABOVE_TYPE) {
972+
defaultSpecFolder = Constants.DEFAULT_CYPRESS_10_SPEC_PATH;
973+
}
974+
let testFolderPath = cypressConfig.integrationFolder || defaultSpecFolder;
971975
let globSearchPattern = this.sanitizeSpecsPattern(bsConfig.run_settings.specs) || `${testFolderPath}/**/*.+(${Constants.specFileTypes.join("|")})`;
972976
let ignoreFiles = args.exclude || bsConfig.run_settings.exclude;
973977
let files = glob.sync(globSearchPattern, {cwd: bsConfig.run_settings.cypressProjectDir, matchBase: true, ignore: ignoreFiles});

0 commit comments

Comments
 (0)