Skip to content

Commit 69ea1cd

Browse files
committed
add: handling for different folder structure turboscale
1 parent 0b95212 commit 69ea1cd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

bin/helpers/utils.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,13 +1112,6 @@ exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig, turboScaleSession
11121112
if (bsConfig.run_settings.cypressTestSuiteType === Constants.CYPRESS_V10_AND_ABOVE_TYPE) {
11131113
defaultSpecFolder = Constants.DEFAULT_CYPRESS_10_SPEC_PATH
11141114
testFolderPath = defaultSpecFolder
1115-
if (turboScaleSession) {
1116-
testFolderPath =
1117-
cypressConfig.integrationFolder &&
1118-
cypressConfig.integrationFolder !== '.'
1119-
? cypressConfig.integrationFolder
1120-
: defaultSpecFolder;
1121-
}
11221115
// Read cypress config if enforce_settings is not present
11231116
if(this.isUndefinedOrFalse(bsConfig.run_settings.enforce_settings) && !this.isUndefined(cypressConfig) && !this.isUndefined(cypressConfig.e2e)) {
11241117
if(!this.isUndefined(cypressConfig.e2e.specPattern)) {
@@ -1186,6 +1179,11 @@ exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig, turboScaleSession
11861179
logger.debug(`${files ? files.length : 0} spec files found`);
11871180

11881181
if (turboScaleSession) {
1182+
if (bsConfig.run_settings.turboScaleOptions && bsConfig.run_settings.turboScaleOptions.integrationFolder) {
1183+
// this is in case the user's project does not use the default path 'cypress/e2e'
1184+
// add integrationFolder in turboScaleOptions in browserstack.json
1185+
testFolderPath = bsConfig.run_settings.turboScaleOptions.integrationFolder;
1186+
}
11891187
// remove unwanted path prefix for turboscale
11901188
files = files.map((x) => { return path.join(testFolderPath, x.split(testFolderPath)[1]) })
11911189
// setting specs for turboScale as we don't have patched API for turboscale so we will rely on info from CLI

0 commit comments

Comments
 (0)