Complement unstable parts of the selenium tests with info about known issues (#7934)

* add Asserts to tests with depended issues
6.19.x
Maxim Musienko 2017-12-19 10:51:09 +02:00 committed by GitHub
parent 52599d66a8
commit 2e3cb47a6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 7 deletions

View File

@ -12,6 +12,7 @@ package org.eclipse.che.selenium.debugger;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.REDRAW_UI_ELEMENTS_TIMEOUT_SEC;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import com.google.inject.Inject;
import java.net.URL;
@ -33,6 +34,7 @@ import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
import org.eclipse.che.selenium.pageobject.debug.DebugPanel;
import org.eclipse.che.selenium.pageobject.debug.NodeJsDebugConfig;
import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
@ -127,7 +129,12 @@ public class NodeJsDebugTest {
debugPanel.clickOnButton(DebugPanel.DebuggerActionButtons.EVALUATE_EXPRESSIONS);
debugPanel.typeEvaluateExpression("c.length");
debugPanel.clickEvaluateBtn();
debugPanel.waitExpectedResultInEvaluateExpression("19");
try {
debugPanel.waitExpectedResultInEvaluateExpression("19");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/4720", ex);
}
debugPanel.clickCloseEvaluateBtn();
}
}

View File

@ -84,7 +84,12 @@ public class DirectUrlFactoryWithRootFolder {
"tslint.json",
"typings.json",
"wallaby.js");
testFactoryWithRootFolder.authenticateAndOpen();
try {
testFactoryWithRootFolder.authenticateAndOpen();
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7555", ex);
}
projectExplorer.waitProjectExplorer();
projectExplorer.waitItem(EXPECTED_PROJECT);
notificationsPopupPanel.waitProgressPopupPanelClose();

View File

@ -12,6 +12,7 @@ package org.eclipse.che.selenium.factory;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.UPDATING_PROJECT_TIMEOUT_SEC;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import com.google.common.collect.ImmutableList;
import com.google.inject.Inject;
@ -27,6 +28,7 @@ import org.eclipse.che.selenium.pageobject.Events;
import org.eclipse.che.selenium.pageobject.Ide;
import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
import org.openqa.selenium.TimeoutException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@ -64,7 +66,12 @@ public class DirectUrlFactoryWithSpecificBranch {
@Test
public void factoryWithDirectUrlWithSpecificBranch() throws Exception {
testFactoryWithSpecificBranch.authenticateAndOpen();
try {
testFactoryWithSpecificBranch.authenticateAndOpen();
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7555", ex);
}
projectExplorer.waitProjectExplorer();
notificationsPopupPanel.waitProgressPopupPanelClose();
events.clickEventLogBtn();

View File

@ -16,6 +16,7 @@ import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.T
import static org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole.JunitMethodsState.FAILED;
import static org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole.JunitMethodsState.PASSED;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import com.google.inject.Inject;
import java.net.URL;
@ -38,6 +39,7 @@ import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
import org.eclipse.che.selenium.pageobject.intelligent.CommandsPalette;
import org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole;
import org.openqa.selenium.TimeoutException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@ -105,7 +107,7 @@ public class JavaTestPluginTestNgTest {
}
@Test
public void shouldExecuteTestClassSuccessfully() throws InterruptedException {
public void shouldExecuteTestClassSuccessfully() {
// given
projectExplorer.quickRevealToItemWithJavaScript(PATH_TO_ANOTHER_TEST_CLASS);
projectExplorer.openItemByPath(PATH_TO_TEST_CLASS);
@ -127,7 +129,7 @@ public class JavaTestPluginTestNgTest {
}
@Test(priority = 1)
public void shouldExecuteTestMethodsSuccessfully() throws InterruptedException {
public void shouldExecuteTestMethodsSuccessfully() {
// given
projectExplorer.openItemByPath(PATH_TO_ANOTHER_TEST_CLASS);
@ -140,7 +142,12 @@ public class JavaTestPluginTestNgTest {
assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(PASSED).size() == 1);
editor.goToCursorPositionVisible(30, 17);
menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM);
pluginConsole.waitMethodMarkedAsFailed("shouldFailOfAppAnother");
try {
pluginConsole.waitMethodMarkedAsFailed("shouldFailOfAppAnother");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7338", ex);
}
assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(FAILED).size() == 1);
String testErrorMessage = pluginConsole.getTestErrorMessage();
assertTrue(
@ -151,7 +158,7 @@ public class JavaTestPluginTestNgTest {
}
@Test(priority = 2)
public void shouldExecuteAlltests() throws InterruptedException {
public void shouldExecuteAlltests() {
// given
projectExplorer.openItemByPath(PATH_TO_ANOTHER_TEST_CLASS);