Skip to content

Commit

Permalink
Selenium: Add/Delete 'try-catch' according to known issues (#12473)
Browse files Browse the repository at this point in the history
  • Loading branch information
artaleks9 authored Jan 19, 2019
1 parent cba874f commit eaf20df
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
package org.eclipse.che.selenium.languageserver;

import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR;
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Assistant.ASSISTANT;
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Assistant.GO_TO_SYMBOL;
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.CREATE_PROJECT;
Expand All @@ -21,6 +22,7 @@
import static org.eclipse.che.selenium.pageobject.Wizard.SamplesName.NODEJS_HELLO_WORLD;
import static org.openqa.selenium.Keys.BACK_SPACE;
import static org.openqa.selenium.Keys.ENTER;
import static org.testng.Assert.fail;

import com.google.inject.Inject;
import org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project;
Expand All @@ -38,10 +40,12 @@
import org.eclipse.che.selenium.pageobject.PullRequestPanel;
import org.eclipse.che.selenium.pageobject.Wizard;
import org.openqa.selenium.Keys;
import org.openqa.selenium.TimeoutException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/** @author Skoryk Serhii */
@Test(groups = UNDER_REPAIR)
public class JsonFileEditingTest {

private static final String PROJECT_NAME = "nodejs-hello-world";
Expand Down Expand Up @@ -97,7 +101,13 @@ public void checkLanguageServerInitialized() {

// check JSON language server initialized
consoles.selectProcessByTabName("dev-machine");
consoles.waitExpectedTextIntoConsole(LS_INIT_MESSAGE);

try {
consoles.waitExpectedTextIntoConsole(LS_INIT_MESSAGE);
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known permanent failure https://github.com/eclipse/che/issues/12472");
}
}

@Test(priority = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
package org.eclipse.che.selenium.plainjava;

import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR;
import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandsDefaultNames.JAVA_NAME;
import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandsGoals.RUN_GOAL;
import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandsTypes.JAVA_TYPE;
Expand All @@ -25,7 +24,6 @@
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;
Expand All @@ -49,12 +47,10 @@
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;

/** @author Aleksandr Shmaraev */
@Test(groups = UNDER_REPAIR)
public class RunPlainJavaProjectTest {
private static final String PROJECT_NAME = "run-plain-java-project";
private static final String NEW_PACKAGE = "base.test";
Expand Down Expand Up @@ -119,11 +115,11 @@ public void checkRunPlainJavaProject() {
// create the instance of the library
projectExplorer.openItemByPath(PROJECT_NAME + "/src/com/company/nba/MainClass.java");
codenvyEditor.waitActive();
codenvyEditor.setCursorToLine(19);
codenvyEditor.setCursorToLine(20);
codenvyEditor.typeTextIntoEditor(Keys.TAB.toString());
codenvyEditor.typeTextIntoEditor("Mockito mockito = new Mockito();");
codenvyEditor.waitTextIntoEditor("Mockito mockito = new Mockito();");
codenvyEditor.waitMarkerInPosition(ERROR, 19);
codenvyEditor.waitMarkerInPosition(ERROR, 20);

// check code assist
codenvyEditor.launchPropositionAssistPanel();
Expand All @@ -135,11 +131,11 @@ public void checkRunPlainJavaProject() {
// create the instance of new Java class
projectExplorer.openItemByPath(PROJECT_NAME + "/src/com/company/nba/MainClass.java");
codenvyEditor.waitActive();
codenvyEditor.setCursorToLine(22);
codenvyEditor.setCursorToLine(23);
codenvyEditor.typeTextIntoEditor(Keys.TAB.toString());
codenvyEditor.typeTextIntoEditor("A a = new A();");
codenvyEditor.waitTextIntoEditor("A a = new A();");
codenvyEditor.waitMarkerInPosition(ERROR, 22);
codenvyEditor.waitMarkerInPosition(ERROR, 23);

// check the code assist
codenvyEditor.launchPropositionAssistPanel();
Expand Down Expand Up @@ -221,14 +217,7 @@ private void importPlainJavaApp(String url, String nameApp, String typeProject)
projectWizard.waitCreateProjectWizardForm();
projectWizard.selectTypeProject(typeProject);
projectWizard.clickNextButton();

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.waitExpTextInSourceFolder("src", Wizard.TypeFolder.SOURCE_FOLDER);
projectWizard.clickSaveButton();
projectWizard.waitCloseProjectConfigForm();
}
Expand Down

0 comments on commit eaf20df

Please sign in to comment.