From 7df27da42259b993db75f23023d2bfae6dff8dcb Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Wed, 17 Oct 2018 17:59:57 +0300 Subject: [PATCH 1/2] Selenium: Add the 'try-catch' to the 'GitPullTest' --- .../org/eclipse/che/selenium/git/GitPullTest.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/git/GitPullTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/git/GitPullTest.java index f1c53ec18df..3184dbb5285 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/git/GitPullTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/git/GitPullTest.java @@ -15,6 +15,7 @@ import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Git.Remotes.PULL; import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Git.Remotes.REMOTES_TOP; import static org.eclipse.che.selenium.pageobject.Wizard.TypeProject.BLANK; +import static org.testng.Assert.fail; import com.google.inject.Inject; import com.google.inject.name.Named; @@ -31,6 +32,7 @@ import org.eclipse.che.selenium.pageobject.Menu; import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel; import org.eclipse.che.selenium.pageobject.ProjectExplorer; +import org.openqa.selenium.TimeoutException; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -92,7 +94,7 @@ public void pullTest() throws Exception { git.waitGitStatusBarWithMess( String.format("Successfully pulled from %s", testRepo.getHtmlUrl())); - checkPullAfterUpdatingContent(readmeTxtFileName, currentTimeInMillis); + checkPullAfterUpdatingContent(jsFileName, currentTimeInMillis); checkPullAfterUpdatingContent(htmlFileName, currentTimeInMillis); checkPullAfterUpdatingContent(readmeTxtFileName, currentTimeInMillis); @@ -105,7 +107,7 @@ public void pullTest() throws Exception { readmeTxtFileName, String.format("/%s/%s/%s", PROJECT_NAME, folderWithPlainFilesPath, readmeTxtFileName)); checkPullAfterRemovingContent( - "README.md", + readmeMdFileName, String.format("/%s/%s/%s", PROJECT_NAME, folderWithPlainFilesPath, readmeMdFileName)); } @@ -129,7 +131,14 @@ private void checkPullAfterUpdatingContent(String tabNameOpenedFile, String expe private void checkPullAfterRemovingContent( String tabNameOpenedFile, String pathToItemInProjectExplorer) { - editor.waitTabIsNotPresent(tabNameOpenedFile); + + try { + editor.waitTabIsNotPresent(tabNameOpenedFile); + } catch (TimeoutException ex) { + // remove try-catch block after issue has been resolved + fail("Known random failure https://github.com/eclipse/che/issues/11648"); + } + projectExplorer.waitLibrariesAreNotPresent(pathToItemInProjectExplorer); } } From ca6106b61335b0fa836ed0949f32b883f64f424e Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Thu, 18 Oct 2018 16:31:23 +0300 Subject: [PATCH 2/2] Selenium: Delete the try-catch from test method in the 'GolangFileEditingTest' --- .../languageserver/GolangFileEditingTest.java | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/languageserver/GolangFileEditingTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/languageserver/GolangFileEditingTest.java index ea3874996bf..6a56e203bd5 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/languageserver/GolangFileEditingTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/languageserver/GolangFileEditingTest.java @@ -231,17 +231,10 @@ public void checkFindReferencesFeature() { // check element in the editor editor.goToPosition(19, 5); menu.runCommand(ASSISTANT, FIND_REFERENCES); - - // it is a workaround, need to fix after resolve the issue - try { - findReferencesConsoleTab.waitAllReferencesWithText( - "/desktop-go-simple/towers.go\nFrom:23:71 To:23:76"); - findReferencesConsoleTab.doubleClickOnReference("From:23:71 To:23:76"); - } catch (TimeoutException ex) { - fail( - "Need to delete 'try/catch' and change values of the parameters, because the known issue https://github.com/eclipse/che/issues/10698 is resolved"); - } - + findReferencesConsoleTab.waitAllReferencesWithText( + "/desktop-go-simple/towers.go\nFrom:24:72 To:24:77"); + findReferencesConsoleTab.doubleClickOnReference("From:24:72 To:24:77"); + editor.waitSpecifiedValueForLineAndChar(24, 77); editor.typeTextIntoEditor(ARROW_LEFT.toString()); editor.waitSpecifiedValueForLineAndChar(24, 72); editor.waitTextElementsActiveLine("count"); @@ -249,13 +242,7 @@ public void checkFindReferencesFeature() { // check the references expected text editor.goToPosition(19, 5); menu.runCommand(ASSISTANT, FIND_REFERENCES); - - try { - findReferencesConsoleTab.waitAllReferencesWithText(REFERENCES_EXPECTED_TEXT); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/10698", ex); - } + findReferencesConsoleTab.waitAllReferencesWithText(REFERENCES_EXPECTED_TEXT); } @Test(priority = 1)