Make tests stable in projectexplorer package#10990
Conversation
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
|
|
||
| /** Hides context menu. */ | ||
| public void hideContextMenu() { | ||
| actionsFactory.createAction(seleniumWebDriver).moveByOffset(-1, -1).click().build().perform(); |
There was a problem hiding this comment.
What are we clicking here? Maybe would be better?
There was a problem hiding this comment.
To close context menu we have to click outside of it. So we move a mouse not far from menu and perform click.
There was a problem hiding this comment.
You can simplify this:
getAction().moveByOffset(-1, -1).click().perform();
There was a problem hiding this comment.
I was thinking of typing escape, but github took that as a tag 🤦♂️
There was a problem hiding this comment.
Unfortunately escape does n't close context menu in che.
|
|
||
| Actions action = actionsFactory.createAction(seleniumWebDriver); | ||
| action.moveToElement(waitAndGetItem(path)).contextClick().perform(); | ||
| for (int i = 1; ; i++) { |
There was a problem hiding this comment.
Could you explain what the problem was here and how the current code fixes it?
There was a problem hiding this comment.
Selecting item and invoking context menu are two separate operations.
If some item retakes focus then context menu is invoked at wrong item. It might happen because project explorer updates asynchronously and new appeared items retake focus.
So, there are two tries to invoke context menu at correct item
...ium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/ProjectExplorer.java
Show resolved
Hide resolved
| try { | ||
| waitItemIsSelected(path, REDRAW_UI_ELEMENTS_TIMEOUT_SEC); | ||
| return; | ||
| } catch (WebDriverException e) { |
There was a problem hiding this comment.
WebDriverException looks too general here. There is, for example, UnreachableBrowserException type of WebDriverException after which it doesn't make sense to repeat operation again.
TimeoutException would be enough in case of waiting for web element.
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Make tests stable in projectexplorer package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fix remarks Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko abazko@redhat.com
What does this PR do?
Makes tests stable in projectexplorer package
Release Notes
Docs PR