@@ -0,0 +1,3127 @@
+/*%0A * Copyright (c) 2012-2018 Red Hat, Inc.%0A * This program and the accompanying materials are made%0A * available under the terms of the Eclipse Public License 2.0%0A * which is available at https://www.eclipse.org/legal/epl-2.0/%0A *%0A * SPDX-License-Identifier: EPL-2.0%0A *%0A * Contributors:%0A *   Red Hat, Inc. - initial API and implementation%0A */%0Apackage org.eclipse.che.selenium.pageobject;%0A%0Aimport static java.lang.String.format;%0Aimport static org.eclipse.che.selenium.pageobject.FindReferencesConsoleTab.Locators.FIND_REFERENCES_CONSOLE_BUTTON_ID;%0Aimport static org.eclipse.che.selenium.pageobject.FindReferencesConsoleTab.Locators.FOUND_REFERENCES_XPATH;%0Aimport static org.eclipse.che.selenium.pageobject.FindReferencesConsoleTab.Locators.SELECTED_REFERENCE_XPATH;%0A%0Aimport com.google.inject.Inject;%0Aimport com.google.inject.Singleton;%0Aimport java.util.List;%0Aimport org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper;%0Aimport org.openqa.selenium.By;%0Aimport org.openqa.selenium.WebElement;%0A%0A@Singleton%0Apublic class FindReferencesConsoleTab %7B%0A  private final SeleniumWebDriverHelper seleniumWebDriverHelper;%0A%0A  @Inject%0A  private FindReferencesConsoleTab(SeleniumWebDriverHelper seleniumWebDriverHelper) %7B%0A    this.seleniumWebDriverHelper = seleniumWebDriverHelper;%0A  %7D%0A%0A  public interface Locators %7B%0A    String FIND_REFERENCES_CONSOLE_BUTTON_ID = %22gwt-debug-partButton-Find References%22;%0A    String FOUND_REFERENCES_XPATH =%0A        %22//div%5B@id='gwt-debug-LS-open-location-panel'%5D//div%5B@id='content-Tree'%5D/div%22;%0A    String SELECTED_REFERENCE_XPATH =%0A        FOUND_REFERENCES_XPATH + %22//div%5Bcontains(@class, 'selected')%5D%22;%0A  %7D%0A%0A  public void clickOnReferencesConsoleButton() %7B%0A    seleniumWebDriverHelper.waitAndClick(By.id(FIND_REFERENCES_CONSOLE_BUTTON_ID));%0A  %7D%0A%0A  public List%3CWebElement%3E getReferences() %7B%0A    return seleniumWebDriverHelper.waitVisibilityOfAllElements(By.xpath(FOUND_REFERENCES_XPATH));%0A  %7D%0A%0A  private boolean isReferenceContainsText(WebElement reference, String expectedText) %7B%0A    return seleniumWebDriverHelper.waitVisibilityAndGetText(reference).contains(expectedText);%0A  %7D%0A%0A  public void waitReferenceWithText(String expectedText) %7B%0A    seleniumWebDriverHelper.waitSuccessCondition(%0A        driver -%3E%0A            getReferences()%0A                .stream()%0A                .anyMatch(reference -%3E isReferenceContainsText(reference, expectedText)));%0A  %7D%0A%0A  public void clickOnReference(String visibleText) %7B%0A    for (WebElement reference : getReferences()) %7B%0A      if (isReferenceContainsText(reference, visibleText)) %7B%0A        seleniumWebDriverHelper.waitAndClick(reference);%0A      %7D%0A    %7D%0A%0A    String errorMessage = format(%22No reference with text %5C%22%25s%5C%22 has been detected%22, visibleText);%0A    throw new RuntimeException(errorMessage);%0A  %7D%0A%0A  public boolean isReferenceSelected(String visibleText) %7B%0A    return seleniumWebDriverHelper%0A        .waitVisibilityAndGetText(By.xpath(SELECTED_REFERENCE_XPATH))%0A        .contains(visibleText);%0A  %7D%0A%0A  public void waitReferenceSelection(String visibleText) %7B%0A    seleniumWebDriverHelper.waitSuccessCondition(driver -%3E isReferenceSelected(visibleText));%0A  %7D%0A%7D%0A

Create "FindPreferencesConsoleTab" selenium page object (#11225)