@@ -55,17 +55,19 @@ export function startDebugConfigurationTests(): void {
5555 assert . notStrictEqual ( rnOption , null ) ;
5656 } ) ;
5757
58- it ( "Complete debug configuration setup workflow" , async ( ) => {
59- const rnOptionText = "More React Native options..." ;
60- const projectRoot = path . join ( __dirname , ".." , "resources" , "sampleReactNativeProject" ) ;
58+ it . only ( "Complete debug configuration setup workflow" , async ( ) => {
59+ const launchFilePath = path . join ( __dirname , ".." , "resources" , "sampleReactNativeProject" , ".vscode" , "launch.json" ) ;
6160
62- fs . writeFileSync ( path . join ( projectRoot , ".vscode" , "launch.json" ) , JSON . stringify ( { } ) ) ;
61+ fs . writeFileSync ( launchFilePath , JSON . stringify ( { } ) ) ;
6362
6463 await initApp ( ) ;
6564
6665 await ComponentHelper . openFileExplorer ( ) ;
6766 const vscodeFolder = await ComponentHelper . WaitFileVisibleInFileExplorer ( ".vscode" ) ;
68- assert . notStrictEqual ( vscodeFolder , null , ".vscode folder should exist" ) ;
67+ if ( ! vscodeFolder ) {
68+ throw new Error ( "vscodeFolder is null. File '.vscode' was not found in the file explorer." ) ;
69+ }
70+ await vscodeFolder . click ( ) ;
6971 await ElementHelper . clickElementByText ( "launch.json" ) ;
7072
7173 const debugAddConfigurationButton = await ElementHelper . WaitElementSelectorVisible (
@@ -75,41 +77,34 @@ export function startDebugConfigurationTests(): void {
7577 await debugAddConfigurationButton . click ( ) ;
7678
7779 const reactNativeButton = await ElementHelper . WaitElementSelectorVisible (
78- Element . reactNativeButtonAriaLabel ,
80+ Element . reactNativeButtonSelector ,
7981 3000 ,
8082 ) ;
8183 await reactNativeButton . click ( ) ;
8284
8385 const debugApplicationButton = await ElementHelper . WaitElementSelectorVisible (
84- Element . debugApplicationButtonAriaLabel ,
86+ Element . debugApplicationButtonSelector ,
8587 1000 ,
8688 ) ;
8789 await debugApplicationButton . click ( ) ;
8890
8991 const androidButton = await ElementHelper . WaitElementSelectorVisible (
90- Element . androidButtonAriaLabel ,
92+ Element . androidButtonSelector ,
9193 1000 ,
9294 ) ;
9395 await androidButton . click ( ) ;
9496
9597 const applicationInDirectModeButton = await ElementHelper . WaitElementSelectorVisible (
96- Element . applicationInDirectModeButtonAriaLabel ,
98+ Element . applicationInDirectModeButtonSelector ,
9799 1000 ,
98100 ) ;
99101 await applicationInDirectModeButton . click ( ) ;
100-
101- const rnOption = await ElementHelper . TryFindElement (
102- `[aria-label="${ rnOptionText } "]` ,
103- 3000 ,
104- ) ;
105- assert . notStrictEqual ( rnOption , null , "React Native debug option should be available" ) ;
106-
107- if ( rnOption ) {
108- await rnOption . click ( ) ;
109- SmokeTestLogger . info (
110- "Successfully initiated React Native debug configuration setup" ,
111- ) ;
112- }
102+ await ElementHelper . Page ( ) . waitForLoadState ( "domcontentloaded" ) ;
103+ const test = await ElementHelper . TryFindElement ( ".monaco-mouse-cursor-text" , 5000 ) ;
104+ console . log ( await test ?. innerText ( ) ) ;
105+ //assert.equal((await test?.innerText())?.toString().includes("Debug Android Hermes"), true, "launch.json file is not correctly updated");
106+ const text = JSON . stringify ( await test ?. innerText ( ) ) ;
107+ assert . ok ( text ?. includes ( "Debug Android Hermes" ) , `Expected text to include "Debug Android Hermes", but got: ${ text } ` ) ;
113108 } ) ;
114109 } ) ;
115110}
0 commit comments