Search in sources :

Example 1 with ITestActor

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();
                        }
                    }
                }
            }
        });
    }
}
Also used : Observer(java.util.Observer) ITestActor(org.getopentest.contracts.ITestActor) Observable(java.util.Observable)

Example 2 with ITestActor

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();
}
Also used : Observer(java.util.Observer) ITestActor(org.getopentest.contracts.ITestActor) Observable(java.util.Observable)

Example 3 with ITestActor

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);
        }
    }
}
Also used : ITestActor(org.getopentest.contracts.ITestActor) ITestActor(org.getopentest.contracts.ITestActor) TestActor(org.getopentest.base.TestActor)

Aggregations

ITestActor (org.getopentest.contracts.ITestActor)3 Observable (java.util.Observable)2 Observer (java.util.Observer)2 TestActor (org.getopentest.base.TestActor)1