Skip to content

Commit

Permalink
Change steps for increasing stability tests (#10736)
Browse files Browse the repository at this point in the history
* change steps in the tests forc increase stability according to issue 10728
  • Loading branch information
musienko-maxim authored Aug 14, 2018
1 parent 7c37b74 commit 324a7f6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,9 @@ public void clearAllMessages() {
}
waitEmptyEventsPanel();
}

public void clickOnEventPanelAndWaitMessage(String message) {
clickEventLogBtn();
waitExpectedMessage(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,16 @@ public void checkFactoryAcceptingWithPerUserPolicy() throws Exception {

seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
projectExplorer.waitProjectExplorer();
notificationsPopupPanel.waitExpectedMessageOnProgressPanelAndClosed("Project Spring imported");

String workspaceUrl = seleniumWebDriver.getCurrentUrl();
try {
notificationsPopupPanel.waitExpectedMessageOnProgressPanelAndClosed(
"Project Spring imported");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/10728");
}

String workspaceUrl = seleniumWebDriver.getCurrentUrl();
// accept factory
testFactory.open(seleniumWebDriver);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ public void shouldExecuteTestClassSuccessfully() {
menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM);

// then
notifications.waitExpectedMessageOnProgressPanelAndClosed("Test runner executed successfully.");
try {
notifications.waitExpectedMessageOnProgressPanelAndClosed(
"Test runner executed successfully.");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/10728");
}
pluginConsole.waitMethodMarkedAsPassed("shouldSuccessOfAppOne");
pluginConsole.waitMethodMarkedAsFailed("shouldFailOfAppOne");
assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(PASSED).size() == 1);
Expand All @@ -138,17 +144,27 @@ public void shouldExecuteTestMethodsSuccessfully() {
editor.waitActive();
editor.goToCursorPositionVisible(26, 17);
menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM);
notifications.waitExpectedMessageOnProgressPanelAndClosed("Test runner executed successfully.");

try {
notifications.waitExpectedMessageOnProgressPanelAndClosed(
"Test runner executed successfully.");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/10728");
}

pluginConsole.waitMethodMarkedAsPassed("shouldSuccessOfAppAnother");
assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(PASSED).size() == 1);
editor.goToCursorPositionVisible(31, 17);
menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM);

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(
Expand All @@ -167,13 +183,22 @@ public void shouldExecuteAlltests() {
editor.waitActive();
editor.goToCursorPositionVisible(26, 17);
menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM);
notifications.waitExpectedMessageOnProgressPanelAndClosed("Test runner executed successfully.");

try {
notifications.waitExpectedMessageOnProgressPanelAndClosed(
"Test runner executed successfully.");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/10728");
}

try {
pluginConsole.waitMethodMarkedAsPassed("shouldSuccessOfAppAnother");
} 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(PASSED).size() == 1);
editor.goToCursorPositionVisible(31, 17);
menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM);
Expand Down

0 comments on commit 324a7f6

Please sign in to comment.