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: cover #8674 issue in selenium test #10006

Merged
merged 6 commits into from
Jun 12, 2018
Merged
Changes from 5 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 @@ -17,7 +17,6 @@
import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.TabNames.PROJECTS;

import com.google.inject.Inject;
import java.util.concurrent.ExecutionException;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.TestGroup;
import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient;
Expand All @@ -30,7 +29,6 @@
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
import org.eclipse.che.selenium.pageobject.ToastLoader;
import org.eclipse.che.selenium.pageobject.dashboard.Dashboard;
import org.eclipse.che.selenium.pageobject.dashboard.NavigationBar;
import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace;
import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage;
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails;
Expand All @@ -44,12 +42,12 @@
@Test(groups = TestGroup.OSIO)
public class CreateAndDeleteProjectsTest {

private final String WORKSPACE = generate("workspace", 4);
private static final String WORKSPACE = generate("workspace", 4);
private static final String SECOND_WEB_JAVA_SPRING_PROJECT_NAME = WEB_JAVA_SPRING + "-1";

@Inject private Dashboard dashboard;
@Inject private WorkspaceProjects workspaceProjects;
@Inject private WorkspaceDetails workspaceDetails;
@Inject private NavigationBar navigationBar;
@Inject private NewWorkspace newWorkspace;
@Inject private ProjectSourcePage projectSourcePage;
@Inject private ProjectExplorer explorer;
Expand All @@ -74,7 +72,7 @@ public void tearDown() throws Exception {
}

@Test
public void createAndDeleteProjectTest() throws ExecutionException, InterruptedException {
public void createAndDeleteProjectTest() {
dashboard.waitDashboardToolbarTitle();
dashboard.selectWorkspacesItemOnDashboard();
workspaces.clickOnAddWorkspaceBtn();
Expand All @@ -88,19 +86,27 @@ public void createAndDeleteProjectTest() throws ExecutionException, InterruptedE
projectSourcePage.selectSample(WEB_JAVA_SPRING);
projectSourcePage.selectSample(CONSOLE_JAVA_SIMPLE);
projectSourcePage.clickOnAddProjectButton();
projectSourcePage.clickOnAddOrImportProjectButton();
projectSourcePage.selectSample(WEB_JAVA_SPRING);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems we are doing it twice.
Could you, please, leave a comment in the code about why we need to import the project and to select the web java spring sample again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the second creation 'web-java-spring-1' project will be created. I will add comment about it.

projectSourcePage.clickOnAddProjectButton();
newWorkspace.clickOnCreateButtonAndOpenInIDE();

// switch to the IDE and wait for workspace is ready to use
String dashboardWindow = seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
toastLoader.waitToastLoaderAndClickStartButton();
ide.waitOpenedWorkspaceIsReadyToUse();

// wait for projects initializing
explorer.waitItem(WEB_JAVA_SPRING);
explorer.waitItem(CONSOLE_JAVA_SIMPLE);
explorer.waitItem(SECOND_WEB_JAVA_SPRING_PROJECT_NAME);
notificationsPopupPanel.waitPopupPanelsAreClosed();
mavenPluginStatusBar.waitClosingInfoPanel();
explorer.waitDefinedTypeOfFolder(CONSOLE_JAVA_SIMPLE, PROJECT_FOLDER);
explorer.waitDefinedTypeOfFolder(WEB_JAVA_SPRING, PROJECT_FOLDER);
notificationsPopupPanel.waitPopupPanelsAreClosed();

// delete projects from workspace details page
switchToWindow(dashboardWindow);
dashboard.selectWorkspacesItemOnDashboard();
workspaces.selectWorkspaceItemName(WORKSPACE);
Expand All @@ -111,6 +117,7 @@ public void createAndDeleteProjectTest() throws ExecutionException, InterruptedE
workspaceProjects.clickOnDeleteProject();
workspaceProjects.clickOnDeleteItInDialogWindow();
workspaceProjects.waitProjectIsNotPresent(WEB_JAVA_SPRING);
workspaceProjects.waitProjectIsPresent(SECOND_WEB_JAVA_SPRING_PROJECT_NAME);
workspaceProjects.openSettingsForProjectByName(CONSOLE_JAVA_SIMPLE);
workspaceProjects.clickOnDeleteProject();
workspaceProjects.clickOnDeleteItInDialogWindow();
Expand Down