appium-webdriveragent 3.13.2 → 3.15.0

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.
Files changed (35) hide show
  1. package/Scripts/build.sh +13 -16
  2. package/WebDriverAgent.xcodeproj/project.pbxproj +2 -2
  3. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  4. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/WorkspaceSettings.xcsettings +20 -0
  5. package/WebDriverAgent.xcodeproj/xcuserdata/kazuaki.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +2322 -0
  6. package/WebDriverAgent.xcodeproj/xcuserdata/{elf.xcuserdatad → kazuaki.xcuserdatad}/xcschemes/xcschememanagement.plist +35 -12
  7. package/WebDriverAgentLib/.DS_Store +0 -0
  8. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +1 -4
  9. package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +10 -1
  10. package/WebDriverAgentLib/Commands/FBCustomCommands.m +10 -2
  11. package/WebDriverAgentLib/Routing/FBElement.h +2 -2
  12. package/WebDriverAgentLib/Routing/FBResponsePayload.m +1 -1
  13. package/WebDriverAgentLib/Utilities/FBMathUtils.h +0 -3
  14. package/WebDriverAgentLib/Utilities/FBMathUtils.m +0 -13
  15. package/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.h +0 -6
  16. package/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +0 -15
  17. package/WebDriverAgentLib/Vendor/CocoaHTTPServer/HTTPServer.h +3 -77
  18. package/WebDriverAgentLib/Vendor/CocoaHTTPServer/HTTPServer.m +0 -348
  19. package/WebDriverAgentRunner-Runner.app.zip +0 -0
  20. package/WebDriverAgentTests/IntegrationTests/FBSafariAlertTests.m +13 -10
  21. package/build/index.js +6 -4
  22. package/build/lib/check-dependencies.js +1 -1
  23. package/build/lib/constants.js +1 -1
  24. package/build/lib/utils.js +11 -11
  25. package/build/lib/webdriveragent.js +2 -2
  26. package/build/lib/xcodebuild.js +1 -1
  27. package/lib/utils.js +2 -1
  28. package/package.json +1 -1
  29. package/PrivateHeaders/.DS_Store +0 -0
  30. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/elf.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  31. package/WebDriverAgent.xcodeproj/xcuserdata/elf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -75
  32. package/WebDriverAgentLib/Utilities/LRUCache/.DS_Store +0 -0
  33. package/WebDriverAgentLib/Vendor/.DS_Store +0 -0
  34. package/WebDriverAgentRunner/.DS_Store +0 -0
  35. package/WebDriverAgentTests/IntegrationApp/Resources/.DS_Store +0 -0
@@ -4,55 +4,78 @@
4
4
  <dict>
5
5
  <key>SchemeUserState</key>
6
6
  <dict>
7
+ <key>IntegrationApp.xcscheme</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>3</integer>
11
+ </dict>
7
12
  <key>IntegrationApp.xcscheme_^#shared#^_</key>
8
13
  <dict>
9
14
  <key>orderHint</key>
10
- <integer>0</integer>
15
+ <integer>5</integer>
11
16
  </dict>
12
17
  <key>IntegrationTests_1.xcscheme_^#shared#^_</key>
13
18
  <dict>
14
19
  <key>orderHint</key>
15
- <integer>1</integer>
20
+ <integer>6</integer>
16
21
  </dict>
17
22
  <key>IntegrationTests_2.xcscheme_^#shared#^_</key>
18
23
  <dict>
19
24
  <key>orderHint</key>
20
- <integer>2</integer>
25
+ <integer>7</integer>
21
26
  </dict>
22
27
  <key>IntegrationTests_3.xcscheme_^#shared#^_</key>
23
28
  <dict>
24
29
  <key>orderHint</key>
25
- <integer>3</integer>
30
+ <integer>8</integer>
26
31
  </dict>
27
- <key>WebDriverAgentLib copy.xcscheme_^#shared#^_</key>
32
+ <key>WebDriverAgentLib.xcscheme_^#shared#^_</key>
28
33
  <dict>
29
34
  <key>orderHint</key>
30
- <integer>9</integer>
35
+ <integer>0</integer>
31
36
  </dict>
32
- <key>WebDriverAgentLib.xcscheme_^#shared#^_</key>
37
+ <key>WebDriverAgentLib_tvOS copy.xcscheme_^#shared#^_</key>
33
38
  <dict>
34
39
  <key>orderHint</key>
35
- <integer>4</integer>
40
+ <integer>10</integer>
36
41
  </dict>
