Ticket #1348 (new enhancement)
Testing Host should perform test cases on OSX / Linux using FF
| Reported by: | Jani Laakso | Owned by: | Jani Laakso |
|---|---|---|---|
| Priority: | undefined | Milestone: | Testing Tools Backlog |
| Component: | Testing Tools | Version: | |
| Keywords: | Cc: | ||
| Known Issue description: | |||
| Hours estimate: | 4 | Deadline (dd.mm.yyyy): | |
| Known Issue version (since): | Known Issue title: | ||
| Hours done: | Depends to: | ||
| Affects documentation: | no | ||
| Known Issue workaround: | |||
| Affects release notes: | yes | Contract: | |
Description
Currently only Windows is supported. This is a simple matter of adding (and testing) correct launch browser / kill browser commands to NativeCommand?.java file:
It almost works on OSX, but needs to be tested more..
This gives you the impression what is needed:
public static String getNetworkName(Platform platform) {
String cmd[] = null;
if (platform == Platform.WINDOWS) {
cmd = new String[] { "CMD.EXE", "/C", "echo %COMPUTERNAME%" };
} else if (platform == Platform.MAC) {
cmd = new String[] { "sh", "-c", "uname -n" };
} else if (platform == Platform.LINUX) {
cmd = new String[] { "sh", "-c", "uname -n" };
}
return Executor.simpleExec(cmd);
}
public static String[] getExecTestCommand(Platform platform) {
String[] commands = null;
if (platform == Platform.MAC) {
commands = new String[] { "/bin/bash -c \"set\"" };
} else if (platform == Platform.WINDOWS) {
commands = new String[] { "cmd.exe /C \"set\"" };
} else if (platform == Platform.LINUX) {
commands = new String[] { "/bin/bash -c \"set\"" };
}
return commands;
}
public static String[] getExecStartBrowser(Platform platform) {
String[] commands = null;
if (platform == Platform.MAC) {
commands = new String[] { "/Applications/Firefox.app/Contents/MacOS/firefox-bin" };
} else if (platform == Platform.WINDOWS) {
commands = new String[] { "\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\"" };
} else if (platform == Platform.LINUX) {
commands = new String[] { "export DISPLAY=:0; xhost +; firefox" };
}
return commands;
}
// kill nicely, sleep 5 seconds, kill forcefully
public static String[] getExecEndBrowsers(Platform platform) {
String[] commands = null;
if (platform == Platform.MAC) {
commands = new String[] { "killall firefox-bin", "sleep 5",
"killall -9 firefox-bin" };
} else if (platform == Platform.WINDOWS) {
commands = new String[] {
"CMD.EXE /C \"TASKKILL /IM firefox.exe\"",
"ping -n 6 127.0.0.1",
"CMD.EXE /C \"TASKKILL /F /IM firefox.exe /T\"" };
} else if (platform == Platform.LINUX) {
commands = new String[] { "killall firefox-bin", "sleep 5",
"killall -9 firefox-bin" };
}
return commands;
}
Change History
Note: See
TracTickets for help on using
tickets.
