appium-webdriveragent 3.9.2 → 3.12.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 (65) hide show
  1. package/PrivateHeaders/.DS_Store +0 -0
  2. package/PrivateHeaders/XCTest/XCTestManager_ManagerInterface-Protocol.h +3 -0
  3. package/README.md +0 -1
  4. package/WebDriverAgent.xcodeproj/project.pbxproj +56 -56
  5. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/elf.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  6. package/WebDriverAgent.xcodeproj/xcuserdata/elf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +51 -0
  7. package/WebDriverAgent.xcodeproj/xcuserdata/{kazuaki.xcuserdatad → elf.xcuserdatad}/xcschemes/xcschememanagement.plist +23 -8
  8. package/WebDriverAgentLib/.DS_Store +0 -0
  9. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +0 -17
  10. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +0 -16
  11. package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +28 -14
  12. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.h +37 -0
  13. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.m +51 -0
  14. package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +8 -2
  15. package/WebDriverAgentLib/Commands/FBElementCommands.m +3 -1
  16. package/WebDriverAgentLib/Commands/FBOrientationCommands.m +20 -9
  17. package/WebDriverAgentLib/Commands/FBSessionCommands.m +119 -99
  18. package/WebDriverAgentLib/FBApplication.m +1 -1
  19. package/WebDriverAgentLib/Routing/FBElementCache.m +42 -11
  20. package/WebDriverAgentLib/Routing/FBResponsePayload.m +9 -3
  21. package/WebDriverAgentLib/Routing/FBSession.h +6 -0
  22. package/WebDriverAgentLib/Routing/FBSession.m +45 -55
  23. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.h +1 -3
  24. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.m +6 -13
  25. package/WebDriverAgentLib/Utilities/FBCapabilities.h +23 -0
  26. package/WebDriverAgentLib/Utilities/FBCapabilities.m +23 -0
  27. package/WebDriverAgentLib/Utilities/FBConfiguration.m +6 -1
  28. package/WebDriverAgentLib/Utilities/FBScreenshot.m +125 -14
  29. package/WebDriverAgentLib/Utilities/FBSettings.h +23 -23
  30. package/WebDriverAgentLib/Utilities/FBSettings.m +23 -23
  31. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +16 -0
  32. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +16 -0
  33. package/WebDriverAgentLib/Utilities/FBXPath.m +15 -44
  34. package/WebDriverAgentLib/Utilities/LRUCache/.DS_Store +0 -0
  35. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.h +59 -0
  36. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.m +104 -0
  37. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.h +43 -0
  38. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.m +59 -0
  39. package/WebDriverAgentLib/Vendor/.DS_Store +0 -0
  40. package/WebDriverAgentRunner/.DS_Store +0 -0
  41. package/WebDriverAgentRunner-Runner.app.zip +0 -0
  42. package/WebDriverAgentTests/IntegrationApp/Resources/.DS_Store +0 -0
  43. package/WebDriverAgentTests/IntegrationTests/FBSessionIntegrationTests.m +20 -16
  44. package/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +2 -1
  45. package/WebDriverAgentTests/IntegrationTests/XCUIElementFBFindTests.m +11 -0
  46. package/WebDriverAgentTests/UnitTests/Doubles/FBApplicationDouble.h +3 -0
  47. package/WebDriverAgentTests/UnitTests/Doubles/FBApplicationDouble.m +15 -0
  48. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +1 -0
  49. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +1 -0
  50. package/WebDriverAgentTests/UnitTests/FBSessionTests.m +11 -1
  51. package/WebDriverAgentTests/UnitTests/FBXPathTests.m +3 -1
  52. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +1 -0
  53. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +1 -0
  54. package/package.json +3 -3
  55. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  56. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/WorkspaceSettings.xcsettings +0 -20
  57. package/WebDriverAgent.xcodeproj/xcuserdata/kazuaki.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -906
  58. package/WebDriverAgentLib/Vendor/YYCache/YYCache.h +0 -206
  59. package/WebDriverAgentLib/Vendor/YYCache/YYCache.m +0 -140
  60. package/WebDriverAgentLib/Vendor/YYCache/YYDiskCache.h +0 -412
  61. package/WebDriverAgentLib/Vendor/YYCache/YYDiskCache.m +0 -462
  62. package/WebDriverAgentLib/Vendor/YYCache/YYKVStorage.h +0 -325
  63. package/WebDriverAgentLib/Vendor/YYCache/YYKVStorage.m +0 -1068
  64. package/WebDriverAgentLib/Vendor/YYCache/YYMemoryCache.h +0 -213
  65. package/WebDriverAgentLib/Vendor/YYCache/YYMemoryCache.m +0 -508