37
42
  <key>WebDriverAgentLib_tvOS.xcscheme_^#shared#^_</key>
38
43
  <dict>
39
44
  <key>orderHint</key>
40
- <integer>5</integer>
45
+ <integer>3</integer>
46
+ </dict>
47
+ <key>WebDriverAgentLib_watchOS.xcscheme_^#shared#^_</key>
48
+ <dict>
49
+ <key>orderHint</key>
50
+ <integer>10</integer>
41
51
  </dict>
42
52
  <key>WebDriverAgentRunner-nodebug.xcscheme_^#shared#^_</key>
43
53
  <dict>
44
54
  <key>orderHint</key>
45
- <integer>7</integer>
55
+ <integer>2</integer>
46
56
  </dict>
47
57
  <key>WebDriverAgentRunner.xcscheme_^#shared#^_</key>
48
58
  <dict>
49
59
  <key>orderHint</key>
50
- <integer>6</integer>
60
+ <integer>1</integer>
51
61
  </dict>
52
62
  <key>WebDriverAgentRunner_tvOS.xcscheme_^#shared#^_</key>
53
63
  <dict>
54
64
  <key>orderHint</key>
55
- <integer>8</integer>
65
+ <integer>4</integer>
66
+ </dict>
67
+ <key>WebDriverAgentRunner_watchOS.xcscheme_^#shared#^_</key>
68
+ <dict>
69
+ <key>orderHint</key>
70
+ <integer>9</integer>
71
+ </dict>
72
+ </dict>
73
+ <key>SuppressBuildableAutocreation</key>
74
+ <dict>
75
+ <key>72F9A2AB26B5121A00A27636</key>
76
+ <dict>
77
+ <key>primary</key>
78
+ <true/>
56
79
  </dict>
57
80
  </dict>
58
81
  </dict>
Binary file
@@ -121,10 +121,7 @@ static NSString* const FBUnknownBundleId = @"unknown";
121
121
  info[@"name"] = FBValueOrNull(snapshot.wdName);
122
122
  info[@"value"] = FBValueOrNull(snapshot.wdValue);
123
123
  info[@"label"] = FBValueOrNull(snapshot.wdLabel);
124
- // It is mandatory to replace all Infinity values with zeroes to avoid JSON parsing
125
- // exceptions like https://github.com/facebook/WebDriverAgent/issues/639#issuecomment-314421206
126
- // caused by broken element dimensions returned by XCTest
127
- info[@"rect"] = FBwdRectNoInf(snapshot.wdRect);
124
+ info[@"rect"] = snapshot.wdRect;
128
125
  info[@"frame"] = NSStringFromCGRect(snapshot.wdFrame);
129
126
  info[@"isEnabled"] = [@([snapshot isWDEnabled]) stringValue];
130
127
  info[@"isVisible"] = [@([snapshot isWDVisible]) stringValue];
@@ -22,6 +22,8 @@
22
22
  #import "FBElementUtils.h"
23
23
  #import "XCTestPrivateSymbols.h"
24
24
 
25
+ #define BROKEN_RECT CGRectMake(-1, -1, 0, 0)
26
+
25
27
  @implementation XCUIElement (WebDriverAttributesForwarding)
26
28
 
27
29
  - (XCElementSnapshot *)fb_snapshotForAttributeName:(NSString *)name
@@ -129,7 +131,14 @@
129
131
 
130
132
  - (CGRect)wdFrame
131
133
  {
132
- return CGRectIntegral(self.frame);
134
+ CGRect frame = self.frame;
135
+ // It is mandatory to replace all Infinity values with numbers to avoid JSON parsing
136
+ // exceptions like https://github.com/facebook/WebDriverAgent/issues/639#issuecomment-314421206
137
+ // caused by broken element dimensions returned by XCTest
138
+ return (isinf(frame.size.width) || isinf(frame.size.height)
139
+ || isinf(frame.origin.x) || isinf(frame.origin.y))
140
+ ? CGRectIntegral(BROKEN_RECT)
141
+ : CGRectIntegral(frame);
133
142
  }
134
143
 
135
144
  - (BOOL)isWDVisible
@@ -380,7 +380,8 @@
380
380
  // https://developer.apple.com/documentation/foundation/nslocale/1414388-autoupdatingcurrentlocale
381
381
  NSString *currentLocale = [[NSLocale autoupdatingCurrentLocale] localeIdentifier];
382
382
 
