@@ -191,12 +191,16 @@ public void givenNewProjectCreatedDfuBuiltThenHasDfuBin() throws Exception
191191 }
192192
193193 @ Test
194- public void creatingNewDebugLaunchConfig () throws Exception
194+ public void whenProjectIsSelectedInProjectExplorerThenNewDebugConfigurationHasPrefilledAllFields () throws Exception
195195 {
196196 Fixture .givenNewEspressifIDFProjectIsSelected ("EspressIf" , "Espressif IDF Project" );
197197 Fixture .givenProjectNameIs ("NewProjectTest" );
198198 Fixture .whenNewProjectIsSelected ();
199+ Fixture .givenESP32LaunchTargetIsSelected ();
199200 Fixture .selectNewDebugLaunchConfig ();
201+ Fixture .compareProjectName ();
202+ Fixture .compareActualExePath ();
203+ Fixture .compareSVDPath ();
200204 }
201205
202206 private static class Fixture
@@ -295,24 +299,32 @@ private static void givenESP32LaunchTargetIsSelected()
295299 launchBarTargetSelector .select ("esp32" );
296300 }
297301
298- private static void selectNewDebugLaunchConfig () {
299- givenESP32LaunchTargetIsSelected ();
302+ private static void selectNewDebugLaunchConfig ()
303+ {
300304 launchBarConfigSelector .select ("New Launch Configuration..." );
301305 bot .table (0 ).select ("Debug" );
302306 bot .table (1 ).select ("ESP-IDF GDB OpenOCD Debugging" );
303307 bot .button ("Next >" ).click ();
308+ }
309+
310+ private static void compareProjectName ()
311+ {
304312 SWTBotText textWidget = bot .textWithLabel ("Project:" );
305313 assertTrue (textWidget .getText ().equals (projectName ));
314+ }
315+
316+ private static void compareActualExePath ()
317+ {
306318 bot .cTabItem ("Debugger" ).activate ();
307- SWTBotText textWidget1 = bot .textWithLabel ("Actual Executable:" );
308- String pathtoexe = System . getProperty ( "user.home" );
309- Path p = Paths . get ( pathtoexe
310- + " \\ .espressif \\ tools \\ xtensa-esp-elf-gdb \\ 12.1_20221002 \\ xtensa-esp-elf-gdb \\ bin \\ xtensa-esp32-elf-gdb.exe" );
311- p . toAbsolutePath (). toString ();
312- assertTrue ( textWidget1 . getText (). equals ( p . toAbsolutePath (). toString ()));
319+ SWTBotText actualExeTxtWidget = bot .textWithLabel ("Actual Executable:" );
320+ assertTrue ( actualExeTxtWidget . getText (). contains ( "xtensa-esp32-elf-gdb.exe" ) );
321+ }
322+
323+ private static void compareSVDPath ()
324+ {
313325 bot .cTabItem ("SVD Path" ).activate ();
314- SWTBotText textWidget2 = bot .textWithLabel ("File path:" );
315- assertTrue (textWidget2 .getText ().contains ("esp32.svd" ));
326+ SWTBotText filePathTxtWidget = bot .textWithLabel ("File path:" );
327+ assertTrue (filePathTxtWidget .getText ().contains ("esp32.svd" ));
316328 bot .button ("Finish" ).click ();
317329 }
318330
0 commit comments