@@ -18,6 +18,7 @@
18
18
  #import "XCElementSnapshot+FBHelpers.h"
19
19
  #import "XCUIElement+FBIsVisible.h"
20
20
  #import "XCUIElement+FBClassChain.h"
21
+ #import "XCUIElement+FBResolve.h"
21
22
  #import "FBXPath.h"
22
23
  #import "FBXCodeCompatibility.h"
23
24
 
@@ -86,6 +87,16 @@
86
87
  XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts");
87
88
  }
88
89
 
90
+ - (void)testStableInstance
91
+ {
92
+ NSArray<XCUIElement *> *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"Alerts" shouldReturnAfterFirstMatch:YES];
93
+ XCTAssertEqual(matchingSnapshots.count, 1);
94
+ for (XCUIElement *el in @[matchingSnapshots.lastObject, matchingSnapshots.lastObject.fb_stableInstance]) {
95
+ XCTAssertEqual(el.elementType, XCUIElementTypeButton);
96
+ XCTAssertEqualObjects(el.label, @"Alerts");
97
+ }
98
+ }
99
+
89
100
  - (void)testSingleDescendantWithMissingIdentifier
90
101
  {
91
102
  NSArray<XCUIElement *> *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"blabla" shouldReturnAfterFirstMatch:YES];
@@ -12,4 +12,7 @@
12
12
  @interface FBApplicationDouble : NSObject
13
13
  @property (nonatomic, assign, readonly) BOOL didTerminate;
14
14
  @property (nonatomic, strong) NSString* bundleID;
15
+ @property (nonatomic) BOOL fb_shouldWaitForQuiescence;
16
+
17
+ - (BOOL)running;
15
18
  @end
@@ -49,4 +49,19 @@
49
49
  return nil;
50
50
  }
51
51
 
52
+ - (BOOL)fb_shouldWaitForQuiescence
53
+ {
54
+ return NO;
55
+ }
56
+
57
+ -(void)setFb_shouldWaitForQuiescence:(BOOL)value
58
+ {
59
+
60
+ }
61
+
62
+ - (BOOL)running
63
+ {
64
+ return NO;
65
+ }
66
+
52
67
  @end
@@ -16,6 +16,7 @@
16
16
  @interface XCUIElementDouble : NSObject<FBElement>
17
17
  @property (nonatomic, strong, nonnull) XCUIApplication *application;
18
18
  @property (nonatomic, readwrite, assign) CGRect frame;
19
+ @property (nonatomic, readwrite, nullable) id lastSnapshot;
19
20
  @property (nonatomic, assign) BOOL fb_isObstructedByAlert;
20
21
  @property (nonatomic, readonly, nonnull) NSString *fb_cacheId;
21
22
  @property (nonatomic, nullable) NSNumber *fb_isResolvedFromCache;
@@ -41,6 +41,7 @@
41
41
  self.elementType = XCUIElementTypeOther;
42
42
  self.wdType = @"XCUIElementTypeOther";
43
43
  self.wdUID = @"0";
44
+ self.lastSnapshot = nil;
44
45
  }
45
46
  return self;
46
47
  }
@@ -11,10 +11,12 @@
11
11
 
12
12
  #import "FBApplicationDouble.h"
13
13
  #import "FBSession.h"
14
+ #import "FBConfiguration.h"
14
15
 
15
16
  @interface FBSessionTests : XCTestCase
16
17
  @property (nonatomic, strong) FBSession *session;
17
18
  @property (nonatomic, strong) FBApplication *testedApplication;
