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 #13663

Merged
merged 2 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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