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

Refactor FXIOS-10122 Revert change to accomodate ease of UI tests and re-enable bypassed UI test #22243

Merged

Conversation

ih-codes
Copy link
Collaborator

📜 Tickets

Jira ticket
Github issue

💡 Description

This is a followup PR reverts a small change and the UI test bypass from PR #22075

As well, this also reverts another UI test bypass that was added in PR #22209

Additional Info

UI tests will now only have one match (instead of multiple matches) for a XCUIElementQuery when both a normal and private tab have been opened. The behaviour revert allows firstMatch and element(boundBy:) to return the expected private tab element instead of one from the (not visible) normal tab.

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • 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)

@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Sep 27, 2024

Messages
📖 Project coverage: 32.79%
📖 Edited 3 files
📖 Created 0 files

Client.app: Coverage: 30.49

File Coverage
TabManagerImplementation.swift 50.25%

Generated by 🚫 Danger Swift against 48accd1

@ih-codes
Copy link
Collaborator Author

I will be away on Monday, so if this fix is needed, please feel free to merge (assuming no other issues need to be addressed). 🙏
cc @isabelrios @clarmso

// in the view hierarchy simultaneously. This should not change unintentionally! Check the Debug View Hierarchy.
// Note: Additional matches may also appear if the external website updates.
XCTFail("Too many matches! Has the UI hierarchy or external website unexpectedly changed?")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can do the check in one line:

XCTAssertEqual(app.links.matching(identifier: "SauceDemo.com").count, 1, "Too many matches")

// in the view hierarchy simultaneously. This should not change unintentionally! Check the Debug View Hierarchy.
XCTFail("Too many matches! Has the UI hierarchy unexpectedly changed?")
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for the use of XCTAssertEqual here.

XCTAssertEqual(pp.buttons.matching(identifier: AccessibilityIdentifiers.ZoomPageBar.zoomPageZoomLevelLabel).count, 1, "Too many matches")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can change both of these! 👍 However, I will need to multiline this specific one, or break the identifier into its own variable to not violate the swiftline line length rule.

@isabelrios
Copy link
Contributor

@dragosb01 this PR will fix the zoom and navigation tests fixing the regression causing failures in both 🤞

@@ -531,6 +531,12 @@ class NavigationTest: BaseTestCase {
private func validateExternalLink(isPrivate: Bool = false) {
navigator.openURL("ultimateqa.com/dummy-automation-websites")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we could use a custom page that we manage so that we don't relay on external sites or as less as possible.. cc @dragosb01 @mdotb-moz

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the test was created i looked over all the custom pages and none had external links.

@ih-codes ih-codes merged commit 28b1537 into main Oct 1, 2024
10 checks passed
@ih-codes ih-codes deleted the ih/FXIOS-10122-fix-select-tab-logic-for-failing-UI-test branch October 1, 2024 16:56
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.

5 participants