Skip to content

Commit

Permalink
Modified test flow to avoid race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasberglund committed Feb 2, 2024
1 parent 0e9adc3 commit 18abea9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
6 changes: 6 additions & 0 deletions ios/MullvadVPNUITests/Pages/Page.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ class Page {
app.typeText(text)
return self
}

/// Fast swipe down action to dismiss a modal view. Will swipe on the middle of the screen.
@discardableResult func swipeDownToDismissModal() -> Self {
app.swipeDown(velocity: .fast)
return self
}
}
21 changes: 10 additions & 11 deletions ios/MullvadVPNUITests/RelayTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ import XCTest

class RelayTests: LoggedInWithTimeUITestCase {
func testAdBlockingViaDNS() throws {
HeaderBar(app)
.tapSettingsButton()

SettingsPage(app)
.tapVPNSettingsCell()
.tapDNSSettingsCell()
.tapDNSContentBlockingHeaderExpandButton()
.tapBlockAdsSwitch()
.swipeDownToDismissModal()

TunnelControlPage(app)
.tapSelectLocationButton()

Expand All @@ -23,17 +33,6 @@ class RelayTests: LoggedInWithTimeUITestCase {

TunnelControlPage(app) // Make sure we're taken back to tunnel control page again

verifyCanReachAdServingDomain()

HeaderBar(app)
.tapSettingsButton()

SettingsPage(app)
.tapVPNSettingsCell()
.tapDNSSettingsCell()
.tapDNSContentBlockingHeaderExpandButton()
.tapBlockAdsSwitch()

verifyCannotReachAdServingDomain()
}

Expand Down

0 comments on commit 18abea9

Please sign in to comment.