You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split XCTest helpers into their own product so native app targets can depend on the core client without test APIs. Align Swift screenshot payloads with the server comparison contract and document the SPM integration path.
pod 'Vizzly', :git => 'https://github.com/vizzly-testing/cli', :branch => 'main'
39
-
```
46
+
Vizzly does not currently ship a CocoaPods podspec. Use Swift Package Manager
47
+
for native app integration.
40
48
41
49
## Quick Start
42
50
@@ -54,6 +62,7 @@ This starts a local server at `http://localhost:47392` that receives screenshots
54
62
```swift
55
63
importXCTest
56
64
importVizzly
65
+
importVizzlyXCTest
57
66
58
67
classMyUITests: XCTestCase {
59
68
let app =XCUIApplication()
@@ -128,14 +137,17 @@ func testNavigationBar() {
128
137
129
138
```swift
130
139
functestAnimatedContent() {
131
-
// Allow up to 5% pixel difference (useful for animations)
140
+
// Allow a higher comparison threshold for animated content
132
141
app.vizzlyScreenshot(
133
142
name: "animated-banner",
134
143
threshold: 5
135
144
)
136
145
}
137
146
```
138
147
148
+
If `threshold` or `minClusterSize` is omitted, the server's configured
149
+
comparison settings are used.
150
+
139
151
### Multiple Device Orientations
140
152
141
153
```swift
@@ -187,7 +199,8 @@ extension XCUIApplication {
187
199
funcvizzlyScreenshot(
188
200
name: String,
189
201
properties: [String: Any]?=nil,
190
-
threshold: Int=0,
202
+
threshold: Double?=nil,
203
+
minClusterSize: Int?=nil,
191
204
fullPage: Bool=false
192
205
) -> [String: Any]?
193
206
}
@@ -200,7 +213,8 @@ extension XCUIElement {
200
213
funcvizzlyScreenshot(
201
214
name: String,
202
215
properties: [String: Any]?=nil,
203
-
threshold: Int=0
216
+
threshold: Double?=nil,
217
+
minClusterSize: Int?=nil
204
218
) -> [String: Any]?
205
219
}
206
220
```
@@ -213,15 +227,17 @@ extension XCTestCase {
213
227
name: String,
214
228
app: XCUIApplication,
215
229
properties: [String: Any]?=nil,
216
-
threshold: Int=0,
230
+
threshold: Double?=nil,
231
+
minClusterSize: Int?=nil,
217
232
fullPage: Bool=false
218
233
) -> [String: Any]?
219
234
220
235
funcvizzlyScreenshot(
221
236
name: String,
222
237
element: XCUIElement,
223
238
properties: [String: Any]?=nil,
224
-
threshold: Int=0
239
+
threshold: Double?=nil,
240
+
minClusterSize: Int?=nil
225
241
) -> [String: Any]?
226
242
}
227
243
```
@@ -236,7 +252,8 @@ class VizzlyClient {
236
252
name: String,
237
253
image: Data,
238
254
properties: [String: Any]?=nil,
239
-
threshold: Int=0,
255
+
threshold: Double?=nil,
256
+
minClusterSize: Int?=nil,
240
257
fullPage: Bool=false
241
258
) -> [String: Any]?
242
259
@@ -254,8 +271,9 @@ class VizzlyClient {
254
271
The SDK automatically discovers a running Vizzly TDD server using this priority order:
255
272
256
273
1.**VIZZLY_SERVER_URL environment variable** - Explicitly set server URL
257
-
2.**Global server file** - `~/.vizzly/server.json` written by CLI
258
-
3.**Default port health check** - Tests `http://localhost:47392/health`
274
+
2.**Project server file** - `.vizzly/server.json` in the current directory
275
+
3.**Global server file** - `~/.vizzly/server.json` written by CLI
276
+
4.**Default port health check** - Tests `http://localhost:47392/health`
259
277
260
278
When you run `vizzly tdd start`, the CLI automatically writes server info to `~/.vizzly/server.json` in your home directory, enabling zero-config discovery from iOS tests.
0 commit comments