Add playwright E2E tests (#2174)

This commit is contained in:
Sam Freund
2025-12-04 22:25:48 -06:00
committed by GitHub
parent f821657d2b
commit 017b074eae
18 changed files with 421 additions and 46 deletions

View File

@@ -102,7 +102,8 @@ public enum Platform {
public final boolean isSupported;
// Set once at init, shouldn't be needed after.
private static final Platform currentPlatform = getCurrentPlatform();
private static Platform currentPlatform = getCurrentPlatform();
private static boolean override = false;
Platform(
String description,
@@ -119,6 +120,11 @@ public enum Platform {
this.nativeLibraryFolderName = nativeLibFolderName;
}
public static void overridePlatform(Platform platform) {
currentPlatform = platform;
override = true;
}
//////////////////////////////////////////////////////
// Public API
@@ -128,14 +134,15 @@ public enum Platform {
}
public static boolean isRK3588() {
return Platform.isOrangePi()
return currentPlatform == LINUX_RK3588_64
|| Platform.isOrangePi()
|| Platform.isCoolPi4b()
|| Platform.isRock5C()
|| fileHasText("/proc/device-tree/compatible", "rk3588");
}
public static boolean isQCS6490() {
return isRubik();
return currentPlatform == LINUX_QCS6490 || Platform.isRubik();
}
public static boolean isRaspberryPi() {
@@ -167,6 +174,11 @@ public enum Platform {
return runRobotFile.exists();
}
public static boolean isWindows() {
var p = getCurrentPlatform();
return (p == WINDOWS_32 || p == WINDOWS_64);
}
//////////////////////////////////////////////////////
// Debug info related to unknown platforms for debug help
@@ -177,6 +189,10 @@ public enum Platform {
private static final String UnknownDeviceModelString = "Unknown";
public static Platform getCurrentPlatform() {
if (override) {
return currentPlatform;
}
String OS_NAME;
if (Platform.OS_NAME != null) {
OS_NAME = Platform.OS_NAME;
@@ -319,9 +335,4 @@ public enum Platform {
return false;
}
}
public static boolean isWindows() {
var p = getCurrentPlatform();
return (p == WINDOWS_32 || p == WINDOWS_64);
}
}