appium-webdriveragent 13.2.1 → 13.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [13.2.2](https://github.com/appium/WebDriverAgent/compare/v13.2.1...v13.2.2) (2026-06-06)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Refactor session creation handler ([#1149](https://github.com/appium/WebDriverAgent/issues/1149)) ([923b523](https://github.com/appium/WebDriverAgent/commit/923b523b55f880b921de2c95a82786ce0699cb9d))
|
|
6
|
+
|
|
1
7
|
## [13.2.1](https://github.com/appium/WebDriverAgent/compare/v13.2.0...v13.2.1) (2026-06-06)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -90,134 +90,35 @@
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
NSDictionary<NSString *, id> *capabilities;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
if (nil == (capabilities = FBParseCapabilities((NSDictionary *)request.arguments[@"capabilities"], &error))) {
|
|
99
|
-
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:error.localizedDescription traceback:nil]);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
[FBConfiguration resetSessionSettings];
|
|
103
|
-
if (capabilities[FB_SETTING_USE_COMPACT_RESPONSES]) {
|
|
104
|
-
[FBConfiguration setShouldUseCompactResponses:[capabilities[FB_SETTING_USE_COMPACT_RESPONSES] boolValue]];
|
|
105
|
-
}
|
|
106
|
-
NSString *elementResponseAttributes = capabilities[FB_SETTING_ELEMENT_RESPONSE_ATTRIBUTES];
|
|
107
|
-
if (elementResponseAttributes) {
|
|
108
|
-
[FBConfiguration setElementResponseAttributes:elementResponseAttributes];
|
|
109
|
-
}
|
|
110
|
-
if (capabilities[FB_CAP_MAX_TYPING_FREQUENCY]) {
|
|
111
|
-
[FBConfiguration setMaxTypingFrequency:[capabilities[FB_CAP_MAX_TYPING_FREQUENCY] unsignedIntegerValue]];
|
|
112
|
-
}
|
|
113
|
-
if (capabilities[FB_CAP_USE_SINGLETON_TEST_MANAGER]) {
|
|
114
|
-
[FBConfiguration setShouldUseSingletonTestManager:[capabilities[FB_CAP_USE_SINGLETON_TEST_MANAGER] boolValue]];
|
|
115
|
-
}
|
|
116
|
-
if (capabilities[FB_CAP_DISABLE_AUTOMATIC_SCREENSHOTS]) {
|
|
117
|
-
if ([capabilities[FB_CAP_DISABLE_AUTOMATIC_SCREENSHOTS] boolValue]) {
|
|
118
|
-
[FBConfiguration disableScreenshots];
|
|
119
|
-
} else {
|
|
120
|
-
[FBConfiguration enableScreenshots];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (capabilities[FB_CAP_SHOULD_TERMINATE_APP]) {
|
|
124
|
-
[FBConfiguration setShouldTerminateApp:[capabilities[FB_CAP_SHOULD_TERMINATE_APP] boolValue]];
|
|
125
|
-
}
|
|
126
|
-
NSNumber *delay = capabilities[FB_CAP_EVENT_LOOP_IDLE_DELAY_SEC];
|
|
127
|
-
if ([delay doubleValue] > 0.0) {
|
|
128
|
-
[XCUIApplicationProcessDelay setEventLoopHasIdledDelay:[delay doubleValue]];
|
|
129
|
-
} else {
|
|
130
|
-
[XCUIApplicationProcessDelay disableEventLoopDelay];
|
|
93
|
+
id<FBResponsePayload> errorResponse = [self capabilitiesFromCreateSessionRequest:request
|
|
94
|
+
capabilitiesOut:&capabilities];
|
|
95
|
+
if (nil != errorResponse) {
|
|
96
|
+
return errorResponse;
|
|
131
97
|
}
|
|
132
98
|
|
|
133
|
-
|
|
134
|
-
FBConfiguration.waitForIdleTimeout = [capabilities[FB_SETTING_WAIT_FOR_IDLE_TIMEOUT] doubleValue];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (nil == capabilities[FB_CAP_FORCE_SIMULATOR_SOFTWARE_KEYBOARD_PRESENCE] ||
|
|
138
|
-
[capabilities[FB_CAP_FORCE_SIMULATOR_SOFTWARE_KEYBOARD_PRESENCE] boolValue]) {
|
|
139
|
-
[FBConfiguration forceSimulatorSoftwareKeyboardPresence];
|
|
140
|
-
}
|
|
99
|
+
[self applyConfigurationFromCapabilities:capabilities];
|
|
141
100
|
|
|
142
101
|
NSString *bundleID = capabilities[FB_CAP_BUNDLE_ID];
|
|
143
102
|
NSString *initialUrl = capabilities[FB_CAP_INITIAL_URL];
|
|
144
103
|
XCUIApplication *app = nil;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
XCUIApplicationState appState = app.state;
|
|
152
|
-
BOOL isAppRunning = appState >= XCUIApplicationStateRunningBackground;
|
|
153
|
-
if (!isAppRunning || (isAppRunning && forceAppLaunch)) {
|
|
154
|
-
app.fb_shouldWaitForQuiescence = nil == capabilities[FB_CAP_SHOULD_WAIT_FOR_QUIESCENCE]
|
|
155
|
-
|| [capabilities[FB_CAP_SHOULD_WAIT_FOR_QUIESCENCE] boolValue];
|
|
156
|
-
app.launchArguments = (NSArray<NSString *> *)capabilities[FB_CAP_ARGUMENTS] ?: @[];
|
|
157
|
-
app.launchEnvironment = (NSDictionary <NSString *, NSString *> *)capabilities[FB_CAP_ENVIRNOMENT] ?: @{};
|
|
158
|
-
if (nil != initialUrl) {
|
|
159
|
-
if (app.running) {
|
|
160
|
-
[app terminate];
|
|
161
|
-
}
|
|
162
|
-
id<FBResponsePayload> errorResponse = [self openDeepLink:initialUrl
|
|
163
|
-
withApplication:bundleID
|
|
164
|
-
timeout:capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]];
|
|
165
|
-
if (nil != errorResponse) {
|
|
166
|
-
return errorResponse;
|
|
167
|
-
}
|
|
168
|
-
} else {
|
|
169
|
-
NSTimeInterval defaultTimeout = _XCTApplicationStateTimeout();
|
|
170
|
-
if (nil != capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]) {
|
|
171
|
-
_XCTSetApplicationStateTimeout([capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC] doubleValue]);
|
|
172
|
-
}
|
|
173
|
-
@try {
|
|
174
|
-
[app launch];
|
|
175
|
-
} @catch (NSException *e) {
|
|
176
|
-
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:e.reason traceback:nil]);
|
|
177
|
-
} @finally {
|
|
178
|
-
if (nil != capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]) {
|
|
179
|
-
_XCTSetApplicationStateTimeout(defaultTimeout);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
if (!app.running) {
|
|
184
|
-
NSString *errorMsg = [NSString stringWithFormat:@"Cannot launch %@ application. Make sure the correct bundle identifier has been provided in capabilities and check the device log for possible crash report occurrences", bundleID];
|
|
185
|
-
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg
|
|
186
|
-
traceback:nil]);
|
|
187
|
-
}
|
|
188
|
-
} else if (appState == XCUIApplicationStateRunningBackground && !forceAppLaunch) {
|
|
189
|
-
if (nil != initialUrl) {
|
|
190
|
-
id<FBResponsePayload> errorResponse = [self openDeepLink:initialUrl
|
|
191
|
-
withApplication:bundleID
|
|
192
|
-
timeout:nil];
|
|
193
|
-
if (nil != errorResponse) {
|
|
194
|
-
return errorResponse;
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
[app activate];
|
|
198
|
-
}
|
|
199
|
-
}
|
|
104
|
+
errorResponse = [self prepareApplicationForSessionWithBundleID:bundleID
|
|
105
|
+
initialUrl:initialUrl
|
|
106
|
+
capabilities:capabilities
|
|
107
|
+
application:&app];
|
|
108
|
+
if (nil != errorResponse) {
|
|
109
|
+
return errorResponse;
|
|
200
110
|
}
|
|
201
111
|
|
|
202
112
|
if (nil != initialUrl && nil == bundleID) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
113
|
+
errorResponse = [self openDeepLink:initialUrl
|
|
114
|
+
withApplication:nil
|
|
115
|
+
timeout:capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]];
|
|
206
116
|
if (nil != errorResponse) {
|
|
207
117
|
return errorResponse;
|
|
208
118
|
}
|
|
209
119
|
}
|
|
210
120
|
|
|
211
|
-
|
|
212
|
-
[FBSession initWithApplication:app
|
|
213
|
-
defaultAlertAction:(id)capabilities[FB_SETTING_DEFAULT_ALERT_ACTION]];
|
|
214
|
-
} else {
|
|
215
|
-
[FBSession initWithApplication:app];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (nil != capabilities[FB_CAP_USE_NATIVE_CACHING_STRATEGY]) {
|
|
219
|
-
FBSession.activeSession.useNativeCachingStrategy = [capabilities[FB_CAP_USE_NATIVE_CACHING_STRATEGY] boolValue];
|
|
220
|
-
}
|
|
121
|
+
[self initializeSessionWithApplication:app capabilities:capabilities];
|
|
221
122
|
|
|
222
123
|
return FBResponseWithObject(FBSessionCommands.sessionInformation);
|
|
223
124
|
}
|
|
@@ -343,6 +244,170 @@
|
|
|
343
244
|
}
|
|
344
245
|
|
|
345
246
|
|
|
247
|
+
#pragma mark - Session Creation Helpers
|
|
248
|
+
|
|
249
|
+
+ (nullable id<FBResponsePayload>)capabilitiesFromCreateSessionRequest:(FBRouteRequest *)request
|
|
250
|
+
capabilitiesOut:(NSDictionary<NSString *, id> *_Nonnull *_Nonnull)capabilitiesOut
|
|
251
|
+
{
|
|
252
|
+
if (![request.arguments[@"capabilities"] isKindOfClass:NSDictionary.class]) {
|
|
253
|
+
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:@"'capabilities' is mandatory to create a new session"
|
|
254
|
+
traceback:nil]);
|
|
255
|
+
}
|
|
256
|
+
NSError *error;
|
|
257
|
+
NSDictionary<NSString *, id> *capabilities = FBParseCapabilities((NSDictionary *)request.arguments[@"capabilities"], &error);
|
|
258
|
+
if (nil == capabilities) {
|
|
259
|
+
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:error.localizedDescription traceback:nil]);
|
|
260
|
+
}
|
|
261
|
+
*capabilitiesOut = capabilities;
|
|
262
|
+
return nil;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
+ (void)applyConfigurationFromCapabilities:(NSDictionary<NSString *, id> *)capabilities
|
|
266
|
+
{
|
|
267
|
+
[FBConfiguration resetSessionSettings];
|
|
268
|
+
if (capabilities[FB_SETTING_USE_COMPACT_RESPONSES]) {
|
|
269
|
+
[FBConfiguration setShouldUseCompactResponses:[capabilities[FB_SETTING_USE_COMPACT_RESPONSES] boolValue]];
|
|
270
|
+
}
|
|
271
|
+
NSString *elementResponseAttributes = capabilities[FB_SETTING_ELEMENT_RESPONSE_ATTRIBUTES];
|
|
272
|
+
if (elementResponseAttributes) {
|
|
273
|
+
[FBConfiguration setElementResponseAttributes:elementResponseAttributes];
|
|
274
|
+
}
|
|
275
|
+
if (capabilities[FB_CAP_MAX_TYPING_FREQUENCY]) {
|
|
276
|
+
[FBConfiguration setMaxTypingFrequency:[capabilities[FB_CAP_MAX_TYPING_FREQUENCY] unsignedIntegerValue]];
|
|
277
|
+
}
|
|
278
|
+
if (capabilities[FB_CAP_USE_SINGLETON_TEST_MANAGER]) {
|
|
279
|
+
[FBConfiguration setShouldUseSingletonTestManager:[capabilities[FB_CAP_USE_SINGLETON_TEST_MANAGER] boolValue]];
|
|
280
|
+
}
|
|
281
|
+
if (capabilities[FB_CAP_DISABLE_AUTOMATIC_SCREENSHOTS]) {
|
|
282
|
+
if ([capabilities[FB_CAP_DISABLE_AUTOMATIC_SCREENSHOTS] boolValue]) {
|
|
283
|
+
[FBConfiguration disableScreenshots];
|
|
284
|
+
} else {
|
|
285
|
+
[FBConfiguration enableScreenshots];
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (capabilities[FB_CAP_SHOULD_TERMINATE_APP]) {
|
|
289
|
+
[FBConfiguration setShouldTerminateApp:[capabilities[FB_CAP_SHOULD_TERMINATE_APP] boolValue]];
|
|
290
|
+
}
|
|
291
|
+
NSNumber *delay = capabilities[FB_CAP_EVENT_LOOP_IDLE_DELAY_SEC];
|
|
292
|
+
if ([delay doubleValue] > 0.0) {
|
|
293
|
+
[XCUIApplicationProcessDelay setEventLoopHasIdledDelay:[delay doubleValue]];
|
|
294
|
+
} else {
|
|
295
|
+
[XCUIApplicationProcessDelay disableEventLoopDelay];
|
|
296
|
+
}
|
|
297
|
+
if (nil != capabilities[FB_SETTING_WAIT_FOR_IDLE_TIMEOUT]) {
|
|
298
|
+
FBConfiguration.waitForIdleTimeout = [capabilities[FB_SETTING_WAIT_FOR_IDLE_TIMEOUT] doubleValue];
|
|
299
|
+
}
|
|
300
|
+
if (nil == capabilities[FB_CAP_FORCE_SIMULATOR_SOFTWARE_KEYBOARD_PRESENCE] ||
|
|
301
|
+
[capabilities[FB_CAP_FORCE_SIMULATOR_SOFTWARE_KEYBOARD_PRESENCE] boolValue]) {
|
|
302
|
+
[FBConfiguration forceSimulatorSoftwareKeyboardPresence];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
+ (nullable id<FBResponsePayload>)prepareApplicationForSessionWithBundleID:(nullable NSString *)bundleID
|
|
307
|
+
initialUrl:(nullable NSString *)initialUrl
|
|
308
|
+
capabilities:(NSDictionary<NSString *, id> *)capabilities
|
|
309
|
+
application:(XCUIApplication *_Nullable *_Nonnull)applicationOut
|
|
310
|
+
{
|
|
311
|
+
if (nil == bundleID) {
|
|
312
|
+
*applicationOut = nil;
|
|
313
|
+
return nil;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
XCUIApplication *app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleID];
|
|
317
|
+
BOOL forceAppLaunch = nil == capabilities[FB_CAP_FORCE_APP_LAUNCH]
|
|
318
|
+
|| [capabilities[FB_CAP_FORCE_APP_LAUNCH] boolValue];
|
|
319
|
+
XCUIApplicationState appState = app.state;
|
|
320
|
+
BOOL isAppRunning = appState >= XCUIApplicationStateRunningBackground;
|
|
321
|
+
|
|
322
|
+
if (!isAppRunning || (isAppRunning && forceAppLaunch)) {
|
|
323
|
+
id<FBResponsePayload> errorResponse = [self launchApplication:app
|
|
324
|
+
bundleID:bundleID
|
|
325
|
+
initialUrl:initialUrl
|
|
326
|
+
capabilities:capabilities];
|
|
327
|
+
if (nil != errorResponse) {
|
|
328
|
+
return errorResponse;
|
|
329
|
+
}
|
|
330
|
+
} else if (appState == XCUIApplicationStateRunningBackground && !forceAppLaunch) {
|
|
331
|
+
id<FBResponsePayload> errorResponse = [self activateBackgroundApplication:app
|
|
332
|
+
bundleID:bundleID
|
|
333
|
+
initialUrl:initialUrl];
|
|
334
|
+
if (nil != errorResponse) {
|
|
335
|
+
return errorResponse;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
*applicationOut = app;
|
|
340
|
+
return nil;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
+ (nullable id<FBResponsePayload>)launchApplication:(XCUIApplication *)app
|
|
344
|
+
bundleID:(NSString *)bundleID
|
|
345
|
+
initialUrl:(nullable NSString *)initialUrl
|
|
346
|
+
capabilities:(NSDictionary<NSString *, id> *)capabilities
|
|
347
|
+
{
|
|
348
|
+
app.fb_shouldWaitForQuiescence = nil == capabilities[FB_CAP_SHOULD_WAIT_FOR_QUIESCENCE]
|
|
349
|
+
|| [capabilities[FB_CAP_SHOULD_WAIT_FOR_QUIESCENCE] boolValue];
|
|
350
|
+
app.launchArguments = (NSArray<NSString *> *)capabilities[FB_CAP_ARGUMENTS] ?: @[];
|
|
351
|
+
app.launchEnvironment = (NSDictionary<NSString *, NSString *> *)capabilities[FB_CAP_ENVIRNOMENT] ?: @{};
|
|
352
|
+
|
|
353
|
+
if (nil != initialUrl) {
|
|
354
|
+
if (app.running) {
|
|
355
|
+
[app terminate];
|
|
356
|
+
}
|
|
357
|
+
id<FBResponsePayload> errorResponse = [self openDeepLink:initialUrl
|
|
358
|
+
withApplication:bundleID
|
|
359
|
+
timeout:capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]];
|
|
360
|
+
if (nil != errorResponse) {
|
|
361
|
+
return errorResponse;
|
|
362
|
+
}
|
|
363
|
+
} else {
|
|
364
|
+
NSTimeInterval defaultTimeout = _XCTApplicationStateTimeout();
|
|
365
|
+
if (nil != capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]) {
|
|
366
|
+
_XCTSetApplicationStateTimeout([capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC] doubleValue]);
|
|
367
|
+
}
|
|
368
|
+
@try {
|
|
369
|
+
[app launch];
|
|
370
|
+
} @catch (NSException *e) {
|
|
371
|
+
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:e.reason traceback:nil]);
|
|
372
|
+
} @finally {
|
|
373
|
+
if (nil != capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]) {
|
|
374
|
+
_XCTSetApplicationStateTimeout(defaultTimeout);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (!app.running) {
|
|
380
|
+
NSString *errorMsg = [NSString stringWithFormat:@"Cannot launch %@ application. Make sure the correct bundle identifier has been provided in capabilities and check the device log for possible crash report occurrences", bundleID];
|
|
381
|
+
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg traceback:nil]);
|
|
382
|
+
}
|
|
383
|
+
return nil;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
+ (nullable id<FBResponsePayload>)activateBackgroundApplication:(XCUIApplication *)app
|
|
387
|
+
bundleID:(NSString *)bundleID
|
|
388
|
+
initialUrl:(nullable NSString *)initialUrl
|
|
389
|
+
{
|
|
390
|
+
if (nil != initialUrl) {
|
|
391
|
+
return [self openDeepLink:initialUrl withApplication:bundleID timeout:nil];
|
|
392
|
+
}
|
|
393
|
+
[app activate];
|
|
394
|
+
return nil;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
+ (void)initializeSessionWithApplication:(nullable XCUIApplication *)app
|
|
398
|
+
capabilities:(NSDictionary<NSString *, id> *)capabilities
|
|
399
|
+
{
|
|
400
|
+
if (capabilities[FB_SETTING_DEFAULT_ALERT_ACTION]) {
|
|
401
|
+
[FBSession initWithApplication:app
|
|
402
|
+
defaultAlertAction:(id)capabilities[FB_SETTING_DEFAULT_ALERT_ACTION]];
|
|
403
|
+
} else {
|
|
404
|
+
[FBSession initWithApplication:app];
|
|
405
|
+
}
|
|
406
|
+
if (nil != capabilities[FB_CAP_USE_NATIVE_CACHING_STRATEGY]) {
|
|
407
|
+
FBSession.activeSession.useNativeCachingStrategy = [capabilities[FB_CAP_USE_NATIVE_CACHING_STRATEGY] boolValue];
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
346
411
|
#pragma mark - Helpers
|
|
347
412
|
|
|
348
413
|
+ (NSString *)buildTimestamp
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<key>CFBundlePackageType</key>
|
|
16
16
|
<string>FMWK</string>
|
|
17
17
|
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>13.2.
|
|
18
|
+
<string>13.2.2</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>13.2.
|
|
22
|
+
<string>13.2.2</string>
|
|
23
23
|
<key>NSPrincipalClass</key>
|
|
24
24
|
<string/>
|
|
25
25
|
</dict>
|