-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathRunnerTests+Models.swift
More file actions
196 lines (185 loc) · 4.1 KB
/
RunnerTests+Models.swift
File metadata and controls
196 lines (185 loc) · 4.1 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// MARK: - Wire Models
enum CommandType: String, Codable {
case tap
case mouseClick
case tapSeries
case longPress
case interactionFrame
case drag
case dragSeries
case remotePress
case type
case swipe
case findText
case querySelector
case readText
case snapshot
case screenshot
case back
case backInApp
case backSystem
case home
case rotate
case appSwitcher
case keyboardDismiss
case keyboardReturn
case alert
case pinch
case rotateGesture
case transformGesture
case recordStart
case recordStop
case uptime
case shutdown
}
struct Command: Codable {
let command: CommandType
let appBundleId: String?
let text: String?
let selectorKey: String?
let selectorValue: String?
let allowNonHittableCoordinateFallback: Bool?
let delayMs: Int?
let textEntryMode: String?
let clearFirst: Bool?
let action: String?
let x: Double?
let y: Double?
let button: String?
let remoteButton: String?
let count: Double?
let intervalMs: Double?
let doubleTap: Bool?
let pauseMs: Double?
let pattern: String?
let x2: Double?
let y2: Double?
let dx: Double?
let dy: Double?
let durationMs: Double?
let direction: String?
let orientation: String?
let scale: Double?
let degrees: Double?
let velocity: Double?
let outPath: String?
let fps: Int?
let quality: Int?
let interactiveOnly: Bool?
let compact: Bool?
let depth: Int?
let scope: String?
let raw: Bool?
let fullscreen: Bool?
}
struct Response: Codable {
let ok: Bool
let data: DataPayload?
let error: ErrorPayload?
init(ok: Bool, data: DataPayload? = nil, error: ErrorPayload? = nil) {
self.ok = ok
self.data = data
self.error = error
}
}
struct DataPayload: Codable {
let message: String?
let text: String?
let found: Bool?
let items: [String]?
let nodes: [SnapshotNode]?
let truncated: Bool?
let gestureStartUptimeMs: Double?
let gestureEndUptimeMs: Double?
let x: Double?
let y: Double?
let x2: Double?
let y2: Double?
let referenceWidth: Double?
let referenceHeight: Double?
let currentUptimeMs: Double?
let visible: Bool?
let wasVisible: Bool?
let dismissed: Bool?
let orientation: String?
init(
message: String? = nil,
text: String? = nil,
found: Bool? = nil,
items: [String]? = nil,
nodes: [SnapshotNode]? = nil,
truncated: Bool? = nil,
gestureStartUptimeMs: Double? = nil,
gestureEndUptimeMs: Double? = nil,
x: Double? = nil,
y: Double? = nil,
x2: Double? = nil,
y2: Double? = nil,
referenceWidth: Double? = nil,
referenceHeight: Double? = nil,
currentUptimeMs: Double? = nil,
visible: Bool? = nil,
wasVisible: Bool? = nil,
dismissed: Bool? = nil,
orientation: String? = nil
) {
self.message = message
self.text = text
self.found = found
self.items = items
self.nodes = nodes
self.truncated = truncated
self.gestureStartUptimeMs = gestureStartUptimeMs
self.gestureEndUptimeMs = gestureEndUptimeMs
self.x = x
self.y = y
self.x2 = x2
self.y2 = y2
self.referenceWidth = referenceWidth
self.referenceHeight = referenceHeight
self.currentUptimeMs = currentUptimeMs
self.visible = visible
self.wasVisible = wasVisible
self.dismissed = dismissed
self.orientation = orientation
}
}
struct ErrorPayload: Codable {
let code: String?
let message: String
let hint: String?
init(code: String? = nil, message: String, hint: String? = nil) {
self.code = code
self.message = message
self.hint = hint
}
}
struct SnapshotRect: Codable {
let x: Double
let y: Double
let width: Double
let height: Double
}
struct SnapshotNode: Codable {
let index: Int
let type: String
let label: String?
let identifier: String?
let value: String?
let rect: SnapshotRect
let enabled: Bool
let focused: Bool?
let selected: Bool?
let hittable: Bool
let depth: Int
let parentIndex: Int?
let hiddenContentAbove: Bool?
let hiddenContentBelow: Bool?
}
struct SnapshotOptions {
let interactiveOnly: Bool
let compact: Bool
let depth: Int?
let scope: String?
let raw: Bool
}