org.wso2.carbon.automation.extensions.selenium.BrowserManager Java Examples

The following examples show how to use org.wso2.carbon.automation.extensions.selenium.BrowserManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EventSimulatorTestCase.java    From product-cep with Apache License 2.0 6 votes vote down vote up
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = BrowserManager.getWebDriver();
    String loggedInSessionCookie = getSessionCookie();

    eventStreamManagerAdminServiceClient = configurationUtil.getEventStreamManagerAdminServiceClient(
            backendURL, loggedInSessionCookie);

    // Deploying the stream definition required to run the simulator
    String streamDefinitionAsString = getJSONArtifactConfiguration("eventsimulatorFiles",
            "TempStream_1.0.0.json");

    eventStreamManagerAdminServiceClient.addEventStreamAsString(streamDefinitionAsString);
    Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(), 1);
}
 
Example #2
Source File: ESPasswordRecovery.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    currentUserName = userInfo.getUserName();
    currentUserPwd = userInfo.getPassword();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    wait = new WebDriverWait(driver, MAX_WAIT_TIME);

    driver.get(baseUrl + STORE_URL);
    driver.findElement(By.id("btn-register")).click();
    driver.findElement(By.id("reg-username")).clear();
    driver.findElement(By.id("reg-username")).sendKeys(USER);
    driver.findElement(By.id("reg-password")).clear();
    driver.findElement(By.id("reg-password")).sendKeys(PASSWORD);
    driver.findElement(By.id("reg-password2")).clear();
    driver.findElement(By.id("reg-password2")).sendKeys(PASSWORD);
    driver.findElement(By.name("reg-email")).clear();
    driver.findElement(By.name("reg-email")).sendKeys(EMAIL);
    driver.findElement(By.name("reg-first-name")).clear();
    driver.findElement(By.name("reg-first-name")).sendKeys(FIRST_NAME);
    driver.findElement(By.name("reg-last-name")).clear();
    driver.findElement(By.name("reg-last-name")).sendKeys(LAST_NAME);
    driver.findElement(By.id("registrationSubmit")).click();
}
 
Example #3
Source File: ESStoreSearchGadgetListTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    adminUserName = userInfo.getUserName();
    adminUserPwd = userInfo.getPassword();
    acceptNextAlert = true;
    wait = new WebDriverWait(driver, MAX_DRIVER_WAIT_TIME_SEC);
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME,
            TestUserMode.SUPER_TENANT_ADMIN);
    adminUserName = automationContext.getSuperTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getSuperTenant().getTenantAdmin().getPassword();
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName,
            adminUserPwd);
    driver.get(baseUrl + "/" + STORE_APP);
}
 
Example #4
Source File: ESSelfSignUpTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    currentUserName = userInfo.getUserName();
    currentUserPwd = userInfo.getPassword();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    wait = new WebDriverWait(driver, MAX_WAIT_TIME);
    driver.get(baseUrl + MANAGEMENT_CONSOLE_URL);
    driver.findElement(By.id("txtUserName")).clear();
    driver.findElement(By.id("txtUserName")).sendKeys(currentUserName);
    driver.findElement(By.id("txtPassword")).clear();
    driver.findElement(By.id("txtPassword")).sendKeys(currentUserPwd);
    driver.findElement(By.xpath("//input[@value='Sign-in']")).click();

}
 
Example #5
Source File: ESPublisherAddEditAssetTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init(userMode);
    currentUserName = userInfo.getUserName().split("@")[0];
    currentUserPwd = userInfo.getPassword();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.SUPER_TENANT_ADMIN);
    adminUserName = automationContext.getSuperTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getSuperTenant().getTenantAdmin().getPassword();
    normalUserName = automationContext.getSuperTenant().getTenantUser(USER1).getUserName().split("@")[0];
    String normalUserPwd = automationContext.getSuperTenant().getTenantUser(USER1).getPassword();
    resourcePath = GADGET_REGISTRY_BASE_PATH + normalUserName + "/" + ASSET_NAME + "/" + ASSET_VERSION_2;
    String backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName, adminUserPwd);
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, currentUserName, currentUserPwd);
}
 
