Skip to content

Commit 52fad2b

Browse files
committed
test(UI): always wipe all data on disk before starting a new UI test (#5436)
* test: always wipe all data on disk before starting a new UI test * do it in BaseUITest.setUp so it only happens once per test case, on the first launch
1 parent a184160 commit 52fad2b

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Samples/iOS-Swift/iOS-Swift-UITests/BaseUITest.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ class BaseUITest: XCTestCase {
1313
continueAfterFailure = false
1414
XCUIDevice.shared.orientation = .portrait
1515
app.launchEnvironment["--io.sentry.sdk-environment"] = "ui-tests"
16+
app.launchArguments.append(contentsOf: [
17+
"--io.sentry.wipe-data"
18+
])
1619
if automaticallyLaunchAndTerminateApp {
1720
launchApp()
1821
}

Samples/iOS-Swift/iOS-Swift-UITests/ProfilingUITests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ import XCTest
66
class ProfilingUITests: BaseUITest {
77
override var automaticallyLaunchAndTerminateApp: Bool { false }
88

9-
override func setUp() {
10-
super.setUp()
11-
12-
app.launchArguments.append(contentsOf: [
13-
"--io.sentry.wipe-data" // make sure there are no previous configuration files or profile files written
14-
])
15-
}
16-
179
func testAppLaunchesWithTraceProfiler() throws {
1810
guard #available(iOS 16, *) else {
1911
throw XCTSkip("Only run for latest iOS version we test; we've had issues with prior versions in SauceLabs")

0 commit comments

Comments
 (0)