Fix running tests in macOS (#689)

Co-authored-by: Zufar Fakhurtdinov <zufar.fakhurtdinov@delightex.com>
This commit is contained in:
zufarfakhurtdinov 2023-04-11 13:57:28 +03:00 committed by GitHub
parent 928a8631a8
commit e801ff5b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,7 +250,9 @@ public class TeaVMTestRunner extends Runner implements Filterable {
}
private void addChromeCommand(List<String> params) {
if (isWindows()) {
if (isMacos()) {
params.add("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome");
} else if (isWindows()) {
params.add("cmd.exe");
params.add("start");
params.add("/C");
@ -261,6 +263,10 @@ public class TeaVMTestRunner extends Runner implements Filterable {
}
private void addFirefoxCommand(List<String> params) {
if (isMacos()) {
params.add("/Applications/Firefox.app/Contents/MacOS/firefox");
return;
}
if (isWindows()) {
params.add("cmd.exe");
params.add("/C");
@ -273,6 +279,10 @@ public class TeaVMTestRunner extends Runner implements Filterable {
return System.getProperty("os.name").toLowerCase().startsWith("windows");
}
private boolean isMacos() {
return System.getProperty("os.name").toLowerCase().startsWith("mac");
}
private Process browserTemplate(String name, String url, BiConsumer<String, List<String>> paramsBuilder) {
File temp;
try {