Example #6
Source File: ESPublisherTenantAddEditAssetTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init(userMode);
    currentUserName = userInfo.getUserName();
    currentUserPwd = userInfo.getPassword();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getStorePublisherUrl();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.TENANT_ADMIN);
    adminUserName = automationContext.getContextTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getContextTenant().getTenantAdmin().getPassword();
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName, adminUserPwd);
    this.providerName = currentUserName.split("@")[0];
    this.resourcePath = GADGET_REGISTRY_BASE_PATH + providerName + "/" + assetName + "/" + ASSET_VERSION;
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, currentUserName, currentUserPwd);
}
 
Example #7
Source File: ESPublisherTenantNotificationTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init(userMode);
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    currentUserName = userInfo.getUserName();
    currentUserPwd = userInfo.getPassword();
    baseUrl = getStorePublisherUrl();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.TENANT_ADMIN);
    adminUserName = automationContext.getContextTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getContextTenant().getTenantAdmin().getPassword();
    String resourceLocation = getResourceLocation();
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName, adminUserPwd);
    providerName = currentUserName.split("@")[0];
    resourcePath = GADGET_REGISTRY_BASE_PATH + providerName + "/" + assetName + "/" + VERSION;
    LCNotificationSubject += resourcePath;
    updateNotificationSubject += resourcePath;
    smtpPropertyLocation = resourceLocation + SMTP_PROPERTY_FILE;

    //Update user profiles through Admin console
    ESUtil.loginToAdminConsole(driver, baseUrl, adminUserName, adminUserPwd);
    ESUtil.setupUserProfile(driver, baseUrl, currentUserName, FIRST_NAME, LAST_NAME, EMAIL);
    //login to publisher & add a new gadget
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, currentUserName, currentUserPwd);
    AssetUtil.addNewAsset(driver, baseUrl, ASSET_TYPE, assetName, VERSION, "", "", "");
}
 
Example #8
Source File: ESPublisherSubscriptionTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true, enabled = true)
public void setUp() throws Exception {
    super.init(userMode);
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    currentUserName = userInfo.getUserName().split("@")[0];
    currentUserPwd = userInfo.getPassword();
    baseUrl = getWebAppURL();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME,
            TestUserMode.SUPER_TENANT_ADMIN);
    adminUserName = automationContext.getSuperTenant().getTenantAdmin().getUserName().split("@")[0];
    adminUserPwd = automationContext.getSuperTenant().getTenantAdmin().getPassword();
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName,
            adminUserPwd);
    resourcePath = GADGET_REGISTRY_BASE_PATH + currentUserName + "/" + assetName + "/" + ASSET_VERSION;

    ESUtil.login(driver, baseUrl, PUBLISHER_APP, currentUserName, currentUserPwd);
    ESUtil.loginToAdminConsole(driver, baseUrl, adminUserName, adminUserPwd);
}
 
Example #9
Source File: ESPublisherTenantSubscriptionTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init(userMode);
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    currentUserName = userInfo.getUserName();
    currentUserPwd = userInfo.getPassword();
    baseUrl = getStorePublisherUrl();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.TENANT_ADMIN);
    adminUserName = automationContext.getContextTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getContextTenant().getTenantAdmin().getPassword();
    providerName = currentUserName.split("@")[0];
    resourcePath = GADGET_REGISTRY_BASE_PATH + this.providerName + "/" + this.assetName + "/" + ASSET_VERSION;
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    String resourceLocation = getResourceLocation();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName, adminUserPwd);
    smtpPropertyLocation = resourceLocation + SMTP_PROPERTY_FILE;

    ESUtil.login(driver, baseUrl, PUBLISHER_APP, currentUserName, currentUserPwd);
    ESUtil.loginToAdminConsole(driver, baseUrl, adminUserName, adminUserPwd);
}
 
