Skip to content

Commit 220f601

Browse files
DebugLaunchConfigTest
1 parent 3e738c8 commit 220f601

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import static org.junit.Assert.assertTrue;
88

99
import java.io.IOException;
10+
import java.nio.file.Path;
11+
import java.nio.file.Paths;
1012
import java.util.Arrays;
1113
import java.util.Optional;
1214

@@ -21,6 +23,7 @@
2123
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
2224
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
2325
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
26+
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
2427
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
2528
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
2629
import org.junit.After;
@@ -186,6 +189,15 @@ public void givenNewProjectCreatedDfuBuiltThenHasDfuBin() throws Exception
186189
Fixture.thenProjectHasTheFile("dfu.bin", "/build");
187190
Fixture.turnOffDfu();
188191
}
192+
193+
@Test
194+
public void creatingNewDebugLaunchConfig() throws Exception
195+
{
196+
Fixture.givenNewEspressifIDFProjectIsSelected("EspressIf", "Espressif IDF Project");
197+
Fixture.givenProjectNameIs("NewProjectTest");
198+
Fixture.whenNewProjectIsSelected();
199+
Fixture.selectNewDebugLaunchConfig();
200+
}
189201

190202
private static class Fixture
191203
{
@@ -277,6 +289,32 @@ private static void turnOnDfu()
277289
bot.comboBox().setSelection("DFU");
278290
bot.button("OK").click();
279291
}
292+
293+
private static void givenESP32LaunchTargetIsSelected()
294+
{
295+
launchBarTargetSelector.select("esp32");
296+
}
297+
298+
private static void selectNewDebugLaunchConfig() {
299+
givenESP32LaunchTargetIsSelected();
300+
launchBarConfigSelector.select("New Launch Configuration...");
301+
bot.table(0).select("Debug");
302+
bot.table(1).select("ESP-IDF GDB OpenOCD Debugging");
303+
bot.button("Next >").click();
304+
SWTBotText textWidget = bot.textWithLabel("Project:");
305+
assertTrue(textWidget.getText().equals(projectName));
306+
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()));
313+
bot.cTabItem("SVD Path").activate();
314+
SWTBotText textWidget2 = bot.textWithLabel("File path:");
315+
assertTrue(textWidget2.getText().contains("esp32.svd"));
316+
bot.button("Finish").click();
317+
}
280318

281319
private static void whenProjectIsBuiltUsingContextMenu() throws IOException
282320
{

0 commit comments

Comments
 (0)