diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/plainjava/RunPlainJavaProjectTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/plainjava/RunPlainJavaProjectTest.java index bbf7b65badf..dd2a00c3bb4 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/plainjava/RunPlainJavaProjectTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/plainjava/RunPlainJavaProjectTest.java @@ -24,6 +24,7 @@ import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.WORKSPACE; import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.SubMenuNew.FOLDER; import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkerLocator.ERROR; +import static org.testng.Assert.fail; import com.google.inject.Inject; import com.google.inject.name.Named; @@ -47,6 +48,7 @@ import org.eclipse.che.selenium.pageobject.intelligent.CommandsEditor; import org.eclipse.che.selenium.pageobject.intelligent.CommandsExplorer; import org.openqa.selenium.Keys; +import org.openqa.selenium.TimeoutException; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -217,7 +219,14 @@ private void importPlainJavaApp(String url, String nameApp, String typeProject) projectWizard.waitCreateProjectWizardForm(); projectWizard.selectTypeProject(typeProject); projectWizard.clickNextButton(); - projectWizard.waitExpTextInSourceFolder("src", Wizard.TypeFolder.SOURCE_FOLDER); + + try { + projectWizard.waitExpTextInSourceFolder("src", Wizard.TypeFolder.SOURCE_FOLDER); + } catch (TimeoutException ex) { + // remove try-catch block after issue has been resolved + fail("Known permanent failure https://github.com/eclipse/che/issues/11516"); + } + projectWizard.clickSaveButton(); projectWizard.waitCloseProjectConfigForm(); } diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/CodeAssistAfterMoveItemTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/CodeAssistAfterMoveItemTest.java index 3f3cb5bc3e8..f3d9a400285 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/CodeAssistAfterMoveItemTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/CodeAssistAfterMoveItemTest.java @@ -14,6 +14,7 @@ import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.DEFAULT_TIMEOUT; import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkerLocator.ERROR; import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkerLocator.WARNING; +import static org.testng.Assert.fail; import com.google.inject.Inject; import java.net.URL; @@ -30,6 +31,7 @@ import org.eclipse.che.selenium.pageobject.ProjectExplorer; import org.eclipse.che.selenium.pageobject.Refactor; import org.openqa.selenium.Keys; +import org.openqa.selenium.TimeoutException; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -110,7 +112,14 @@ public void checkCodeAssistAfterMoveItem() { editor.goToCursorPositionVisible(33, 5); editor.launchPropositionAssistPanel(); loader.waitOnClosed(); - editor.waitTextIntoFixErrorProposition("Import 'A5' (p1)"); + + try { + editor.waitTextIntoFixErrorProposition("Import 'A5' (p1)"); + } catch (TimeoutException ex) { + // remove try-catch block after issue has been resolved + fail("Known permanent failure https://github.com/eclipse/che/issues/11701"); + } + editor.enterTextIntoFixErrorPropByEnter("Import 'A5' (p1)"); editor.waitTextIntoEditor("import p1.A5;"); } diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/MoveItemsTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/MoveItemsTest.java index ed81155c522..1765e5d8e50 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/MoveItemsTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/move/MoveItemsTest.java @@ -124,8 +124,8 @@ public void checkMoveItem0() throws Exception { refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); + loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A0.java"); editor.waitTextIntoEditor(contentFromOutA); @@ -145,8 +145,8 @@ public void checkMoveItem1() throws Exception { refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); + loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A1.java"); editor.waitTextIntoEditor(contentFromOutA); @@ -176,7 +176,6 @@ public void checkMoveItem2() throws Exception { refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); @@ -189,52 +188,51 @@ public void checkMoveItem2() throws Exception { @Test public void checkMoveItem3() throws Exception { - setFieldsForTest("test3"); - setFieldsForTestB("test3"); - projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/r/A3.java"); + setFieldsForTest("test5"); + projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/A5.java"); editor.waitActive(); editor.waitTextIntoEditor(contentFromInA); - projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/fred3/B3.java"); - editor.waitActive(); - editor.waitTextIntoEditor(contentFromInB); - projectExplorer.waitAndSelectItem(pathToPackageInChePrefix + "/r/r/A3.java"); + projectExplorer.waitAndSelectItem(pathToPackageInChePrefix + "/r/A5.java"); projectExplorer.launchRefactorMoveByKeyboard(); refactor.waitMoveItemFormIsOpen(); refactor.clickOnExpandIconTree(PROJECT_NAME); refactor.clickOnExpandIconTree("/src/main/java"); - refactor.chooseDestinationForItem("p1"); + refactor.chooseDestinationForItem("r"); + refactor.waitTextInErrorMessage("A file or folder cannot be moved to its own parent."); + refactor.chooseDestinationForItem("r.r"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); - editor.waitTextIntoEditor(contentFromOutB); - projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A3.java"); + projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/r/A5.java"); editor.waitTextIntoEditor(contentFromOutA); - projectExplorer.waitDisappearItemByPath(pathToPackageInChePrefix + "/r/r/A3.java"); + projectExplorer.waitDisappearItemByPath(pathToPackageInChePrefix + "/r/A5.java"); } @Test public void checkMoveItem5() throws Exception { - setFieldsForTest("test5"); - projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/A5.java"); + setFieldsForTest("test3"); + setFieldsForTestB("test3"); + projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/r/A3.java"); editor.waitActive(); editor.waitTextIntoEditor(contentFromInA); - projectExplorer.waitAndSelectItem(pathToPackageInChePrefix + "/r/A5.java"); + projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/fred3/B3.java"); + editor.waitActive(); + editor.waitTextIntoEditor(contentFromInB); + projectExplorer.waitAndSelectItem(pathToPackageInChePrefix + "/r/r/A3.java"); projectExplorer.launchRefactorMoveByKeyboard(); refactor.waitMoveItemFormIsOpen(); refactor.clickOnExpandIconTree(PROJECT_NAME); refactor.clickOnExpandIconTree("/src/main/java"); - refactor.chooseDestinationForItem("r"); - refactor.waitTextInErrorMessage("A file or folder cannot be moved to its own parent."); - refactor.chooseDestinationForItem("r.r"); + refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); + loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); - projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/r/A5.java"); + editor.waitTextIntoEditor(contentFromOutB); + projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A3.java"); editor.waitTextIntoEditor(contentFromOutA); - projectExplorer.waitDisappearItemByPath(pathToPackageInChePrefix + "/r/A5.java"); + projectExplorer.waitDisappearItemByPath(pathToPackageInChePrefix + "/r/r/A3.java"); } @Test @@ -250,8 +248,8 @@ public void checkMoveItem6() throws Exception { refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); + loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A6.java"); editor.waitTextIntoEditor(contentFromOutA); @@ -276,8 +274,8 @@ public void checkMoveItem7() throws Exception { refactor.chooseDestinationForItem("(default package)"); refactor.waitTextInMoveForm("Java references will not be updated."); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); + loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/A7.java"); editor.waitTextIntoEditor(contentFromOutA); @@ -297,8 +295,8 @@ public void checkMoveItem8() throws Exception { refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); + loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/Klass.java"); editor.waitTextIntoEditor(contentFromOutA); @@ -319,8 +317,8 @@ public void checkMoveItem9() throws Exception { refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); - loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); + loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A9.java"); editor.waitTextIntoEditor(contentFromOutA); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/packages/RenamePackageTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/packages/RenamePackageTest.java index 7a2557701f2..1f7cd06386b 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/packages/RenamePackageTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/refactor/packages/RenamePackageTest.java @@ -11,6 +11,8 @@ */ package org.eclipse.che.selenium.refactor.packages; +import static org.testng.Assert.fail; + import com.google.inject.Inject; import java.net.URL; import java.nio.file.Paths; @@ -27,6 +29,7 @@ import org.eclipse.che.selenium.pageobject.Menu; import org.eclipse.che.selenium.pageobject.ProjectExplorer; import org.eclipse.che.selenium.pageobject.Refactor; +import org.openqa.selenium.TimeoutException; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -158,12 +161,12 @@ public class RenamePackageTest { + "}\n"; private static String TEST10_HIERAR_OUT = - "package your.pack;\n" + "package yo_ur.pack;\n" + "\n" + "public class C {\n" + "/*\n" - + "your.pack\n" - + "your.pack.subpack\n" + + "yo_ur.pack\n" + + "yo_ur.pack.subpack\n" + "m_y.pack2\n" + "m_y.pack2.subpack\n" + "not.m_y.pack.subpack\n" @@ -373,6 +376,14 @@ public void checkTest3() { projectExplorer.waitItem(PROJECT_NAME + "/src/main/java/main"); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/main/Textfile.txt"); editor.waitTextIntoEditor(TEST12_RENAME_WITH_RESOURCE_OUT); + + try { + projectExplorer.waitDisappearItemByPath(PROJECT_NAME + "/src/main/java/mine"); + } catch (TimeoutException ex) { + // remove try-catch block after issue has been resolved + fail("Known permanent failure https://github.com/eclipse/che/issues/11713"); + } + editor.closeFileByNameWithSaving("Textfile.txt"); } @@ -567,6 +578,7 @@ public void checkTestHierarchical9_1() { projectExplorer.waitItem(PROJECT_NAME + "/src/main/java/your"); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/your/MyA.java"); editor.waitTextIntoEditor(TEST9_HIERAR_OUT); + projectExplorer.waitDisappearItemByPath(PROJECT_NAME + "/src/main/java/my"); editor.closeFileByNameWithSaving("MyA"); } @@ -585,14 +597,22 @@ public void checkTestHierarchical10() { refactor.setAndWaitStateUpdateNonJavaFilesCheckbox(false); refactor.setAndWaitStateCommentsAndStringsCheckbox(true); loader.waitOnClosed(); - refactor.clearFieldAndSendKeys("your.pack"); - refactor.waitTextIntoNewNameField("your.pack"); + refactor.clearFieldAndSendKeys("yo_ur.pack"); + refactor.waitTextIntoNewNameField("yo_ur.pack"); loader.waitOnClosed(); refactor.clickOkButtonRefactorForm(); loader.waitOnClosed(); refactor.waitRenamePackageFormIsClosed(); - projectExplorer.waitItem(PROJECT_NAME + "/src/main/java/your/pack"); + projectExplorer.waitItem(PROJECT_NAME + "/src/main/java/yo_ur/pack"); editor.waitTextIntoEditor(TEST10_HIERAR_OUT); + + try { + projectExplorer.waitDisappearItemByPath(PROJECT_NAME + "/src/main/java/m_y"); + } catch (TimeoutException ex) { + // remove try-catch block after issue has been resolved + fail("Known permanent failure https://github.com/eclipse/che/issues/11713"); + } + editor.closeFileByNameWithSaving("C"); } @@ -621,6 +641,14 @@ public void checkTestDisableImport11() { refactor.waitRenamePackageFormIsClosed(); projectExplorer.waitItem(PROJECT_NAME + "/src/main/java/your_/pack"); editor.waitTextIntoEditor(TEST11_DISABLED_IMPORT_OUT); + + try { + projectExplorer.waitDisappearItemByPath(PROJECT_NAME + "/src/main/java/my_"); + } catch (TimeoutException ex) { + // remove try-catch block after issue has been resolved + fail("Known permanent failure https://github.com/eclipse/che/issues/11713"); + } + editor.closeFileByNameWithSaving("C"); }