Skip to content

Commit 85a4778

Browse files
ci: added OpenOCD/Python/PythonExe
1 parent ea791c5 commit 85a4778

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

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

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
import java.io.File;
66
import java.io.IOException;
7+
import java.nio.file.FileSystems;
78
import java.nio.file.Path;
9+
import java.nio.file.PathMatcher;
810
import java.nio.file.Paths;
911

1012
import org.apache.commons.lang3.SystemUtils;
@@ -80,16 +82,79 @@ private static void openPreferencesBuildEnvVariables() throws Exception {
8082

8183
private static void verifyToolsPaths() {
8284
idfToolsPath();
85+
closeDialog();
86+
idfPath();
87+
closeDialog();
88+
openOCDScripts();
89+
closeDialog();
90+
idfPythonEnvPath();
91+
closeDialog();
92+
pythonExePath();
93+
closeDialog();
8394
}
8495

8596
private static void idfToolsPath() {
8697
bot.table().select("IDF_TOOLS_PATH");
8798
bot.table().getTableItem("IDF_TOOLS_PATH").doubleClick();
88-
bot.sleep(1000);
99+
TestWidgetWaitUtility.waitForDialogToAppear(bot, "Edit variable", 5000);
89100

90101
Path idfToolsPath = Paths.get(System.getProperty("user.home"), ".espressif", IDFConstants.TOOLS_FOLDER);
91102
String actualPath = bot.textWithLabel("Value:").getText();
92103
assertTrue(actualPath.equals(idfToolsPath.toString()));
93104
}
105+
106+
private static void idfPath() {
107+
bot.table().select("IDF_PATH");
108+
bot.table().getTableItem("IDF_PATH").doubleClick();
109+
TestWidgetWaitUtility.waitForDialogToAppear(bot, "Edit variable", 5000);
110+
111+
Path idfPath = Paths.get(IDFUtil.getIDFPath());
112+
String actualPath = bot.textWithLabel("Value:").getText();
113+
assertTrue(actualPath.equals(idfPath.toString()));
114+
}
115+
116+
private static void openOCDScripts() {
117+
bot.table().select("OPENOCD_SCRIPTS");
118+
bot.table().getTableItem("OPENOCD_SCRIPTS").doubleClick();
119+
TestWidgetWaitUtility.waitForDialogToAppear(bot, "Edit variable", 5000);
120+
121+
String actualPath = bot.textWithLabel("Value:").getText();
122+
String home = System.getProperty("user.home").replace("\\", "/");
123+
String pattern = "glob:" + home + "/.espressif/" + IDFConstants.TOOLS_FOLDER
124+
+ "/openocd-esp32/*/openocd-esp32/share/openocd/scripts";
125+
126+
PathMatcher matcher = FileSystems.getDefault().getPathMatcher(pattern);
127+
assertTrue(matcher.matches(Paths.get(actualPath)));
128+
}
129+
130+
private static void idfPythonEnvPath() {
131+
bot.table().select("IDF_PYTHON_ENV_PATH");
132+
bot.table().getTableItem("IDF_PYTHON_ENV_PATH").doubleClick();
133+
TestWidgetWaitUtility.waitForDialogToAppear(bot, "Edit variable", 5000);
134+
135+
String actualPath = bot.textWithLabel("Value:").getText();
136+
String home = System.getProperty("user.home").replace("\\", "/");
137+
String pattern = "glob:" + home + "/.espressif/" + IDFConstants.TOOLS_FOLDER + "/python/*/venv";
138+
139+
PathMatcher matcher = FileSystems.getDefault().getPathMatcher(pattern);
140+
assertTrue(matcher.matches(Paths.get(actualPath)));
141+
}
142+
143+
private static void pythonExePath() {
144+
bot.table().select("PYTHON_EXE_PATH");
145+
bot.table().getTableItem("PYTHON_EXE_PATH").doubleClick();
146+
TestWidgetWaitUtility.waitForDialogToAppear(bot, "Edit variable", 5000);
147+
148+
String actualPath = bot.textWithLabel("Value:").getText();
149+
String home = System.getProperty("user.home").replace("\\", "/");
150+
String pattern = "glob:" + home + "/.espressif/" + IDFConstants.TOOLS_FOLDER + "/python/*/venv/bin/python";
151+
152+
PathMatcher matcher = FileSystems.getDefault().getPathMatcher(pattern);
153+
assertTrue(matcher.matches(Paths.get(actualPath)));
154+
}
155+
156+
private static void closeDialog() {
157+
bot.button("OK").click();
158+
}
94159
}
95160
}

0 commit comments

Comments
 (0)