Example #10
Source File: ESPublisherNotificationTestCase.java    From product-es with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init(userMode);
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    currentUserName = userInfo.getUserName().split("@")[0];
    currentUserPwd = userInfo.getPassword();
    baseUrl = getWebAppURL();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.SUPER_TENANT_ADMIN);
    adminUserName = automationContext.getSuperTenant().getTenantAdmin().getUserName().split("@")[0];
    adminUserPwd = automationContext.getSuperTenant().getTenantAdmin().getPassword();
    String resourceLocation = getResourceLocation();
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName, adminUserPwd);
    resourcePath = GADGET_REGISTRY_BASE_PATH + currentUserName + "/" + assetName + "/" + VERSION;
    LCNotificationSubject += resourcePath;
    updateNotificationSubject += resourcePath;
    smtpPropertyLocation = resourceLocation + SMTP_PROPERTY_FILE;

    //Update user profiles through Admin console
    ESUtil.loginToAdminConsole(driver, baseUrl, adminUserName, adminUserPwd);
    ESUtil.setupUserProfile(driver, baseUrl, currentUserName, FIRST_NAME, LAST_NAME, EMAIL);
    //login to publisher & add a new gadget
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, currentUserName, currentUserPwd);
    AssetUtil.addNewAsset(driver, baseUrl, ASSET_TYPE, assetName, VERSION, "", "", "");
}
 
Example #11
Source File: ESStoreRatingsTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    wait = new WebDriverWait(driver, MAX_DRIVER_WAIT_TIME_SEC);
    baseUrl = getWebAppURL();
    driver.get(baseUrl + "/" + STORE_APP);
}
 
Example #12
Source File: ESPublisherAssetCaramelPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
      super.init();
      driver = BrowserManager.getWebDriver();
      baseUrl = getWebAppURL();
      ESUtil.login(driver, baseUrl, webApp);
}
 
Example #13
Source File: ESPublisherAssetNewPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, userInfo.getUserName(), userInfo.getPassword());
}
 
Example #14
Source File: ESPublisherOverridenGlobalPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, userInfo.getUserName(), userInfo.getPassword());
}
 
Example #15
Source File: ESPublisherAssetOverrideExistingPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, userInfo.getUserName(), userInfo.getPassword());
}
 
Example #16
Source File: ESPublisherAssetOverrideRendererTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, userInfo.getUserName(), userInfo.getPassword());
    resourcePath = "/_system/governance/servicesx/" + currentUserName + "/" + ASSET_NAME + "/" + VERSION;
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.SUPER_TENANT_ADMIN);
    adminUserName = automationContext.getSuperTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getSuperTenant().getTenantAdmin().getPassword();
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName, adminUserPwd);
    driver.get(baseUrl + "/publisher/assets/servicex/list");
    driver.findElement(By.id("Addservicex")).click();
    driver.findElement(By.name("overview_name")).clear();
    driver.findElement(By.name("overview_name")).sendKeys(ASSET_NAME);
    driver.findElement(By.name("overview_version")).clear();
    driver.findElement(By.name("overview_version")).sendKeys(VERSION);
    driver.findElement(By.name("overview_scopes")).clear();
    driver.findElement(By.name("overview_scopes")).sendKeys(SCOPES);
    driver.findElement(By.name("overview_types")).clear();
    driver.findElement(By.name("overview_types")).sendKeys(TYPES);

    assertTrue(isElementPresent(driver, By.name("images_thumbnail")));
    driver.findElement(By.name("images_thumbnail")).sendKeys(FrameworkPathUtil.getReportLocation()
                                                             +"/../src/test/resources/images/thumbnail.jpg");

    driver.findElement(By.id("btn-create-asset")).click();
    driver.findElementPoll(By.linkText(ASSET_NAME), MAX_POLL_COUNT);
    driver.findElement(By.linkText(ASSET_NAME)).click();
    lifecycleUrl = driver.getCurrentUrl().replace("details", "lifecycle");
}
 
Example #17
Source File: ESPublisherNewGlobalPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
      super.init();
      driver = BrowserManager.getWebDriver();
      baseUrl = getWebAppURL();
      ESUtil.login(driver, baseUrl, webApp);
}
 
Example #18
Source File: ESPublisherAssetCaramelPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, userInfo.getUserName(), userInfo.getPassword());
}
 
Example #19
Source File: ESPublisherAddedAssetTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, userInfo.getUserName(), userInfo.getPassword());
}
 
Example #20
Source File: ESStoreOverriddenGlobalPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    driver.get(baseUrl + "/" + STORE_APP);
}
 
