@@ -6,21 +6,32 @@ import { getSDKPrefixCommand } from "./commands.js";
6
6
import { generateBrowserStackYMLInstructions } from "./configUtils.js" ;
7
7
import { getInstructionsForProjectConfiguration } from "../common/instructionUtils.js" ;
8
8
import { BrowserStackConfig } from "../../../lib/types.js" ;
9
+ import { validateDevices } from "../common/device-validator.js" ;
9
10
import {
10
11
SDKSupportedBrowserAutomationFramework ,
11
12
SDKSupportedTestingFramework ,
12
13
SDKSupportedLanguage ,
13
14
} from "../common/types.js" ;
14
15
15
- export function runBstackSDKOnly (
16
+ export async function runBstackSDKOnly (
16
17
input : RunTestsOnBrowserStackInput ,
17
18
config : BrowserStackConfig ,
18
19
isPercyAutomate = false ,
19
- ) : RunTestsInstructionResult {
20
+ ) : Promise < RunTestsInstructionResult > {
20
21
const steps : RunTestsStep [ ] = [ ] ;
21
22
const authString = getBrowserStackAuth ( config ) ;
22
23
const [ username , accessKey ] = authString . split ( ":" ) ;
23
24
25
+ // Validate devices against real BrowserStack device data
26
+ const tupleTargets = ( input as any ) . devices as
27
+ | Array < Array < string > >
28
+ | undefined ;
29
+
30
+ await validateDevices (
31
+ tupleTargets || [ ] ,
32
+ input . detectedBrowserAutomationFramework ,
33
+ ) ;
34
+
24
35
// Handle frameworks with unique setup instructions that don't use browserstack.yml
25
36
if (
26
37
input . detectedBrowserAutomationFramework === "cypress" ||
@@ -76,7 +87,7 @@ export function runBstackSDKOnly(
76
87
}
77
88
78
89
const ymlInstructions = generateBrowserStackYMLInstructions (
79
- input . desiredPlatforms as string [ ] ,
90
+ ( tupleTargets || [ ] ) . map ( ( tuple ) => tuple . join ( " " ) ) ,
80
91
false ,
81
92
input . projectName ,
82
93
) ;
0 commit comments