Skip to content

Commit

Permalink
Fix MTE-3777 - testStrictTrackingProtection test (#22848)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosb01 authored Nov 1, 2024
1 parent 3f01a8f commit 2febccb
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ class TrackingProtectionTests: BaseTestCase {
mozWaitForElementToExist(app.buttons.element(matching: .button, identifier: reloadButton), timeout: 10)
app.buttons.element(matching: .button, identifier: reloadButton).press(forDuration: 3)
if label == "Without Tracking Protection" {
mozWaitForElementToExist(app.otherElements[reloadWithWithoutProtectionButton], timeout: 5)
XCTAssertEqual(
"Reload Without Tracking Protection",
app.otherElements.element(matching: .any, identifier: reloadWithWithoutProtectionButton).label
)
} else {
mozWaitForElementToExist(app.otherElements[reloadWithWithoutProtectionButton], timeout: 5)
XCTAssertEqual(
"Reload With Tracking Protection",
app.otherElements.element(
Expand Down Expand Up @@ -251,35 +253,39 @@ class TrackingProtectionTests: BaseTestCase {
waitUntilPageLoad()

if checkTrackingProtectionOn() {
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection])
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection], timeout: 5)
XCTAssertEqual(
app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection].label,
secureTrackingProtectionOnLabel
)
navigator.nowAt(BrowserTab)
reloadWithWithoutTrackingProtection(label: "Without Tracking Protection")
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection], timeout: 5)
XCTAssertEqual(
app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection].label,
secureTrackingProtectionOffLabel
)
reloadWithWithoutTrackingProtection(label: "With Tracking Protection")
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection], timeout: 5)
XCTAssertEqual(
app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection].label,
secureTrackingProtectionOnLabel
)
} else {
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection])
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection], timeout: 5)
XCTAssertEqual(
app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection].label,
secureTrackingProtectionOffLabel
)
navigator.nowAt(BrowserTab)
reloadWithWithoutTrackingProtection(label: "With Tracking Protection")
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection], timeout: 5)
XCTAssertEqual(
app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection].label,
secureTrackingProtectionOnLabel
)
reloadWithWithoutTrackingProtection(label: "Without Tracking Protection")
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection], timeout: 5)
XCTAssertEqual(
app.buttons[AccessibilityIdentifiers.Toolbar.trackingProtection].label,
secureTrackingProtectionOffLabel
Expand Down

0 comments on commit 2febccb

Please sign in to comment.