Skip to content

Commit

Permalink
[Selenium] Adapt selenium tests from ocpoauth package (#13663)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkorikSergey committed Jul 2, 2019
1 parent 47e59c2 commit b2dff13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient;
import org.eclipse.che.selenium.core.provider.TestDashboardUrlProvider;
import org.eclipse.che.selenium.core.user.DefaultTestUser;
import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper;
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
import org.eclipse.che.selenium.core.workspace.TestWorkspaceProvider;
import org.eclipse.che.selenium.pageobject.Ide;
import org.eclipse.che.selenium.pageobject.ToastLoader;
import org.eclipse.che.selenium.pageobject.dashboard.Dashboard;
import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace;
import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack;
Expand All @@ -36,6 +32,7 @@
import org.eclipse.che.selenium.pageobject.ocp.OpenShiftProjectCatalogPage;
import org.eclipse.che.selenium.pageobject.site.CheLoginPage;
import org.eclipse.che.selenium.pageobject.site.FirstBrokerProfilePage;
import org.eclipse.che.selenium.pageobject.theia.TheiaIde;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -88,13 +85,10 @@ public class LoginExistedUserWithOpenShiftOAuthTest {
@Inject private Workspaces workspaces;
@Inject private NewWorkspace newWorkspace;
@Inject private TestWorkspaceServiceClient defaultUserWorkspaceServiceClient;
@Inject private ToastLoader toastLoader;
@Inject private Ide ide;
@Inject private SeleniumWebDriverHelper seleniumWebDriverHelper;
@Inject private OpenShiftProjectCatalogPage openShiftProjectCatalogPage;
@Inject private SeleniumWebDriver seleniumWebDriver;
@Inject private TestDashboardUrlProvider testDashboardUrlProvider;
@Inject private TestWorkspaceProvider testWorkspaceProvider;
@Inject private TheiaIde theiaIde;

// it is used to read workspace logs on test failure
private TestWorkspace testWorkspace;
Expand Down Expand Up @@ -140,14 +134,13 @@ public void checkExistedCheUserOcpProjectCreationAndRemoval() throws Exception {
dashboard.selectWorkspacesItemOnDashboard();
workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();
newWorkspace.selectStack(Stack.JAVA_MAVEN);
newWorkspace.typeWorkspaceName(WORKSPACE_NAME);
newWorkspace.selectStack(Stack.JAVA_MAVEN);
newWorkspace.clickOnCreateButtonAndOpenInIDE();

// switch to the Eclipse Che IDE and wait until workspace is ready to use
seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
toastLoader.waitToastLoaderAndClickStartButton();
ide.waitOpenedWorkspaceIsReadyToUse();
// switch to the IDE and wait for workspace is ready to use
theiaIde.switchToIdeFrame();
theiaIde.waitTheiaIde();

// go to OCP and check if there is a project with name equals to test workspace id
openShiftProjectCatalogPage.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
import org.eclipse.che.selenium.core.client.TestUserServiceClient;
import org.eclipse.che.selenium.core.provider.TestDashboardUrlProvider;
import org.eclipse.che.selenium.core.user.TestUser;
import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper;
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
import org.eclipse.che.selenium.core.workspace.TestWorkspaceProvider;
import org.eclipse.che.selenium.pageobject.Ide;
import org.eclipse.che.selenium.pageobject.ToastLoader;
import org.eclipse.che.selenium.pageobject.dashboard.Dashboard;
import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace;
import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack;
Expand All @@ -37,6 +33,7 @@
import org.eclipse.che.selenium.pageobject.ocp.OpenShiftProjectCatalogPage;
import org.eclipse.che.selenium.pageobject.site.CheLoginPage;
import org.eclipse.che.selenium.pageobject.site.FirstBrokerProfilePage;
import org.eclipse.che.selenium.pageobject.theia.TheiaIde;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -81,14 +78,11 @@ public class LoginNewUserWithOpenShiftOAuthTest {
@Inject private Dashboard dashboard;
@Inject private Workspaces workspaces;
@Inject private NewWorkspace newWorkspace;
@Inject private ToastLoader toastLoader;
@Inject private Ide ide;
@Inject private SeleniumWebDriverHelper seleniumWebDriverHelper;
@Inject private TestUserServiceClient testUserServiceClient;
@Inject private OpenShiftProjectCatalogPage openShiftProjectCatalogPage;
@Inject private SeleniumWebDriver seleniumWebDriver;
@Inject private TestDashboardUrlProvider testDashboardUrlProvider;
@Inject private TestWorkspaceProvider testWorkspaceProvider;
@Inject private TheiaIde theiaIde;

// it is used to read workspace logs on test failure
private TestWorkspace testWorkspace;
Expand Down Expand Up @@ -126,14 +120,13 @@ public void checkNewCheUserOcpProjectCreationAndRemoval() {
dashboard.selectWorkspacesItemOnDashboard();
workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();
newWorkspace.selectStack(Stack.JAVA_MAVEN);
newWorkspace.typeWorkspaceName(WORKSPACE_NAME);
newWorkspace.selectStack(Stack.JAVA_MAVEN);
newWorkspace.clickOnCreateButtonAndOpenInIDE();

// switch to the Eclipse Che IDE and wait until workspace is ready to use
seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
toastLoader.waitToastLoaderAndClickStartButton();
ide.waitOpenedWorkspaceIsReadyToUse();
// switch to the IDE and wait for workspace is ready to use
theiaIde.switchToIdeFrame();
theiaIde.waitTheiaIde();

// go to OCP and check if there is a project with name starts from "workspace"
openShiftProjectCatalogPage.open();
Expand Down

0 comments on commit b2dff13

Please sign in to comment.