383
- return FBResponseWithObject(@{
383
+ NSMutableDictionary *deviceInfo = [NSMutableDictionary dictionaryWithDictionary:
384
+ @{
384
385
  @"currentLocale": currentLocale,
385
386
  @"timeZone": self.timeZone,
386
387
  @"name": UIDevice.currentDevice.name,
@@ -394,7 +395,14 @@
394
395
  #else
395
396
  @"isSimulator": @(NO),
396
397
  #endif
397
- });
398
+ }];
399
+
400
+ if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
401
+ // https://developer.apple.com/documentation/foundation/nsprocessinfothermalstate
402
+ deviceInfo[@"thermalState"] = @(NSProcessInfo.processInfo.thermalState);
403
+ }
404
+
405
+ return FBResponseWithObject(deviceInfo);
398
406
  }
399
407
 
400
408
  /**
@@ -17,10 +17,10 @@ NS_ASSUME_NONNULL_BEGIN
17
17
  */
18
18
  @protocol FBElement <NSObject>
19
19
 
20
- /*! Element's frame in CGRect format */
20
+ /*! Element's frame in normalized (rounded dimensions without Infinity values) CGRect format */
21
21
  @property (nonatomic, readonly, assign) CGRect wdFrame;
22
22
 
23
- /*! Element's frame in NSDictionary format */
23
+ /*! Element's wsFrame in NSDictionary format */
24
24
  @property (nonatomic, readonly, copy) NSDictionary *wdRect;
25
25
 
26
26
  /*! Element's name */
