firefox-ios
firefox-ios copied to clipboard
Refactor FXIOS-22527 - UI Tests Added waitAndTap() for better maintenance
:scroll: Tickets
:bulb: Description
This issue is regarding the UITests at https://github.com/mozilla-mobile/firefox-ios/tree/main/firefox-ios/firefox-ios-tests/Tests Currently, we are using the below code whenever we need to wait for an element's existence and then tap on it.
mozWaitForElementToExist(app.buttons["XXX"])
app.buttons["XXX"].tap()
There are many places where we are using the above two lines. It would be beneficial in terms of maintenance to have a function like waitAndTap() within the XCUIElement. So that in the future if we need to improve the wait method or change it due to syntax changes from Apple XCUITest side, it will be a change at one place instead of changing it in each and every test.
Updated al the tests wherever wait and then tap was being used. Ran all the smoke XCUI tests locally and they passed. 1 failing test in smoke suite is not related to the change i did.
┆Issue is synchronized with this Jira Task
:pencil: Checklist
You have to check all boxes before merging
- [x] Filled in the above information (tickets numbers and description of your work)
- [x] Updated the PR name to follow our PR naming guidelines
- [x] Wrote unit tests and/or ensured the tests suite is passing
- [ ] When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
- [ ] If needed, I updated documentation / comments for complex code and public methods
- [ ] If needed, added a backport comment (example
@Mergifyio backport release/v120)
@hemche There are swiftlint errors in this PR, please check them here: https://github.com/mozilla-mobile/firefox-ios/runs/31488235539
@hemche There are swiftlint errors in this PR, please check them here: https://github.com/mozilla-mobile/firefox-ios/runs/31488235539
@isabelrios Thanks for the catch. Will update my linter settings for future PRs. Should be fixed in 5ee6d08
| Messages | |
|---|---|
| :book: | Edited 35 files |
| :book: | Created 0 files |
Generated by :no_entry_sign: Danger Swift against 107729ff30eb1e1f7dac6fd7ecc49fb9541f83ef
This 1 failing test is not part of my refactoring. This test is passing locally when i run. So, let me know if there is something else i need to fix before this PR can be reviewed. Ofcourse whenever you have time. No rush. @isabelrios @jjSDET https://github.com/mozilla-mobile/firefox-ios/pull/22528/checks?check_run_id=31561753904
This pull request has conflicts when rebasing. Could you fix it @hemche? 🙏
This pull request has conflicts when rebasing. Could you fix it @hemche? 🙏
Rebase conflicts resolved in cfc400b
Smoke tests look good: https://app.bitrise.io/app/6c06d3a40422d10f/pipelines/e12a5a6f-d309-4a7b-9fb9-a10d82445c93
L10n tests also look good. I would approve 👍🏼 this PR.