use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.
the class IOTServerExtension method initiate.
@Override
public void initiate() throws AutomationFrameworkException {
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, "0");
}
serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters());
executionEnvironment = automationContext.getConfigurationValue(ContextXpathConstants.EXECUTION_ENVIRONMENT);
} catch (XPathExpressionException e) {
handleException("Error while initiating test environment", e);
}
}
use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.
the class SampleEnrollmentTest method setup.
@BeforeClass(alwaysRun = true)
public void setup() throws XPathExpressionException, XMLStreamException, IOException {
super.init();
driver = BrowserManager.getWebDriver();
LoginUtils.login(driver, automationContext, getWebAppURL());
IOTAdminDashboard adminDashboard = new IOTAdminDashboard(driver);
EnrollDevicePage enrollDevicePage = adminDashboard.enrollNewDevice();
connectedCupDeviceTypeViewPage = enrollDevicePage.gotoConnectedCupDeviceTypeViewPage();
}
use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.
the class LoginUtils method login.
/**
* This method is used to login as admin.
*
* @param driver The selenium web driver
* @param automationContext Test Automation context
* @param webAppURL The server url
*/
public static void login(WebDriver driver, AutomationContext automationContext, String webAppURL) throws IOException, XPathExpressionException {
driver.get(webAppURL + Constants.IOT_LOGIN_PATH);
LoginPage test = new LoginPage(driver);
test.loginAsAdmin(automationContext.getSuperTenant().getTenantAdmin().getUserName(), automationContext.getSuperTenant().getTenantAdmin().getPassword());
}
use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.
the class AnalyticsServerExtension method initiate.
@Override
public void initiate() throws AutomationFrameworkException {
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, "2");
}
serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters());
executionEnvironment = automationContext.getConfigurationValue(ContextXpathConstants.EXECUTION_ENVIRONMENT);
} catch (XPathExpressionException e) {
handleException("Error while initiating test environment", e);
}
}
use of org.wso2.carbon.automation.engine.context.AutomationContext in project product-iots by wso2.
the class PolicyTest method setup.
@BeforeClass(alwaysRun = true)
public void setup() throws Exception {
super.init();
driver = BrowserManager.getWebDriver();
LoginUtils.login(driver, automationContext, getWebAppURL());
adminDashboard = new IOTAdminDashboard(driver);
}
Aggregations