19
+ @property (nonatomic) BOOL shouldTerminateAppValue;
18
20
  @end
19
21
 
20
22
  @implementation FBSessionTests
@@ -23,9 +25,18 @@
23
25
  {
24
26
  [super setUp];
25
27
  self.testedApplication = (id)FBApplicationDouble.new;
28
+ self.shouldTerminateAppValue = FBConfiguration.shouldTerminateApp;
29
+ [FBConfiguration setShouldTerminateApp:NO];
26
30
  self.session = [FBSession initWithApplication:self.testedApplication];
27
31
  }
28
32
 
33
+ - (void)tearDown
34
+ {
35
+ [self.session kill];
36
+ [FBConfiguration setShouldTerminateApp:self.shouldTerminateAppValue];
37
+ [super tearDown];
38
+ }
39
+
29
40
  - (void)testSessionFetching
30
41
  {
31
42
  FBSession *fetchedSession = [FBSession sessionWithIdentifier:self.session.identifier];
@@ -51,7 +62,6 @@
51
62
  - (void)testActiveSessionIsNilAfterKilling
52
63
  {
53
64
  [self.session kill];
54
- XCTAssertTrue(((FBApplicationDouble *)self.testedApplication).didTerminate);
55
65
  XCTAssertNil([FBSession activeSession]);
56
66
  }
57
67
 
@@ -42,7 +42,9 @@
42
42
  XCTAssertEqual(rc, 0);
43
43
  XCTAssertEqual(1, [elementStore count]);
44
44
 
45
- return [NSString stringWithCString:(const char *)xmlbuff encoding:NSUTF8StringEncoding];
45
+ NSString *result = [NSString stringWithCString:(const char *)xmlbuff encoding:NSUTF8StringEncoding];
46
+ xmlFree(xmlbuff);
47
+ return result;
46
48
  }
47
49
 
48
50
  - (void)testDefaultXPathPresentation
@@ -16,6 +16,7 @@
16
16
  @interface XCUIElementDouble : NSObject<FBElement>
17
17
  @property (nonatomic, strong, nonnull) XCUIApplication *application;
18
18
  @property (nonatomic, readwrite, assign) CGRect frame;
19
+ @property (nonatomic, readwrite, nullable) id lastSnapshot;
19
20
  @property (nonatomic, assign) BOOL fb_isObstructedByAlert;
20
21
  @property (nonatomic, nullable) NSNumber *fb_isResolvedFromCache;
21
22
  @property (nonatomic, readwrite, copy, nonnull) NSDictionary *wdRect;
@@ -41,6 +41,7 @@
41
41
  self.elementType = XCUIElementTypeOther;
42
42
  self.wdType = @"XCUIElementTypeOther";
43
43
  self.wdUID = @"0";
44
+ self.lastSnapshot = nil;
44
45
  }
45
46
  return self;
46
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "3.9.2",
3
+ "version": "3.12.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -52,9 +52,9 @@
52
52
  "glob": "^7.1.0",
53
53
  "gulp": "^4.0.2",
54
54
  "ios-uicatalog": "^3.5.0",
55
- "mocha": "^8.0.1",
55
+ "mocha": "^9.0.0",
56
56
  "pre-commit": "^1.2.2",
57
- "sinon": "^10.0.0",
57
+ "sinon": "^11.0.0",
58
58
  "wd": "^1.11.4"
59
59
  },
60
60
  "dependencies": {
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>BuildLocationStyle</key>
6
- <string>UseAppPreferences</string>
7
- <key>CustomBuildLocationType</key>
8
- <string>RelativeToDerivedData</string>
9
- <key>DerivedDataLocationStyle</key>
10
- <string>Default</string>
11
- <key>EnabledFullIndexStoreVisibility</key>
12
- <false/>
13
- <key>IssueFilterStyle</key>
14
- <string>ShowActiveSchemeOnly</string>
15
- <key>LiveSourceIssuesEnabled</key>
16
- <true/>
17
- <key>ShowSharedSchemesAutomaticallyEnabled</key>
18
- <true/>
19
- </dict>
20
- </plist>