@@ -107,7 +107,7 @@ inline NSDictionary *FBDictionaryResponseWithElement(XCUIElement *element, BOOL
107
107
  } else if ([field isEqualToString:@"text"]) {
108
108
  dictionary[field] = FBFirstNonEmptyValue(snapshot.wdValue, snapshot.wdLabel) ?: [NSNull null];
109
109
  } else if ([field isEqualToString:@"rect"]) {
110
- dictionary[field] = FBwdRectNoInf(snapshot.wdRect);
110
+ dictionary[field] = snapshot.wdRect;
111
111
  } else if ([field isEqualToString:@"enabled"]) {
112
112
  dictionary[field] = @(snapshot.wdEnabled);
113
113
  } else if ([field isEqualToString:@"displayed"]) {
@@ -41,6 +41,3 @@ CGPoint FBInvertOffsetForOrientation(CGPoint offset, UIInterfaceOrientation orie
41
41
  /*! Inverts size if necessary to match current screen orientation */
42
42
  CGSize FBAdjustDimensionsForApplication(CGSize actualSize, UIInterfaceOrientation orientation);
43
43
  #endif
44
-
45
- /*! Replaces the wdRect dictionary passed as the argument with zero-size wdRect if any of its attributes equal to Infinity */
46
- NSDictionary<NSString *, NSNumber *> *FBwdRectNoInf(NSDictionary<NSString *, NSNumber *> *wdRect);
@@ -91,16 +91,3 @@ CGSize FBAdjustDimensionsForApplication(CGSize actualSize, UIInterfaceOrientatio
91
91
  return actualSize;
92
92
  }
93
93
  #endif
94
-
95
- NSDictionary<NSString *, NSNumber *> *FBwdRectNoInf(NSDictionary<NSString *, NSNumber *> *wdRect)
96
- {
97
- NSMutableDictionary<NSString *, NSNumber *> *result = wdRect.mutableCopy;
98
- if (isinf(result[@"x"].doubleValue) || isinf(result[@"y"].doubleValue) ||
99
- isinf(result[@"width"].doubleValue) || isinf(result[@"height"].doubleValue)) {
100
- [result setObject:@-1 forKey:@"x"];
101
- [result setObject:@-1 forKey:@"y"];
102
- [result setObject:@0 forKey:@"width"];
103
- [result setObject:@0 forKey:@"height"];
104
- }
105
- return result.copy;
106
- }
@@ -309,12 +309,6 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
309
309
  */
310
310
  - (BOOL)connectToUrl:(NSURL *)url withTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr;
311
311
 
312
- /**
313
- * Iterates over the given NetService's addresses in order, and invokes connectToAddress:error:. Stops at the
314
- * first invocation that succeeds and returns YES; otherwise returns NO.
315
- */
316
- - (BOOL)connectToNetService:(NSNetService *)netService error:(NSError **)errPtr;
317
-
318
312
  #pragma mark Disconnecting
319
313
 
320
314
  /**
@@ -2581,21 +2581,6 @@ enum GCDAsyncSocketConfig
2581
2581
  return result;
2582
2582
  }
2583
2583
 
2584
- - (BOOL)connectToNetService:(NSNetService *)netService error:(NSError **)errPtr
2585
- {
2586
- NSArray* addresses = [netService addresses];
2587
- for (NSData* address in addresses)
2588
- {
2589
- BOOL result = [self connectToAddress:address error:errPtr];
2590
- if (result)
2591
- {
2592
- return YES;
2593
- }
2594
- }
2595
-
2596
- return NO;
2597
- }
2598
-
2599
2584
  - (void)lookup:(int)aStateIndex didSucceedWithAddress4:(NSData *)address4 address6:(NSData *)address6
2600
2585
  {
2601
2586
  LogTrace();
@@ -4,17 +4,9 @@
4
4
  @class WebSocket;
5
5
 
6
6
  #if TARGET_OS_IPHONE
7
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 // iPhone 4.0
8
- #define IMPLEMENTED_PROTOCOLS <NSNetServiceDelegate>
7
+ #define IMPLEMENTED_PROTOCOLS
9
8
  #else
10
- #define IMPLEMENTED_PROTOCOLS
11
- #endif
12
- #else
13
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 // Mac OS X 10.6
14
- #define IMPLEMENTED_PROTOCOLS <NSNetServiceDelegate>
15
- #else
16
- #define IMPLEMENTED_PROTOCOLS
17
- #endif
9
+ #define IMPLEMENTED_PROTOCOLS
18
10
  #endif
19
11
 
20
12
 
@@ -34,15 +26,7 @@
34
26
  Class connectionClass;
35
27
  NSString *interface;
36
28
  UInt16 port;
37
-
38
- // NSNetService and related variables
39
- NSNetService *netService;
40
- NSString *domain;
41
- NSString *type;
42
- NSString *name;
43
- NSString *publishedName;
44
- NSDictionary *txtRecordDictionary;
45
-
29
+
46
30
  // Connection management
47
31
  NSMutableArray *connections;
48
32
  NSLock *connectionsLock;
@@ -106,64 +90,6 @@
106
90
  - (UInt16)listeningPort;
107
91
  - (void)setPort:(UInt16)value;
108
92
 
109
- /**
110
- * Bonjour domain for publishing the service.
111
- * The default value is "local.".
112
- *
113
- * Note: Bonjour publishing requires you set a type.
114
- *
115
- * If you change the domain property after the bonjour service has already been published (server already started),
116
- * you'll need to invoke the republishBonjour method to update the broadcasted bonjour service.
117
- **/
118
- - (NSString *)domain;
119
- - (void)setDomain:(NSString *)value;
120
-
121
- /**
122
- * Bonjour name for publishing the service.
123
- * The default value is "".
124
- *
125
- * If using an empty string ("") for the service name when registering,
126
- * the system will automatically use the "Computer Name".
127
- * Using an empty string will also handle name conflicts
128
- * by automatically appending a digit to the end of the name.
129
- *
130
- * Note: Bonjour publishing requires you set a type.
131
- *
132
- * If you change the name after the bonjour service has already been published (server already started),
133
- * you'll need to invoke the republishBonjour method to update the broadcasted bonjour service.
134
- *
135
- * The publishedName method will always return the actual name that was published via the bonjour service.
136
- * If the service is not running this method returns nil.
137
- **/
138
- - (NSString *)name;
139
- - (NSString *)publishedName;
140
- - (void)setName:(NSString *)value;
141
-
142
- /**
143
- * Bonjour type for publishing the service.
144
- * The default value is nil.
145
- * The service will not be published via bonjour unless the type is set.
146
- *
147
- * If you wish to publish the service as a traditional HTTP server, you should set the type to be "_http._tcp.".
148
- *
149
- * If you change the type after the bonjour service has already been published (server already started),
150
- * you'll need to invoke the republishBonjour method to update the broadcasted bonjour service.
151
- **/
152
- - (NSString *)type;
153
- - (void)setType:(NSString *)value;
154
-
155
- /**
156
- * Republishes the service via bonjour if the server is running.
157
- * If the service was not previously published, this method will publish it (if the server is running).
158
- **/
159
- - (void)republishBonjour;
160
-
161
- /**
162
- *
163
- **/
164
- - (NSDictionary *)TXTRecordDictionary;
165
- - (void)setTXTRecordDictionary:(NSDictionary *)dict;
166
-
167
93
  /**
168
94
  * Attempts to starts the server on the configured port, interface, etc.
169
95
  *