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: fix unexpected fail of the NavigateToFileTest selenium test #8206

Merged
merged 1 commit into from
Jan 9, 2018
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 @@ -11,6 +11,7 @@
package org.eclipse.che.selenium.pageobject;

import static java.lang.String.format;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.ELEMENT_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOAD_PAGE_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.REDRAW_UI_ELEMENTS_TIMEOUT_SEC;
import static org.openqa.selenium.Keys.ALT;
Expand All @@ -30,6 +31,7 @@
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;

/** Created by aleksandr shmaraev on 12.12.14. */
Expand Down Expand Up @@ -122,11 +124,16 @@ public void waitFileNamePopUp() {
* @param text a text that should be into list
*/
public boolean isFilenameSuggested(String text) {
WebElement webElement =
new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC)
.until(visibilityOf(suggestionPanel));
return suggestionPanel.getText().contains(text);
}

return webElement.getText().contains(text);
public void waitSuggestedPanelIsDisplayed() {
new WebDriverWait(seleniumWebDriver, ELEMENT_TIMEOUT_SEC)
.until(
(ExpectedCondition<Boolean>)
webDriver -> {
return suggestionPanel.isDisplayed();
});
}

public String getText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private void launchNavigateToFileAndCheckResults(
// in tabs)
String openedFileNameInTheTab = openedFileWithExtension.replace(".java", "");
launchNavigateToFileFromUIAndTypeValue(navigatingValue);
navigateToFile.waitSuggestedPanelIsDisplayed();
waitExpectedItemsInNavigateToFileDropdawn(expectedItems);
navigateToFile.selectFileByName(dropdownVerificationPath);
editor.waitActive();
Expand Down