Skip to content

Commit be352a6

Browse files
Stabilizing the tests in in "intelligencecommand", "autocomplete", "projectexplorer" packages (eclipse-che#6949)
1 parent f2ee3bf commit be352a6

8 files changed

Lines changed: 24 additions & 5 deletions

File tree

selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/FindText.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private interface Locators {
6161
String CANCEL_BUTTON = "search-cancel-button";
6262
String SEARCH_BUTTON = "search-button";
6363
String FIND_INFO_PANEL = "gwt-debug-find-info-panel";
64+
String FIND_INFO_PANEL_TEXT_CONTAINER = "gwt-debug-partStackContent";
6465
String FIND_TEXT_BUTTON = "gwt-debug-partButton-Find";
6566
String OCCURRENCE = "//span[@debugfilepath = '%s']";
6667
}
@@ -77,6 +78,9 @@ private interface Locators {
7778
@FindBy(id = Locators.FIND_INFO_PANEL)
7879
WebElement findInfoPanel;
7980

81+
@FindBy(id = Locators.FIND_INFO_PANEL_TEXT_CONTAINER)
82+
WebElement findInfoPanelTextContainer;
83+
8084
@FindBy(id = Locators.FIND_TEXT_BUTTON)
8185
WebElement findTextBtn;
8286

@@ -351,7 +355,7 @@ public void waitTextIntoFileNameFilter(String expText) {
351355
/** wait the 'Find' info panel is open */
352356
public void waitFindInfoPanelIsOpen() {
353357
new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
354-
.until(ExpectedConditions.visibilityOfElementLocated(By.id(Locators.FIND_INFO_PANEL)));
358+
.until(ExpectedConditions.visibilityOf(findInfoPanel));
355359
}
356360

357361
/** wait the 'Find' info panel is closed */
@@ -414,7 +418,7 @@ public void waitExpectedTextIsNotPresentInFindInfoPanel(String expText) {
414418
* @return text from 'find usages' panel
415419
*/
416420
public String getTextFromFindInfoPanel() {
417-
return findInfoPanel.getText();
421+
return findInfoPanelTextContainer.getText();
418422
}
419423

420424
public void selectItemInFindInfoPanel(String fileName, String textToFind) {

selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/ProjectExplorer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,10 @@ public void clickOnItemInContextMenu(String item) {
562562
* @param item item form {@code SubMenuNew}
563563
*/
564564
public void clickOnNewContextMenuItem(String item) {
565-
WebElement menuItem = seleniumWebDriver.findElement(By.id(item));
566-
menuItem.click();
565+
new WebDriverWait(seleniumWebDriver, 10)
566+
.until(ExpectedConditions.visibilityOf(seleniumWebDriver.findElement(By.id(item))))
567+
.click();
568+
567569
waitContextMenuPopUpClosed();
568570
}
569571

selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/editor/autocomplete/AutocompleteProposalJavaDocTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public void setup() throws Exception {
6767
ide.open(workspace);
6868
loader.waitOnClosed();
6969
projectExplorer.waitItem(PROJECT);
70+
projectExplorer.selectItem(PROJECT);
7071
notificationsPopupPanel.waitProgressPopupPanelClose();
7172

7273
projectExplorer.quickExpandWithJavaScript();

selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/editor/autocomplete/AutocompleteWithInheritTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,15 @@ public void prepare() throws Exception {
6868
@Test
6969
public void updateDependencyWithInheritTest() {
7070
projectExplorer.waitProjectExplorer();
71-
// projectExplorer.waitItem(PROJECT_NAME);
71+
projectExplorer.waitItem(PROJECT_NAME);
7272
mavenPluginStatusBar.waitClosingInfoPanel();
73+
74+
projectExplorer.selectItem(PROJECT_NAME);
7375
projectExplorer.quickExpandWithJavaScript();
76+
7477
projectExplorer.openItemByVisibleNameInExplorer("AppController.java");
7578
editor.waitAllMarkersDisappear(ERROR_MARKER);
79+
7680
projectExplorer.openItemByVisibleNameInExplorer(EXTENDED_CLASS + ".java");
7781
editor.returnFocusInCurrentLine();
7882
editor.waitMarkerInPosition(ERROR_MARKER, 13);

selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/editor/autocomplete/InheritClassTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public void autoCompleteClassInTheSamePackage() {
7070
projectExplorer.waitItem(PROJECT_NAME);
7171
notificationsPopupPanel.waitProgressPopupPanelClose();
7272
loader.waitOnClosed();
73+
projectExplorer.selectItem(PROJECT_NAME);
7374
projectExplorer.quickExpandWithJavaScript();
7475
loader.waitOnClosed();
7576
projectExplorer.openItemByPath(COMMON_PACKAGE + "/AppController.java");

selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/projectexplorer/CheckOnValidAndInvalidClassNameTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ public void shouldNotCreateClassWithInvalidNameInRootPackage(String className) {
8888

8989
private void createJavaClassByPath(String classPath, String className) {
9090
projectExplorer.openContextMenuByPathSelectedItem(classPath);
91+
projectExplorer.waitContextMenu();
9192
projectExplorer.clickOnItemInContextMenu(TestProjectExplorerContextMenuConstants.NEW);
93+
projectExplorer.waitContextMenu();
9294
projectExplorer.clickOnNewContextMenuItem(
9395
TestProjectExplorerContextMenuConstants.SubMenuNew.JAVA_CLASS);
9496
askForValueDialog.waitNewJavaClassOpen();
@@ -99,7 +101,9 @@ private void createJavaClassByPath(String classPath, String className) {
99101

100102
private void tryToCreateJavaClassWithNotValidNameByPath(String elementPath, String className) {
101103
projectExplorer.openContextMenuByPathSelectedItem(elementPath);
104+
projectExplorer.waitContextMenu();
102105
projectExplorer.clickOnItemInContextMenu(TestProjectExplorerContextMenuConstants.NEW);
106+
projectExplorer.waitContextMenu();
103107
projectExplorer.clickOnNewContextMenuItem(
104108
TestProjectExplorerContextMenuConstants.SubMenuNew.JAVA_CLASS);
105109
askForValueDialog.waitNewJavaClassOpen();

selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/projectexplorer/CheckOnValidAndInvalidPackageNameTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public void createInvalidPackageNameInRootPackageTest(String packageName) {
114114

115115
private void createPackageByPath(String packagePath, String packageName) {
116116
projectExplorer.openContextMenuByPathSelectedItem(packagePath);
117+
projectExplorer.waitContextMenu();
117118
projectExplorer.clickOnItemInContextMenu(TestProjectExplorerContextMenuConstants.NEW);
119+
projectExplorer.waitContextMenu();
118120
projectExplorer.clickOnNewContextMenuItem(
119121
TestProjectExplorerContextMenuConstants.SubMenuNew.JAVA_PACKAGE);
120122
askForValueDialog.waitFormToOpen();

selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/projectexplorer/NavigationByKeyboardTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public void setUp() throws Exception {
8888

8989
@Test
9090
public void navigationByKeyboard() throws Exception {
91+
projectExplorer.waitProjectExplorer();
9192
projectExplorer.waitItem(PROJECT_NAME);
9293
projectExplorer.openItemByPath(PROJECT_NAME);
9394
notificationsPopupPanel.waitProgressPopupPanelClose();

0 commit comments

Comments
 (0)