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

Playwright improve test stability #6338

Merged

Conversation

emilghittasv
Copy link
Collaborator

  • Creating a new helper function in utilities.py that gives the possibility of re-calling a function which failed in the process due to a 502 error. This function relies on catching a warning emitted by the handle_502_error function inside conftest.py.
  • Fix locators issues due to the transition from selectize to tom-select.
  • Extended the checkbox_interaction() function in basepage.py to handle ElementHandles and implemented a retry mechanism if the element check() or uncheck() has failed due to some reason.
  • Modified the click() function in basepage.py to:
  1. Accept and interact with ElementHandles.
  2. Implement a retry mechanism based on a given expected_locator or expected_url after the click action. If the expected_locator or expected_url condition is not fulfilled after the click action we are forcing a re-click on the target element.
  3. Wait for networkidle before attempting to click on the element.
  • Updated the page objects, tests and flows for which flakiness occurred in the past to use the newly implemented click() and function re-call mechanism.
  • Added a helper function in basepage.py which moves the mouse to a given location.
…bility of re-calling a function which failed due to a 502 error. This function relies on catching a warning emitted by the handle_502_error function inside conftest.py.

- Fix locators issues due to the transition from selectize to tom-select.
- Extended the checkbox_interaction() function in basepage.py to handle ElementHandles and implemented a retry mechanism if the element check() or uncheck() has failed due to some reason.
- Modified the click() function in basepage.py to:
1. Accept and interact with ElementHandles.
2. Implement a retry mechanism based on a given expected_locator or expected_url after the click action. If the expected_locator or expected_url condition is not fulfilled after the click action we are forcing a re-click on the target element.
3. Wait for networkidle before attempting to click on the element.
- Updated the page objects, tests and flows for which flakiness occurred in the past to use the newly implemented click() and function re-call mechanism.
- Added a helper function in basepage.py which moves the mouse to a given location.
@emilghittasv emilghittasv merged commit 0e07070 into mozilla:main Nov 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants