From 452715468cb803a512151fff8c8dfae8f20f0111 Mon Sep 17 00:00:00 2001 From: Sergey Skorik Date: Fri, 29 Dec 2017 14:50:54 +0200 Subject: [PATCH] Selenium: increased timeout for checking that a workspace status is RUNNING (#8096) --- .../pageobject/dashboard/workspaces/WorkspaceDetails.java | 5 +++++ .../eclipse/che/selenium/dashboard/RenameWorkspaceTest.java | 5 +++-- .../workspaces/ProjectStateAfterRenameWorkspaceTest.java | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/workspaces/WorkspaceDetails.java b/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/workspaces/WorkspaceDetails.java index 53d3f4c57d7..a82c7554b1c 100644 --- a/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/workspaces/WorkspaceDetails.java +++ b/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/workspaces/WorkspaceDetails.java @@ -128,6 +128,11 @@ public void checkStateOfWorkspace(StateWorkspace stateWorkspace) { .until(textToBePresentInElement(workspaceState, stateWorkspace.getStatus())); } + public void checkStateOfWorkspace(StateWorkspace stateWorkspace, int timeout) { + new WebDriverWait(seleniumWebDriver, timeout) + .until(textToBePresentInElement(workspaceState, stateWorkspace.getStatus())); + } + /** click on 'RUN' button in 'Workspace Information' */ public void clickOnRunWorkspace() { new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC) diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/RenameWorkspaceTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/RenameWorkspaceTest.java index 92ba28765d1..7a52cae8a57 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/RenameWorkspaceTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/RenameWorkspaceTest.java @@ -11,7 +11,8 @@ package org.eclipse.che.selenium.dashboard; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace.STARTING; +import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.EXPECTED_MESS_IN_CONSOLE_SEC; +import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace.RUNNING; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace.STOPPING; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.TabNames.OVERVIEW; import static org.testng.Assert.assertFalse; @@ -102,7 +103,7 @@ private void renameWorkspace(String name) { private void saveAndWaitWorkspaceRestarted() { workspaceDetails.clickOnSaveChangesBtn(); workspaceDetails.checkStateOfWorkspace(STOPPING); - workspaceDetails.checkStateOfWorkspace(STARTING); + workspaceDetails.checkStateOfWorkspace(RUNNING, EXPECTED_MESS_IN_CONSOLE_SEC); dashboard.waitNotificationMessage("Workspace updated"); dashboard.waitNotificationIsClosed(); } diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/ProjectStateAfterRenameWorkspaceTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/ProjectStateAfterRenameWorkspaceTest.java index 6a718ef7b51..37f787b3753 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/ProjectStateAfterRenameWorkspaceTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/ProjectStateAfterRenameWorkspaceTest.java @@ -10,6 +10,7 @@ */ package org.eclipse.che.selenium.workspaces; +import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.EXPECTED_MESS_IN_CONSOLE_SEC; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace.RUNNING; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace.STOPPING; import static org.testng.Assert.fail; @@ -97,7 +98,7 @@ public void checkProjectAfterRenameWs() throws Exception { workspaceOverview.enterNameWorkspace(WORKSPACE_NEW_NAME); workspaceDetails.clickOnSaveChangesBtn(); workspaceDetails.checkStateOfWorkspace(STOPPING); - workspaceDetails.checkStateOfWorkspace(RUNNING); + workspaceDetails.checkStateOfWorkspace(RUNNING, EXPECTED_MESS_IN_CONSOLE_SEC); workspaceOverview.checkNameWorkspace(WORKSPACE_NEW_NAME); // open the IDE, check state of the project