Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Selenium] Adapt selenium tests from ocpoauth package #14619

Merged
merged 8 commits into from
Sep 24, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private void obtainKeycloakPodName() throws IOException {
// obtain name of keycloak pod
String getKeycloakPodNameCommand =
format(
"get pod --namespace=%s -l app=%s --no-headers | awk '{print $1}'",
"get pod --namespace=%s -l component=%s --no-headers | awk '{print $1}'",
cheOpenshiftProject != null ? cheOpenshiftProject : DEFAULT_CHE_OPENSHIFT_PROJECT,
keycloakApp != null ? keycloakApp : DEFAULT_KEYCLOAK_APP);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public interface Locators {
String DOCUMENTATION_LINK = "//div[@che-link-title='Learn more.']/a";
String ADD_WORKSPACE_BTN = "add-item-button";
String DELETE_WORKSPACE_BTN = "delete-item-button";
String DELETE_DIALOG_BUTTON = "//md-dialog[@role='dialog']//button/span[text()='Delete']";
String DELETE_DIALOG_BUTTON = "//md-dialog[@role='dialog']//button[text()='Delete']";
String BULK_CHECKBOX = "//md-checkbox[@aria-label='Workspace list']";
String SEARCH_WORKSPACE_FIELD = "//input[@ng-placeholder='Search']";
String NO_WORKSPACE_FOUND = "//span[text()='No workspaces found.']";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void login(String username, String password) {
waitOnClose();
}

private void waitOnOpen() {
public void waitOnOpen() {
seleniumWebDriverHelper.waitAllVisibility(asList(usernameInput, passwordInput, loginButton));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void waitProjectAbsence(String projectNamePart) {
}

public void open() {
seleniumWebDriver.navigate().to(openShiftWebConsoleUrlProvider.get());
seleniumWebDriver.navigate().to(openShiftWebConsoleUrlProvider.get() + "console");
}

public void logout() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ public void checkExistedCheUserOcpProjectCreationAndRemoval() throws Exception {
// (we can't use dashboard.open() here to login with OAuth)
seleniumWebDriver.navigate().to(testDashboardUrlProvider.get());

// click on button to login with OpenShift OAuth
cheLoginPage.loginWithOpenShiftOAuth();

// login to OCP from login page with default test user credentials
openShiftLoginPage.waitOnOpen();
openShiftLoginPage.login(defaultTestUser.getName(), defaultTestUser.getPassword());

// authorize ocp-client to access OpenShift account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ public void checkNewCheUserOcpProjectCreationAndRemoval() {
// (we can't use dashboard.open() here to login with OAuth)
seleniumWebDriver.navigate().to(testDashboardUrlProvider.get());

// click on button to login with OpenShift OAuth
cheLoginPage.loginWithOpenShiftOAuth();

// login to OCP from login page with new test user credentials
openShiftLoginPage.waitOnOpen();
openShiftLoginPage.login(NEW_TEST_USER.getName(), NEW_TEST_USER.getPassword());

// authorize ocp-client to access OpenShift account
Expand Down