use of org.getopentest.contracts.ITestActor in project opentest by mcdcorp.
the class AppiumTestAction method initialize.
@Override
public void initialize() {
super.initialize();
// test action is not yet populated.
if (!AppiumTestAction.initialized) {
AppiumTestAction.initialized = true;
this.getActor().addObserver(new Observer() {
@Override
public void update(Observable eventSource, Object eventData) {
if (eventSource instanceof ITestActor) {
if (eventData == TestActorEvents.TEST_COMPLETED) {
if (!AppiumHelper.getConfig().getBoolean("appium.reuseDriver", false)) {
AppiumHelper.discardDriver();
}
}
}
}
});
}
}
use of org.getopentest.contracts.ITestActor in project opentest by mcdcorp.
the class SeleniumTestAction method initialize.
@Override
public void initialize() {
super.initialize();
if (!SeleniumTestAction.initialized) {
SeleniumTestAction.initialized = true;
SeleniumTestAction.config = SeleniumHelper.getConfig();
this.getActor().addObserver(new Observer() {
@Override
public void update(Observable eventSource, Object eventData) {
if (eventSource instanceof ITestActor) {
if (eventData == TestActorEvents.TEST_COMPLETED) {
SeleniumTestAction.discardActionsObject();
if (!SeleniumHelper.getConfig().getBoolean("selenium.reuseDriver", false)) {
SeleniumHelper.discardDriver();
}
}
}
}
});
}
this.explicitWaitSec = this.readIntArgument("explicitWaitSec", SeleniumHelper.getExplicitWaitSec());
this.driver = SeleniumHelper.getDriver();
}
use of org.getopentest.contracts.ITestActor in project opentest by mcdcorp.
the class Main method main.
public static void main(String[] args) {
processCommandLineArgs(args);
ITestActor actor = new TestActor();
while (true) {
try {
actor.runOneSession();
} catch (Exception ex) {
Logger.error("An exception was thrown from the runOneSession method, which shouldn't " + "normally happen and might indicate a bug. Please provide all potentially " + "relevant data to the dev team for a fix (logs, context, etc).", ex);
}
}
}
Aggregations