Skip to content

Make tests stable in projectexplorer package#10990

Merged
tolusha merged 2 commits into5730_java_ls_pocfrom
fixProjectExplorer
Sep 3, 2018
Merged

Make tests stable in projectexplorer package#10990
tolusha merged 2 commits into5730_java_ls_pocfrom
fixProjectExplorer

Conversation

@tolusha
Copy link
Copy Markdown
Contributor

@tolusha tolusha commented Aug 30, 2018

Signed-off-by: Anatoliy Bazko abazko@redhat.com

What does this PR do?

Makes tests stable in projectexplorer package

Release Notes

Docs PR

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

/** Hides context menu. */
public void hideContextMenu() {
actionsFactory.createAction(seleniumWebDriver).moveByOffset(-1, -1).click().build().perform();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we clicking here? Maybe would be better?

Copy link
Copy Markdown
Contributor Author

@tolusha tolusha Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To close context menu we have to click outside of it. So we move a mouse not far from menu and perform click.

Copy link
Copy Markdown
Contributor

@Ohrimenko1988 Ohrimenko1988 Aug 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify this:

getAction().moveByOffset(-1, -1).click().perform();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of typing escape, but github took that as a tag 🤦‍♂️

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain what the problem was here and how the current code fixes it?

Copy link
Copy Markdown
Contributor Author

@tolusha tolusha Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@benoitf benoitf added target/branch Indicates that a PR will be merged into a branch other than master. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Aug 30, 2018
try {
waitItemIsSelected(path, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
return;
} catch (WebDriverException e) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@tolusha tolusha merged commit 30094d2 into 5730_java_ls_poc Sep 3, 2018
@tolusha tolusha deleted the fixProjectExplorer branch September 3, 2018 08:36
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Sep 3, 2018
tolusha added a commit that referenced this pull request Sep 5, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Sep 13, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Sep 20, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Sep 26, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 1, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 5, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 12, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 16, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 17, 2018
* Make tests stable in projectexplorer package

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>

* Fix remarks

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 17, 2018
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 17, 2018
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 17, 2018
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
tsmaeder pushed a commit that referenced this pull request Oct 17, 2018
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/branch Indicates that a PR will be merged into a branch other than master.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants