Skip to content

Commit

Permalink
Selenium: change the way to click the plus panel button in the Consol…
Browse files Browse the repository at this point in the history
…es page object (#8024)

* changed way of clicking on button in clickOnPlusMenuButton() method in Consoles selenium page object
  • Loading branch information
Sergey Skorik committed Dec 22, 2017
1 parent 30c931c commit 458dd4f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Expand Up @@ -27,6 +27,7 @@
import com.google.inject.Singleton;
import java.util.List;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.action.ActionsFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
Expand Down Expand Up @@ -80,13 +81,16 @@ public interface CommandsGoal {
}

protected final SeleniumWebDriver seleniumWebDriver;
private final ActionsFactory actionsFactory;
private final Loader loader;
private static final String CONSOLE_PANEL_DRUGGER_CSS = "div.gwt-SplitLayoutPanel-VDragger";

@Inject
public Consoles(SeleniumWebDriver seleniumWebDriver, Loader loader) {
public Consoles(
SeleniumWebDriver seleniumWebDriver, Loader loader, ActionsFactory actionsFactory) {
this.seleniumWebDriver = seleniumWebDriver;
this.loader = loader;
this.actionsFactory = actionsFactory;
redrawDriverWait = new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
loadPageDriverWait = new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC);
updateProjDriverWait = new WebDriverWait(seleniumWebDriver, UPDATING_PROJECT_TIMEOUT_SEC);
Expand Down Expand Up @@ -160,7 +164,8 @@ public void clickOnServerItemInContextMenu() {
}

public void clickOnPlusMenuButton() {
redrawDriverWait.until(visibilityOf(plusMenuBtn)).click();
redrawDriverWait.until(visibilityOf(plusMenuBtn));
actionsFactory.createAction(seleniumWebDriver).moveToElement(plusMenuBtn).click().perform();
}

public void clickOnHideInternalServers() {
Expand Down
Expand Up @@ -18,6 +18,7 @@
import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.action.ActionsFactory;
import org.eclipse.che.selenium.pageobject.Consoles;
import org.eclipse.che.selenium.pageobject.Loader;
import org.openqa.selenium.By;
Expand Down Expand Up @@ -66,8 +67,9 @@ public class JavaTestRunnerPluginConsole extends Consoles {
private WebElement resultTreeMainForm;

@Inject
public JavaTestRunnerPluginConsole(SeleniumWebDriver seleniumWebDriver, Loader loader) {
super(seleniumWebDriver, loader);
public JavaTestRunnerPluginConsole(
SeleniumWebDriver seleniumWebDriver, Loader loader, ActionsFactory actionsFactory) {
super(seleniumWebDriver, loader, actionsFactory);
PageFactory.initElements(seleniumWebDriver, this);
}

Expand Down
Expand Up @@ -21,7 +21,6 @@

import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
import java.util.Map;
import org.eclipse.che.commons.lang.NameGenerator;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient;
Expand All @@ -44,7 +43,7 @@
/** @author Skoryk Serhii */
public class WorkspaceDetailsComposeTest {
private static final String WORKSPACE = NameGenerator.generate("java-mysql", 4);
private static final Map<String, String> EXPECTED_VARIABLES =
private static final ImmutableMap<String, String> EXPECTED_VARIABLES =
ImmutableMap.of(
"MYSQL_DATABASE", "petclinic",
"MYSQL_PASSWORD", "password",
Expand Down
Expand Up @@ -10,6 +10,7 @@
*/
package org.eclipse.che.selenium.dashboard;

import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOADER_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.project.ProjectTemplates.MAVEN_SPRING;
import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER;
import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.CONSOLE_JAVA_SIMPLE;
Expand All @@ -28,7 +29,6 @@
import com.google.inject.Inject;
import java.net.URL;
import java.nio.file.Paths;
import java.util.Map;
import org.eclipse.che.commons.lang.NameGenerator;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.client.TestProjectServiceClient;
Expand Down Expand Up @@ -56,7 +56,7 @@
/** @author Skoryk Serhii */
public class WorkspaceDetailsSingleMachineTest {
private static final String PROJECT_NAME = NameGenerator.generate("project", 4);
private static final Map<String, Boolean> EXPECTED_INSTALLERS =
private static final ImmutableMap<String, Boolean> EXPECTED_INSTALLERS =
ImmutableMap.<String, Boolean>builder()
.put("C# language server", false)
.put("Exec", false)
Expand Down Expand Up @@ -221,6 +221,7 @@ public void startWorkspaceAndCheckChanges() {
workspaceDetails.clickOpenInIdeWsBtn();
seleniumWebDriver.switchFromDashboardIframeToIde();
projectExplorer.waitProjectExplorer();
terminal.waitTerminalTab(LOADER_TIMEOUT_SEC);
projectExplorer.waitItem(PROJECT_NAME);
projectExplorer.waitFolderDefinedTypeOfFolderByPath(PROJECT_NAME, PROJECT_FOLDER);
projectExplorer.waitFolderDefinedTypeOfFolderByPath(CONSOLE_JAVA_SIMPLE, PROJECT_FOLDER);
Expand Down

0 comments on commit 458dd4f

Please sign in to comment.