Fix a few things about screenshots
- Postpone "Connected" screenshot - Disable "Only favorites" to avoid iOS failure - Prefix screenshot filename with device name and "0"
This commit is contained in:
parent
f441a2eed0
commit
d8447ddb38
|
@ -27,6 +27,7 @@ import Combine
|
|||
import CommonLibrary
|
||||
import Foundation
|
||||
import PassepartoutKit
|
||||
import UIAccessibility
|
||||
|
||||
extension VPNFiltersView {
|
||||
|
||||
|
@ -65,8 +66,10 @@ extension VPNFiltersView {
|
|||
onlyShowsFavorites = false
|
||||
subscriptions = []
|
||||
|
||||
if !AppCommandLine.contains(.uiTesting) {
|
||||
observeObjects()
|
||||
}
|
||||
}
|
||||
|
||||
func load(options: VPNFilterOptions, initialFilters: VPNFilters?) {
|
||||
self.options = options
|
||||
|
|
|
@ -84,7 +84,7 @@ extension XCUIApplicationProviding where Self: XCTestCase {
|
|||
#elseif os(tvOS)
|
||||
let device = "AppleTV"
|
||||
#endif
|
||||
return "\(name)_\(device).png"
|
||||
return "\(device)_\(name).png"
|
||||
}
|
||||
|
||||
private func container(for target: ScreenshotTarget) -> XCUIElement {
|
||||
|
|
|
@ -31,10 +31,12 @@ import XCTest
|
|||
struct VPNServersScreen {
|
||||
let app: XCUIApplication
|
||||
|
||||
#if os(iOS)
|
||||
@discardableResult
|
||||
func discloseCountry(at index: Int) -> Self {
|
||||
let group = app.get(.VPNServers.countryGroup, at: index)
|
||||
group.tap()
|
||||
return self
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -50,32 +50,34 @@ final class ScreenshotTests: XCTestCase, XCUIApplicationProviding {
|
|||
.waitForProfiles()
|
||||
.enableProfile(at: 0)
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("1_Connected")
|
||||
|
||||
let profile = root
|
||||
.openProfileMenu(at: 2)
|
||||
.editProfile()
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("2_ProfileEditor", target: .sheet)
|
||||
try snapshot("02_ProfileEditor", target: .sheet)
|
||||
|
||||
profile
|
||||
.enterModule(at: 1)
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("3_OnDemand", target: .sheet)
|
||||
try snapshot("03_OnDemand", target: .sheet)
|
||||
|
||||
profile
|
||||
.leaveModule()
|
||||
.enterModule(at: 2)
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("4_DNS", target: .sheet)
|
||||
try snapshot("04_DNS", target: .sheet)
|
||||
|
||||
profile
|
||||
let app = profile
|
||||
.leaveModule()
|
||||
.closeProfile()
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("01_Connected")
|
||||
|
||||
app
|
||||
.openProfileMenu(at: 2)
|
||||
.connectToProfile()
|
||||
#if os(iOS)
|
||||
|
@ -83,7 +85,7 @@ final class ScreenshotTests: XCTestCase, XCUIApplicationProviding {
|
|||
#endif
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("5_ProviderServers", target: .sheet)
|
||||
try snapshot("05_ProviderServers", target: .sheet)
|
||||
|
||||
print("Saved to: \(ScreenshotDestination.temporary.url)")
|
||||
}
|
||||
|
|
|
@ -47,19 +47,19 @@ final class ScreenshotTests: XCTestCase, XCUIApplicationProviding {
|
|||
.enableProfile(up: 1)
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("1_Connected")
|
||||
try snapshot("01_Connected")
|
||||
|
||||
root
|
||||
.presentProfilesWhileConnected()
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("2_ConnectedWithProfileList")
|
||||
try snapshot("02_ConnectedWithProfileList")
|
||||
|
||||
root
|
||||
.enableProfile(up: 0)
|
||||
|
||||
try await Task.sleep(for: .seconds(2))
|
||||
try snapshot("3_OnDemand")
|
||||
try snapshot("03_OnDemand")
|
||||
|
||||
print("Saved to: \(ScreenshotDestination.temporary.url)")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue