@@ -330,8 +330,8 @@ exports.setCypressConfigFilename = (bsConfig, args) => {
330
330
331
331
exports . setCypressTestSuiteType = ( bsConfig ) => {
332
332
for ( const possibleCypressFileName of Constants . CYPRESS_CONFIG_FILE_NAMES ) {
333
- if ( bsConfig . run_settings . cypressConfigFilePath &&
334
- typeof ( bsConfig . run_settings . cypressConfigFilePath ) === 'string' &&
333
+ if ( bsConfig . run_settings . cypressConfigFilePath &&
334
+ typeof ( bsConfig . run_settings . cypressConfigFilePath ) === 'string' &&
335
335
( path . extname ( bsConfig . run_settings . cypressConfigFilePath ) == path . extname ( possibleCypressFileName ) || bsConfig . run_settings . cypressConfigFilePath . endsWith ( possibleCypressFileName ) ) ) {
336
336
bsConfig . run_settings . cypressTestSuiteType = Constants . CYPRESS_CONFIG_FILE_MAPPING [ possibleCypressFileName ] . type ;
337
337
break ;
@@ -347,11 +347,11 @@ exports.setCypressTestSuiteType = (bsConfig) => {
347
347
348
348
exports . setCypressNpmDependency = ( bsConfig ) => {
349
349
const runSettings = bsConfig . run_settings ;
350
- if ( runSettings . npm_dependencies !== undefined &&
350
+ if ( runSettings . npm_dependencies !== undefined &&
351
351
Object . keys ( runSettings . npm_dependencies ) . length !== 0 &&
352
352
typeof runSettings . npm_dependencies === 'object' ) {
353
353
if ( ! ( "cypress" in runSettings . npm_dependencies ) && runSettings . cypressTestSuiteType === Constants . CYPRESS_V10_AND_ABOVE_TYPE ) {
354
- logger . warn ( "Missing cypress not found in npm_dependencies" ) ;
354
+ logger . warn ( "Missing cypress not found in npm_dependencies" ) ;
355
355
if ( "cypress_version" in runSettings ) {
356
356
runSettings . npm_dependencies . cypress = `^${ runSettings . cypress_version . toString ( ) . split ( "." ) [ 0 ] } ` ;
357
357
} else if ( runSettings . cypressTestSuiteType === Constants . CYPRESS_V10_AND_ABOVE_TYPE ) {
@@ -386,13 +386,13 @@ exports.setGeolocation = (bsConfig, args) => {
386
386
}
387
387
388
388
exports . isSpecTimeoutArgPassed = ( ) => {
389
- return this . searchForOption ( '--spec-timeout' ) || this . searchForOption ( '-t' ) ;
389
+ return this . searchForOption ( '--spec-timeout' ) || this . searchForOption ( '-t' ) ;
390
390
}
391
391
exports . setSpecTimeout = ( bsConfig , args ) => {
392
392
let specTimeout = null ;
393
393
if ( this . isSpecTimeoutArgPassed ( ) ) {
394
- if ( ! this . isUndefined ( args . specTimeout ) ) {
395
- specTimeout = args . specTimeout ;
394
+ if ( ! this . isUndefined ( args . specTimeout ) ) {
395
+ specTimeout = args . specTimeout ;
396
396
} else {
397
397
specTimeout = 'undefined'
398
398
}
@@ -410,7 +410,7 @@ exports.setTimezone = (bsConfig, args) => {
410
410
let newTimezone ;
411
411
if ( this . isNotUndefined ( timezone ) ) {
412
412
if ( this . isValidTimezone ( timezone ) ) {
413
- newTimezone = timezone ;
413
+ newTimezone = timezone ;
414
414
} else {
415
415
logger . error ( `Invalid timezone = ${ timezone } ` ) ;
416
416
syncCliLogger . info ( chalk . red ( Constants . userMessages . INVALID_TIMEZONE ) ) ;
@@ -443,11 +443,11 @@ exports.setProjectId = (bsConfig, args, cypressConfigFile) => {
443
443
} else if ( ! this . isUndefined ( process . env . CYPRESS_PROJECT_ID ) ) {
444
444
return process . env . CYPRESS_PROJECT_ID ;
445
445
} else if ( ! this . isUndefined ( bsConfig . run_settings [ "projectId" ] ) ) {
446
- return bsConfig . run_settings [ "projectId" ] ;
446
+ return bsConfig . run_settings [ "projectId" ] ;
447
447
} else {
448
448
// ignore reading cypressconfig if enforce_settings is passed
449
449
if ( this . isUndefinedOrFalse ( bsConfig . run_settings . enforce_settings ) && ! this . isUndefined ( cypressConfigFile ) && ! this . isUndefined ( cypressConfigFile [ "projectId" ] ) ) {
450
- return cypressConfigFile [ "projectId" ] ;
450
+ return cypressConfigFile [ "projectId" ] ;
451
451
}
452
452
}
453
453
}
@@ -497,7 +497,7 @@ exports.setUserSpecs = (bsConfig, args) => {
497
497
bsConfig . run_settings . specs = process . env . BROWSERSTACK_RERUN_TESTS ;
498
498
return ;
499
499
}
500
-
500
+
501
501
let bsConfigSpecs = bsConfig . run_settings . specs ;
502
502
503
503
if ( ! this . isUndefined ( args . specs ) ) {
@@ -1167,7 +1167,7 @@ exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig, turboScaleSession
1167
1167
let files
1168
1168
if ( globSearchPattern ) {
1169
1169
let fileMatchedWithBstackSpecPattern = glob . sync ( globSearchPattern , {
1170
- cwd : bsConfig . run_settings . cypressProjectDir , matchBase : true , ignore : ignoreFiles
1170
+ cwd : bsConfig . run_settings . cypressProjectDir , matchBase : true , ignore : ignoreFiles
1171
1171
} ) ;
1172
1172
fileMatchedWithBstackSpecPattern = fileMatchedWithBstackSpecPattern . map ( ( file ) => path . resolve ( bsConfig . run_settings . cypressProjectDir , file ) )
1173
1173
@@ -1184,12 +1184,14 @@ exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig, turboScaleSession
1184
1184
const directory = path . join ( path . dirname ( configFilePath ) , '/' ) ;
1185
1185
// remove unwanted path prefix for turboscale
1186
1186
files = files . map ( ( x ) => { return path . join ( '' , x . split ( directory ) [ 1 ] ) } )
1187
- // setting specs for turboScale as we don't have patched API for turboscale so we will rely on info from CLI
1188
- bsConfig . run_settings . specs = files ;
1189
1187
} else {
1190
1188
files = files . map ( ( x ) => { return path . join ( testFolderPath , x . split ( testFolderPath ) [ 1 ] ) } )
1191
- bsConfig . run_settings . specs = files ;
1192
1189
}
1190
+
1191
+ // sanitize spec list as CLI might be running on windows
1192
+ files = files . map ( ( x ) => { return x . replaceAll ( "\\" , "/" ) } )
1193
+ // setting specs for turboScale as we don't have patched API for turboscale so we will rely on info from CLI
1194
+ bsConfig . run_settings . specs = files ;
1193
1195
}
1194
1196
return files ;
1195
1197
} ;
@@ -1453,12 +1455,12 @@ exports.setEnforceSettingsConfig = (bsConfig, args) => {
1453
1455
/**
1454
1456
* Splits a string by a specified splitChar.
1455
1457
* If leftLimiter and rightLimiter are specified then string won't be splitted if the splitChar is within the range
1456
- *
1458
+ *
1457
1459
* @param {String } str - the string that needs to be splitted
1458
1460
* @param {String } splitChar - the split string/char from which the string will be splited
1459
1461
* @param {String } [leftLimiter] - the starting string/char of the range
1460
1462
* @param {String } [rightLimiter] - the ending string/char of the range
1461
- *
1463
+ *
1462
1464
* @example Example usage of splitStringByCharButIgnoreIfWithinARange.
1463
1465
* // returns ["folder/A/B", "folder/{C,D}/E"]
1464
1466
* utils.splitStringByCharButIgnoreIfWithinARange("folder/A/B,folder/{C,D}/E", ",", "{", "}");
@@ -1567,7 +1569,7 @@ exports.formatRequest = (err, resp, body) => {
1567
1569
1568
1570
exports . setDebugMode = ( args ) => {
1569
1571
if ( args . cliDebug || String ( process . env . DEBUG ) . toLowerCase ( ) === 'true' ) {
1570
- args . cliDebug ?
1572
+ args . cliDebug ?
1571
1573
logger . info ( "CLI is running with the --cli-debug argument. Running CLI in the debug mode..." ) :
1572
1574
logger . info ( "DEBUG environment variable set to 'true'. Running CLI in the debug mode..." ) ;
1573
1575
transports . loggerConsole . level = 'debug' ;
@@ -1580,7 +1582,7 @@ exports.setDebugMode = (args) => {
1580
1582
1581
1583
exports . stopBrowserStackBuild = async ( bsConfig , args , buildId , rawArgs , buildReportData = null ) => {
1582
1584
let that = this ;
1583
-
1585
+
1584
1586
let url = config . buildStopUrl + buildId ;
1585
1587
let options = {
1586
1588
url : url ,
@@ -1607,10 +1609,10 @@ exports.stopBrowserStackBuild = async (bsConfig, args, buildId, rawArgs, buildRe
1607
1609
let messageType = null ;
1608
1610
let errorCode = null ;
1609
1611
let build = null ;
1610
-
1612
+
1611
1613
try {
1612
1614
const response = await axios . post ( options . url , { } , axiosConfig ) ;
1613
-
1615
+
1614
1616
build = response . data ;
1615
1617
if ( response . status == 299 ) {
1616
1618
messageType = Constants . messageTypes . INFO ;
@@ -1780,7 +1782,7 @@ exports.getMajorVersion = (version) => {
1780
1782
} catch ( error ) {
1781
1783
logger . debug ( `Some Error occurred while fetching major version of ${ version } . Returning null. Error Details: ${ error } ` )
1782
1784
return null ;
1783
- }
1785
+ }
1784
1786
}
1785
1787
1786
1788
const base64UrlDecode = ( str ) => {
0 commit comments