Example #21
Source File: ESPublisherAssetOverrideExistingPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
      super.init();
      driver = BrowserManager.getWebDriver();
      baseUrl = getWebAppURL();
      ESUtil.login(driver, baseUrl, webApp);
}
 
Example #22
Source File: ESRBACAsStoreUserTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init("superTenant", "storeUser1");

    currentUserName = userInfo.getUserName();
    currentUserPwd = userInfo.getPassword();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
}
 
Example #23
Source File: ESPublishToStore.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    driver.get(baseUrl + PUBLISHER_GADGET_LIST_PAGE);
    providerName = userInfo.getUserName();
    resourcePath = GADGET_REGISTRY_BASE_PATH + providerName + "/" + ASSET_NAME + "/" + ASSET_VERSION;
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.SUPER_TENANT_ADMIN);
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL,userInfo.getUserName(),
            userInfo.getPassword());
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, userInfo.getUserName(), userInfo.getPassword());
}
 
Example #24
Source File: ESRegisterUserTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.SUPER_TENANT_ADMIN);
    backendURL = automationContext.getContextUrls().getBackEndUrl();
    userManagementClient = new UserManagementClient(backendURL, userInfo.getUserName(), userInfo.getPassword());

    adminUserName = automationContext.getSuperTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getSuperTenant().getTenantAdmin().getPassword();
}
 
Example #25
Source File: ESPublisherAssetNewPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
      super.init();
      driver = BrowserManager.getWebDriver();
      baseUrl = getWebAppURL();
      ESUtil.login(driver, baseUrl, webApp);
}
 
Example #26
Source File: ESXSSTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    baseHttpsUrl = getWebAppURLHttps();
}
 
Example #27
Source File: ESStoreNewGlobalPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    driver.get(baseUrl + "/" + STORE_APP);
}
 
Example #28
Source File: ESPublisherAssetOverrideRendererTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
      super.init();
      driver = BrowserManager.getWebDriver();
      baseUrl = getWebAppURL();
      ESUtil.login(driver, baseUrl, webApp);
}
 
Example #29
Source File: ESPublisherListPageSortTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init(userMode);
    currentUserName = userInfo.getUserName().split("@")[0];
    currentUserPwd = userInfo.getPassword();
    driver = new ESWebDriver(BrowserManager.getWebDriver());
    baseUrl = getWebAppURL();
    AutomationContext automationContext = new AutomationContext(PRODUCT_GROUP_NAME, TestUserMode.SUPER_TENANT_ADMIN);
    adminUserName = automationContext.getSuperTenant().getTenantAdmin().getUserName();
    adminUserPwd = automationContext.getSuperTenant().getTenantAdmin().getPassword();
    normalUserName = automationContext.getSuperTenant().getTenantUser(USER1).getUserName().split("@")[0];
    String normalUserPwd = automationContext.getSuperTenant().getTenantUser(USER1).getPassword();
    resourcePath = GADGET_REGISTRY_BASE_PATH + normalUserName + "/" + ASSET_NAME + "/" + VERSION_2;
    String backendURL = automationContext.getContextUrls().getBackEndUrl();
    resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL, adminUserName, adminUserPwd);
    if (currentUserName.equals(adminUserName)) {
        ESUtil.login(driver, baseUrl, PUBLISHER_APP, normalUserName, normalUserPwd);
        AssetUtil.addNewAsset(driver, baseUrl, ASSET_TYPE, ASSET_NAME, VERSION_2, "", "", "");
        if (isAlertPresent(driver)) {
            String alert = closeAlertAndGetItsText(driver, true);
            LOG.warn(alert + ": modal box appeared");
        }
        driver.get(baseUrl + PUBLISHER_LOGOUT_URL);
        driver.get(driver.getCurrentUrl());
    }
    ESUtil.login(driver, baseUrl, PUBLISHER_APP, currentUserName, currentUserPwd);
}
 
Example #30
Source File: ESStoreNewGlobalPageTestCase.java    From product-es with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
      super.init();
      driver = BrowserManager.getWebDriver();
      baseUrl = getWebAppURL();
      ESUtil.login(driver, baseUrl, webApp);
}