Skip to content

Commit b0777d5

Browse files
fix: optimize tests logic
1 parent 01bba94 commit b0777d5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.junit.runner.RunWith;
2020
import org.junit.runners.MethodSorters;
2121

22+
import com.espressif.idf.ui.handlers.Messages;
2223
import com.espressif.idf.ui.test.common.WorkBenchSWTBot;
2324
import com.espressif.idf.ui.test.common.utility.TestWidgetWaitUtility;
2425
import com.espressif.idf.ui.test.operations.EnvSetupOperations;
@@ -80,6 +81,7 @@ public void givenBNewProjectCreatedWhenCreateNewLaunchTargetThenProjectBuiltSucc
8081
public void givenCNewProjectCreatedWhenDeleteSelectedLaunchTargetThenDeletedSuccessfully()
8182
throws Exception
8283
{
84+
Fixture.whenProjectFullCleanUsingContextMenu();
8385
Fixture.whenDeleteSelectedLaunchTarget();
8486
Fixture.thenLaunchTargetDeletedSuccessfully();
8587
}
@@ -146,10 +148,7 @@ private static void whenDeleteLaunchTarget() throws Exception
146148
TestWidgetWaitUtility.waitForDialogToAppear(bot, "New ESP Target", 20000);
147149
SWTBotShell shell = bot.shell("New ESP Target");
148150
shell.setFocus();
149-
bot.button("Delete").click();
150-
TestWidgetWaitUtility.waitForDialogToAppear(bot, "IDF Launch Target Changed", 5000);
151-
bot.button("Yes").click();
152-
bot.sleep(500);
151+
bot.button("Delete").click();
153152
}
154153

155154
private static void whenDeleteSelectedLaunchTarget() throws Exception
@@ -207,6 +206,14 @@ private static void thenBuildFolderDeletedSuccessfully() throws Exception
207206
assertTrue("Build folder was not deleted successfully!", ProjectTestOperations.findProjectFullCleanedFilesInBuildFolder(projectName, bot));
208207
}
209208

209+
private static void whenProjectFullCleanUsingContextMenu() throws IOException
210+
{
211+
ProjectTestOperations.launchCommandUsingContextMenu(projectName, bot, "Project Full Clean");
212+
ProjectTestOperations.joinJobByName(Messages.ProjectFullCleanCommandHandler_RunningFullcleanJobName);
213+
ProjectTestOperations.findInConsole(bot, "Espressif IDF Tools Console", "Done");
214+
TestWidgetWaitUtility.waitForOperationsInProgressToFinishSync(bot);
215+
}
216+
210217
private static void cleanTestEnv()
211218
{
212219
TestWidgetWaitUtility.waitForOperationsInProgressToFinishAsync(bot);

0 commit comments

Comments
 (0)