From 08542dc93621052cf1a240653383503960e4fc12 Mon Sep 17 00:00:00 2001 From: Skorik Sergey Date: Tue, 2 Jul 2019 11:24:55 +0300 Subject: [PATCH] check Theia IDE after workspace started in ocpoauth tests --- ...oginExistedUserWithOpenShiftOAuthTest.java | 19 ++++++------------- .../LoginNewUserWithOpenShiftOAuthTest.java | 19 ++++++------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java index 2a836ee8a05..0a762665558 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java @@ -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; @@ -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; @@ -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; @@ -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(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java index a9db2c143b8..9668309f07b 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java @@ -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; @@ -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; @@ -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; @@ -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();