mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-05 08:12:42 +00:00
Reuse .pause() in screenshots
This commit is contained in:
parent
7d327b21d7
commit
16a59c6de1
@ -54,6 +54,10 @@ extension XCTestCase.ScreenshotDestination {
|
|||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
extension XCUIApplicationProviding where Self: XCTestCase {
|
extension XCUIApplicationProviding where Self: XCTestCase {
|
||||||
|
func pause() async {
|
||||||
|
try? await Task.sleep(for: .seconds(2))
|
||||||
|
}
|
||||||
|
|
||||||
func snapshot(
|
func snapshot(
|
||||||
_ name: String,
|
_ name: String,
|
||||||
destination: ScreenshotDestination = .temporary,
|
destination: ScreenshotDestination = .temporary,
|
||||||
|
@ -38,10 +38,6 @@ final class FlowTests: XCTestCase {
|
|||||||
app.launch()
|
app.launch()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tearDown() async throws {
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
|
||||||
}
|
|
||||||
|
|
||||||
func testConnect() {
|
func testConnect() {
|
||||||
AppScreen(app: app)
|
AppScreen(app: app)
|
||||||
.waitForProfiles()
|
.waitForProfiles()
|
||||||
|
@ -54,27 +54,27 @@ final class ScreenshotTests: XCTestCase, XCUIApplicationProviding {
|
|||||||
.openProfileMenu(at: 2)
|
.openProfileMenu(at: 2)
|
||||||
.editProfile()
|
.editProfile()
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("02_ProfileEditor", target: .sheet)
|
try snapshot("02_ProfileEditor", target: .sheet)
|
||||||
|
|
||||||
profile
|
profile
|
||||||
.enterModule(at: 1)
|
.enterModule(at: 1)
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("03_OnDemand", target: .sheet)
|
try snapshot("03_OnDemand", target: .sheet)
|
||||||
|
|
||||||
profile
|
profile
|
||||||
.leaveModule()
|
.leaveModule()
|
||||||
.enterModule(at: 2)
|
.enterModule(at: 2)
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("04_DNS", target: .sheet)
|
try snapshot("04_DNS", target: .sheet)
|
||||||
|
|
||||||
let app = profile
|
let app = profile
|
||||||
.leaveModule()
|
.leaveModule()
|
||||||
.closeProfile()
|
.closeProfile()
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("01_Connected")
|
try snapshot("01_Connected")
|
||||||
|
|
||||||
app
|
app
|
||||||
@ -84,7 +84,7 @@ final class ScreenshotTests: XCTestCase, XCUIApplicationProviding {
|
|||||||
.discloseCountry(at: 2)
|
.discloseCountry(at: 2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("05_ProviderServers", target: .sheet)
|
try snapshot("05_ProviderServers", target: .sheet)
|
||||||
|
|
||||||
print("Saved to: \(ScreenshotDestination.temporary.url)")
|
print("Saved to: \(ScreenshotDestination.temporary.url)")
|
||||||
|
@ -38,10 +38,6 @@ final class FlowTests: XCTestCase {
|
|||||||
app.launch()
|
app.launch()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tearDown() async throws {
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
|
||||||
}
|
|
||||||
|
|
||||||
func testShow() {
|
func testShow() {
|
||||||
AppScreen(app: app)
|
AppScreen(app: app)
|
||||||
.waitForProfiles()
|
.waitForProfiles()
|
||||||
|
@ -46,19 +46,19 @@ final class ScreenshotTests: XCTestCase, XCUIApplicationProviding {
|
|||||||
.presentInitialProfiles()
|
.presentInitialProfiles()
|
||||||
.enableProfile(up: 1)
|
.enableProfile(up: 1)
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("01_Connected")
|
try snapshot("01_Connected")
|
||||||
|
|
||||||
root
|
root
|
||||||
.presentProfilesWhileConnected()
|
.presentProfilesWhileConnected()
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("02_ConnectedWithProfileList")
|
try snapshot("02_ConnectedWithProfileList")
|
||||||
|
|
||||||
root
|
root
|
||||||
.enableProfile(up: 0)
|
.enableProfile(up: 0)
|
||||||
|
|
||||||
try await Task.sleep(for: .seconds(2))
|
await pause()
|
||||||
try snapshot("03_OnDemand")
|
try snapshot("03_OnDemand")
|
||||||
|
|
||||||
print("Saved to: \(ScreenshotDestination.temporary.url)")
|
print("Saved to: \(ScreenshotDestination.temporary.url)")
|
||||||
|
Loading…
Reference in New Issue
Block a user