Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robot tests: wait until overlay is closed. #90

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

mauritsvanrees
Copy link
Member

Use the correct selector to check for the overlay: it is no longer div.overlay, but div.modal-wrapper.
Wait only 8 seconds instead of 60 for this check to be true.
Also use 'Wait For Then Click Element' for good measure.

This is an attempt to make robot tests more stable
I still sometimes see a test fail, becase the popup/modal/overlay is still open after clicking a button. This might fix it.

Update: no it does not. But the updated checks at least make it clear that a popup is still open, which is the reason why some other expected text is not visible.

Sample from "Capture Page Screenshot" for a failed test:

Screenshot 2022-06-09 at 00 07 03

This looks exactly like I expect it to, except that the modal should have closed because the button has been clicked.

Use the correct selector to check for the overlay: it is no longer `div.overlay`, but `div.modal-wrapper`.
Wait only 8 seconds instead of 60 for this check to be true.
Also use 'Wait For Then Click Element' for good measure.

This is an attempt to make robot tests more stable
I still sometimes see a test fail, becase the popup/modal/overlay is still open after clicking a button.  This might fix it.

Update: no it does not.  But the updated checks at least make it clear that a popup is still open, which is the reason why some other expected text is not visible.
@mauritsvanrees mauritsvanrees requested a review from fredvd June 8, 2022 22:09
@mister-roboto

This comment was marked as resolved.

@mauritsvanrees mauritsvanrees requested a review from petschki June 8, 2022 22:09
@mauritsvanrees
Copy link
Member Author

BTW: at this moment the Jenkins front page is completely green! Well, except for the Python 3.10 jobs.

@mauritsvanrees
Copy link
Member Author

I do wonder if https://pypi.org/project/robotframework-seleniumtestability/ would help here. Fred found that via Asko.

@petschki
Copy link
Member

petschki commented Jun 9, 2022

This package sounds promising!

@mauritsvanrees
Copy link
Member Author

Python 3.8 PR robot tests fail with:

"Keyword 'Page should not contain element' failed after retrying for 8 seconds. The last error was: Page should not have contained element 'css=div.modal-wrapper'."

So there is a failure, but at least it is a clearer one. I call success and merge this.
To be continued.

@mauritsvanrees mauritsvanrees merged commit 43cbb53 into master Jun 9, 2022
@mauritsvanrees mauritsvanrees deleted the fix-robottests-2 branch June 9, 2022 07:14
@fredvd
Copy link
Member

fredvd commented Jun 9, 2022

@mauritsvanrees @petschki Asko created a pull request here yesterday: plone/plone.app.robotframework#137

I checked the testability package locally, but it is not a magic wand

  • as Asko notes in that PR he sees local javascript errors, I saw some webdriver errors
  • there is no real output to see 'when' the testability actually saves you/does something
  • Asko suggested a variables way to enable testabilty per robot file which we have to test, otherwise it's 'always on' because you have to register the library in p.a.robotframeworks 'main' robot file.

I created to 2 local branches of p.a.robotframework and Products.CMFPlone to test this plugin later with the pull request job on jenkins to see if it helps, but we're already 'almost' to green again with the robottests. I'll continue with that later today, got side tracked with other work.

In this particular test it is interesting to see if the xhr request/post from the modal maybe prevents it from closing in time and if the testability plugin would catch this and pause the robot commands for a while.

@petschki
Copy link
Member

petschki commented Jun 9, 2022

keep in mind, you have to pin the extra packages in buildout.coredev as asko mentioned ...

@fredvd
Copy link
Member

fredvd commented Jun 9, 2022

Yes I'm aware of those, I was wondering yesterday first where the furl package was coming from when we also tested the minor/patch updates of selenium itself. but it was this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants