blob: 2b7a51cb9be94b2add1be7e5d398755ec41881d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
//
// ScreenshotTests.swift
// MullvadVPNScreenshots
//
// Created by Jon Petersson on 2024-05-28.
// Copyright © 2025 Mullvad VPN AB. All rights reserved.
//
import XCTest
@MainActor
class ScreenshotTests: LoggedInWithTimeUITestCase {
override func setUp() async throws {
setupSnapshot(app, waitForAnimations: false)
let argumentsJsonString = try? LaunchArguments(
target: .screenshots,
areAnimationsDisabled: true
).toJSON()
app.launchEnvironment[LaunchArguments.tag] = argumentsJsonString
try await super.setUp()
}
func testTakeScreenshotOfQuantumSecuredConnection() async throws {
// We can't close banners in the screenshot tests due to how the NotificationController view
// is overridden, so we need to restart the app once to make sure the "new device" notification
// isn't visible.
app.terminate()
app.launch()
TunnelControlPage(app)
.tapSelectLocationButton()
SelectLocationPage(app)
.tapLocationCell(withName: "Sweden")
TunnelControlPage(app)
.waitForConnectedLabel()
snapshot("QuantumConnectionSecured")
}
func testTakeScreenshotOfCustomListSelected() async throws {
let customListName = "Low latency locations"
TunnelControlPage(app)
.tapSelectLocationButton()
SelectLocationPage(app)
.tapWhereStatusBarShouldBeToScrollToTopMostPosition()
.tapCustomListEllipsisButton()
.tapAddNewCustomList()
CustomListPage(app)
.renameCustomList(name: customListName)
.addOrEditLocations()
AddCustomListLocationsPage(app)
.scrollToLocationWith(identifier: "se")
.unfoldLocationwith(identifier: "se")
.unfoldLocationwith(identifier: "se-got")
.toggleLocationCheckmarkWith(identifier: "se-got-wg-101")
.scrollToLocationWith(identifier: "de")
.unfoldLocationwith(identifier: "de")
.toggleLocationCheckmarkWith(identifier: "de-ber")
.scrollToLocationWith(identifier: "fi")
.toggleLocationCheckmarkWith(identifier: "fi")
.tapBackButton()
CustomListPage(app)
.tapCreateListButton()
SelectLocationPage(app)
.tapLocationCell(withName: customListName)
TunnelControlPage(app)
.tapSelectLocationButton()
SelectLocationPage(app)
.tapLocationCellExpandButton(withName: customListName)
snapshot("CustomListSelected")
}
func testTakeScreenshotOfRelayFilter() async throws {
TunnelControlPage(app)
.tapSelectLocationButton()
SelectLocationPage(app)
.tapFilterButton()
snapshot("RelayFilter")
}
func testTakeScreenshotOfVPNSettings() async throws {
HeaderBar(app)
.tapSettingsButton()
SettingsPage(app)
.tapVPNSettingsCell()
snapshot("VPNSettings")
}
func testTakeScreenshotOfDNSSettings() async throws {
HeaderBar(app)
.tapSettingsButton()
SettingsPage(app)
.tapVPNSettingsCell()
VPNSettingsPage(app)
.tapDNSSettingsCell()
DNSSettingsPage(app)
.tapDNSContentBlockersHeaderExpandButton()
.tapBlockAdsSwitch()
.tapBlockTrackerSwitch()
.tapBlockMalwareSwitch()
.tapBlockAdultContentSwitch()
.tapBlockGamblingSwitch()
.tapBlockSocialMediaSwitch()
snapshot("DNSSettings")
}
func testTakeScreenshotOfAccount() async throws {
HeaderBar(app)
.tapAccountButton()
snapshot("Account")
}
}
|