Search in sources :

Example 6 with AutomationContext

use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.

the class SampleInstallationVerification method setup.

@BeforeClass(alwaysRun = true)
public void setup() throws XPathExpressionException, XMLStreamException, IOException {
    super.init();
    driver = BrowserManager.getWebDriver();
    LoginUtils.login(driver, automationContext, getWebAppURL());
    adminDashboard = new IOTAdminDashboard(driver);
}
Also used : IOTAdminDashboard(org.wso2.iot.integration.ui.pages.home.IOTAdminDashboard) BeforeClass(org.testng.annotations.BeforeClass)

Example 7 with AutomationContext

use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.

the class SampleEnrolmentVerificationTest method setUp.

@BeforeClass(alwaysRun = true)
public void setUp() throws XPathExpressionException, XMLStreamException, IOException {
    super.init();
    webDriver = BrowserManager.getWebDriver();
    LoginUtils.login(webDriver, automationContext, getWebAppURL());
    webDriver.get(getWebAppURL() + Constants.IOT_DEVICES_URL);
    devicesPage = new DevicesPage(webDriver);
}
Also used : DevicesPage(org.wso2.iot.integration.ui.pages.devices.DevicesPage) BeforeClass(org.testng.annotations.BeforeClass)

Example 8 with AutomationContext

use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.

the class SampleInstallationTest method serverRestartTest.

@Test(description = "Test restarting the server", groups = Constants.TestSample.SAMPLE_INSTALL, dependsOnMethods = { "sampleInstallationTest" })
public void serverRestartTest() {
    ServerConfigurationManager serverManager;
    try {
        serverManager = new ServerConfigurationManager(automationContext);
        log.info("Restart Triggered -------------------------------------------------------------------");
        serverManager.restartGracefully();
        logViewerClient.getAllRemoteSystemLogs();
        waitForRestart();
    } catch (AutomationUtilException | XPathExpressionException | MalformedURLException e) {
        log.error("Restart failed due to : " + e.getLocalizedMessage());
    } catch (RemoteException | LogViewerLogViewerException e) {
        log.error("Cannot get server log due to : " + e.getLocalizedMessage());
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) XPathExpressionException(javax.xml.xpath.XPathExpressionException) LogViewerLogViewerException(org.wso2.carbon.logging.view.stub.LogViewerLogViewerException) RemoteException(java.rmi.RemoteException) AutomationUtilException(org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException) Test(org.testng.annotations.Test)

Example 9 with AutomationContext

use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.

the class BrokerServerExtension method initiate.

@Override
public void initiate() {
    try {
        automationContext = new AutomationContext("IOT", TestUserMode.SUPER_TENANT_USER);
        if (getParameters().get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) == null) {
            getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, BROKER_PORT_OFFSET);
        }
        serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters());
        executionEnvironment = automationContext.getConfigurationValue(ContextXpathConstants.EXECUTION_ENVIRONMENT);
    } catch (XPathExpressionException e) {
        throw new RuntimeException("Error while initiating test environment", e);
    }
}
Also used : AutomationContext(org.wso2.carbon.automation.engine.context.AutomationContext) XPathExpressionException(javax.xml.xpath.XPathExpressionException)

Example 10 with AutomationContext

use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.

the class AnalyticsServerExtension method initiate.

@Override
public void initiate() {
    try {
        automationContext = new AutomationContext("IOT", TestUserMode.SUPER_TENANT_USER);
        if (getParameters().get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) == null) {
            getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, ANALYTICS_PORT_OFFSET);
        }
        serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters());
        executionEnvironment = automationContext.getConfigurationValue(ContextXpathConstants.EXECUTION_ENVIRONMENT);
    } catch (XPathExpressionException e) {
        throw new RuntimeException("Error while initiating test environment", e);
    }
}
Also used : AutomationContext(org.wso2.carbon.automation.engine.context.AutomationContext) XPathExpressionException(javax.xml.xpath.XPathExpressionException)

Aggregations

AutomationContext (org.wso2.carbon.automation.engine.context.AutomationContext)8 XPathExpressionException (javax.xml.xpath.XPathExpressionException)7 BeforeClass (org.testng.annotations.BeforeClass)7 IOTAdminDashboard (org.wso2.iot.integration.ui.pages.home.IOTAdminDashboard)4 DevicesPage (org.wso2.iot.integration.ui.pages.devices.DevicesPage)2 MalformedURLException (java.net.MalformedURLException)1 RemoteException (java.rmi.RemoteException)1 Test (org.testng.annotations.Test)1 User (org.wso2.carbon.automation.engine.context.beans.User)1 LogViewerClient (org.wso2.carbon.integration.common.admin.client.LogViewerClient)1 AutomationUtilException (org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException)1 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)1 LogViewerLogViewerException (org.wso2.carbon.logging.view.stub.LogViewerLogViewerException)1 EnrollDevicePage (org.wso2.iot.integration.ui.pages.devices.EnrollDevicePage)1 LoginPage (org.wso2.iot.integration.ui.pages.login.LoginPage)1 ConnectedCupDeviceInterface (org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceInterface)1