-
-
Notifications
You must be signed in to change notification settings - Fork 228
[tests] Made selenium tests resilient to failures #990
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
Conversation
1259e7e to
3be9dc9
Compare
3be9dc9 to
1989ad6
Compare
openwisp_controller/tests/utils.py
Outdated
| self.web_driver.refresh() | ||
| except UnexpectedAlertPresentException: | ||
| self.web_driver.switch_to_alert().accept() | ||
| self.web_driver.switch_to_alert.accept() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why twice?
| from django.contrib.staticfiles.testing import StaticLiveServerTestCase | ||
| from django.test import tag | ||
| from django.urls import reverse | ||
| import ipdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
7aa1b0b to
c957448
Compare
c957448 to
990bf08
Compare
28fddb8 to
15ed708
Compare
.github/workflows/ci.yml
Outdated
| pip install -U pip wheel setuptools | ||
| pip install -U -r requirements-test.txt | ||
| pip install -U -e . | ||
| pip install -UI --no-deps https://github.com/openwisp/openwisp-utils/tarball/browser-logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Remove this before merging
| pip install -UI --no-deps https://github.com/openwisp/openwisp-utils/tarball/browser-logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this now.
openwisp_controller/tests/utils.py
Outdated
| self._assert_loading_overlay_hidden() | ||
|
|
||
| def _assert_loading_overlay_hidden(self): | ||
| self.wait_for_invisibility(By.CSS_SELECTOR, '#loading-overlay') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we want to centralize this in openwisp-utils as I added something similar in openwisp-monitoring, but I had to hide the overlay explicitly as doing this was not enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please make
./runtests.pyconsistent with the firmware-upgrader module (allow running./runtests.pyto run everything). - Make sure selenium tests are skipped in SAMPLE_APP=1
8c010a8 to
2ea4fe5
Compare
2ea4fe5 to
87497fd
Compare
| with self.subTest('Alert should be displayed after making changes'): | ||
| # The WebDriver automatically accepts the | ||
| # beforeunload confirmation dialog. To verify the message, | ||
| # we log it to the console and check its content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # we log it to the console and check its content. | |
| # we log it to the console and check its content. | |
| # | |
| # our own JS code sets e.returnValue when triggered | |
| # so we just need to ensure it's set as expected |
ee1b3a5 to
fa4d7e9
Compare
705c03d to
1e4e8dc
Compare
1e4e8dc to
ffef8c1
Compare
9938eb0 to
f70dcab
Compare
f70dcab to
6795f36
Compare
|
The random failures that we observed in the following builds were due to port collision in geckodriver.
There's already a PR in selenium which addresses this issue |
0df75f8 to
930d094
Compare
Checklist