Skip to content

Commit 4680b7d

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

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

bin/helpers/utils.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,15 +1179,18 @@ exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig, turboScaleSession
11791179
logger.debug(`${files ? files.length : 0} spec files found`);
11801180

11811181
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;
1182+
if (bsConfig.run_settings.cypress_config_file && bsConfig.run_settings.cypress_config_filename !== 'false') {
1183+
const configFilePath = path.resolve(bsConfig.run_settings.cypressConfigFilePath);
1184+
const directory = path.join(path.dirname(configFilePath), '/');
1185+
console.log(`ANKIT -- directory -- ${directory}`)
1186+
// remove unwanted path prefix for turboscale
1187+
files = files.map((x) => { return path.join('', x.split(directory)[1]) })
1188+
// setting specs for turboScale as we don't have patched API for turboscale so we will rely on info from CLI
1189+
bsConfig.run_settings.specs = files;
1190+
} else {
1191+
files = files.map((x) => { return path.join(testFolderPath, x.split(testFolderPath)[1]) })
1192+
bsConfig.run_settings.specs = files;
11861193
}
1187-
// remove unwanted path prefix for turboscale
1188-
files = files.map((x) => { return path.join(testFolderPath, x.split(testFolderPath)[1]) })
1189-
// setting specs for turboScale as we don't have patched API for turboscale so we will rely on info from CLI
1190-
bsConfig.run_settings.specs = files;
11911194
}
11921195
return files;
11931196
};

0 commit comments

Comments
 (0)