Add safe send_keys methods to FunctionalTest. Stop implicit wait. #4546
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Ready for review
Description of Changes
Add methods to more reliably send key events to elements. This seems
to have fixed one of the most pernicious flaky tests,
test_journalist_interface_ui_with_modal, allowing removal of the
hideous retry hack that could make the tests take minutes longer.
Use them to replace other usages of send_keys, including some that
have definitely been flaky, though not as bad as that one.
Also simplify the safe_click* methods, as WebDriverWait.until returns
the result of the wait condition, and some of the other element
manipulations were unnecessary, given the expected conditions.
Stop setting a default implicit wait in the web drivers. If an element
might not be present, we should use explicit waits instead of adding
this potential delay to every element-locating call. There's also
ample Selenium folklore that mixing implicit and explicit waits leads
to unpredictable timeouts and possible bad behavior.
Rename _alert_wait and _alert_accept.
Double the timeout in alert_wait. This helped with some timeouts
waiting for confirmation popups.
Fixes #4541.
Testing
Run
make -C securedrop test
. Or just wait for the CI results here.Deployment
This only involves the functional tests.
Checklist
If you made changes to the server application code:
make lint
) and tests (make -C securedrop test
) pass in the development containerIf you made non-trivial code changes: