appium-webdriveragent 5.6.2 → 5.8.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.
- package/CHANGELOG.md +14 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +7 -0
- package/WebDriverAgentLib/Routing/FBElement.h +3 -0
- package/WebDriverAgentLib/Utilities/FBMacros.h +4 -0
- package/WebDriverAgentLib/Utilities/FBXPath.m +27 -4
- package/WebDriverAgentTests/IntegrationTests/FBElementAttributeTests.m +1 -0
- package/WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m +4 -3
- package/WebDriverAgentTests/IntegrationTests/XCUIElementFBFindTests.m +1 -1
- package/WebDriverAgentTests/UnitTests/Doubles/XCElementSnapshotDouble.m +6 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +2 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +2 -0
- package/WebDriverAgentTests/UnitTests/FBXPathTests.m +6 -5
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +1 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +1 -0
- package/build/index.js +39 -36
- package/build/lib/check-dependencies.d.ts +3 -0
- package/build/lib/check-dependencies.d.ts.map +1 -0
- package/build/lib/check-dependencies.js +38 -32
- package/build/lib/check-dependencies.js.map +1 -1
- package/build/lib/constants.d.ts +12 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +8 -10
- package/build/lib/constants.js.map +1 -1
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +5 -11
- package/build/lib/logger.js.map +1 -1
- package/build/lib/no-session-proxy.d.ts +6 -0
- package/build/lib/no-session-proxy.d.ts.map +1 -0
- package/build/lib/no-session-proxy.js +22 -26
- package/build/lib/no-session-proxy.js.map +1 -1
- package/build/lib/utils.d.ts +127 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +347 -211
- package/build/lib/utils.js.map +1 -1
- package/build/lib/webdriveragent.d.ts +145 -0
- package/build/lib/webdriveragent.d.ts.map +1 -0
- package/build/lib/webdriveragent.js +478 -367
- package/build/lib/webdriveragent.js.map +1 -1
- package/build/lib/xcodebuild.d.ts +58 -0
- package/build/lib/xcodebuild.d.ts.map +1 -0
- package/build/lib/xcodebuild.js +367 -289
- package/build/lib/xcodebuild.js.map +1 -1
- package/lib/check-dependencies.js +3 -4
- package/lib/utils.js +10 -7
- package/lib/webdriveragent.js +14 -9
- package/lib/xcodebuild.js +39 -7
- package/package.json +28 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [5.8.0](https://github.com/appium/WebDriverAgent/compare/v5.7.0...v5.8.0) (2023-08-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add wdHittable property ([#756](https://github.com/appium/WebDriverAgent/issues/756)) ([075298b](https://github.com/appium/WebDriverAgent/commit/075298b286c83ab5d4a2855e9e0bb915790b3f43))
|
|
7
|
+
|
|
8
|
+
## [5.7.0](https://github.com/appium/WebDriverAgent/compare/v5.6.2...v5.7.0) (2023-08-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Switch babel to typescript ([#753](https://github.com/appium/WebDriverAgent/issues/753)) ([76a4c7f](https://github.com/appium/WebDriverAgent/commit/76a4c7f066e1895acbb153ab035d6a08604277e4))
|
|
14
|
+
|
|
1
15
|
## [5.6.2](https://github.com/appium/WebDriverAgent/compare/v5.6.1...v5.6.2) (2023-08-23)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#import "XCUIElement+FBUtilities.h"
|
|
21
21
|
#import "FBElementUtils.h"
|
|
22
22
|
#import "XCTestPrivateSymbols.h"
|
|
23
|
+
#import "XCUIHitPointResult.h"
|
|
23
24
|
|
|
24
25
|
#define BROKEN_RECT CGRectMake(-1, -1, 0, 0)
|
|
25
26
|
|
|
@@ -226,6 +227,12 @@
|
|
|
226
227
|
return 0;
|
|
227
228
|
}
|
|
228
229
|
|
|
230
|
+
- (BOOL)isWDHittable
|
|
231
|
+
{
|
|
232
|
+
XCUIHitPointResult *result = [self hitPoint:nil];
|
|
233
|
+
return nil == result ? NO : result.hittable;
|
|
234
|
+
}
|
|
235
|
+
|
|
229
236
|
- (NSDictionary *)wdRect
|
|
230
237
|
{
|
|
231
238
|
CGRect frame = self.wdFrame;
|
|
@@ -56,6 +56,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
56
56
|
/*! Whether element is focused */
|
|
57
57
|
@property (nonatomic, readonly, getter = isWDFocused) BOOL wdFocused;
|
|
58
58
|
|
|
59
|
+
/*! Whether element is hittable */
|
|
60
|
+
@property (nonatomic, readonly, getter = isWDHittable) BOOL wdHittable;
|
|
61
|
+
|
|
59
62
|
/*! Element's index relatively to its parent. Starts from zero */
|
|
60
63
|
@property (nonatomic, readonly) NSUInteger wdIndex;
|
|
61
64
|
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#import "FBConfiguration.h"
|
|
13
13
|
#import "FBExceptions.h"
|
|
14
14
|
#import "FBLogger.h"
|
|
15
|
+
#import "FBMacros.h"
|
|
15
16
|
#import "FBXMLGenerationOptions.h"
|
|
16
17
|
#import "FBXCElementSnapshotWrapper+Helpers.h"
|
|
17
18
|
#import "NSString+FBXMLSafeString.h"
|
|
@@ -87,6 +88,10 @@
|
|
|
87
88
|
|
|
88
89
|
@end
|
|
89
90
|
|
|
91
|
+
@interface FBHittableAttribute : FBElementAttribute
|
|
92
|
+
|
|
93
|
+
@end
|
|
94
|
+
|
|
90
95
|
@interface FBInternalIndexAttribute : FBElementAttribute
|
|
91
96
|
|
|
92
97
|
@property (nonatomic, nonnull, readonly) NSString* indexValue;
|
|
@@ -273,6 +278,9 @@ static NSString *const topNodeIndexPath = @"top";
|
|
|
273
278
|
NSMutableSet<Class> *includedAttributes;
|
|
274
279
|
if (nil == query) {
|
|
275
280
|
includedAttributes = [NSMutableSet setWithArray:FBElementAttribute.supportedAttributes];
|
|
281
|
+
// The hittable attribute is expensive to calculate for each snapshot item
|
|
282
|
+
// thus we only include it when requested by an xPath query
|
|
283
|
+
[includedAttributes removeObject:FBHittableAttribute.class];
|
|
276
284
|
if (nil != excludedAttributes) {
|
|
277
285
|
for (NSString *excludedAttributeName in excludedAttributes) {
|
|
278
286
|
for (Class supportedAttribute in FBElementAttribute.supportedAttributes) {
|
|
@@ -481,6 +489,7 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
|
|
|
481
489
|
FBWidthAttribute.class,
|
|
482
490
|
FBHeightAttribute.class,
|
|
483
491
|
FBIndexAttribute.class,
|
|
492
|
+
FBHittableAttribute.class,
|
|
484
493
|
];
|
|
485
494
|
}
|
|
486
495
|
|
|
@@ -557,7 +566,7 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
|
|
|
557
566
|
|
|
558
567
|
+ (NSString *)valueForElement:(id<FBElement>)element
|
|
559
568
|
{
|
|
560
|
-
return element.wdEnabled
|
|
569
|
+
return FBBoolToString(element.wdEnabled);
|
|
561
570
|
}
|
|
562
571
|
|
|
563
572
|
@end
|
|
@@ -571,7 +580,7 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
|
|
|
571
580
|
|
|
572
581
|
+ (NSString *)valueForElement:(id<FBElement>)element
|
|
573
582
|
{
|
|
574
|
-
return element.wdVisible
|
|
583
|
+
return FBBoolToString(element.wdVisible);
|
|
575
584
|
}
|
|
576
585
|
|
|
577
586
|
@end
|
|
@@ -585,7 +594,7 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
|
|
|
585
594
|
|
|
586
595
|
+ (NSString *)valueForElement:(id<FBElement>)element
|
|
587
596
|
{
|
|
588
|
-
return element.wdAccessible
|
|
597
|
+
return FBBoolToString(element.wdAccessible);
|
|
589
598
|
}
|
|
590
599
|
|
|
591
600
|
@end
|
|
@@ -601,7 +610,7 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
|
|
|
601
610
|
|
|
602
611
|
+ (NSString *)valueForElement:(id<FBElement>)element
|
|
603
612
|
{
|
|
604
|
-
return element.wdFocused
|
|
613
|
+
return FBBoolToString(element.wdFocused);
|
|
605
614
|
}
|
|
606
615
|
|
|
607
616
|
@end
|
|
@@ -667,6 +676,20 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
|
|
|
667
676
|
|
|
668
677
|
@end
|
|
669
678
|
|
|
679
|
+
@implementation FBHittableAttribute
|
|
680
|
+
|
|
681
|
+
+ (NSString *)name
|
|
682
|
+
{
|
|
683
|
+
return @"hittable";
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
+ (NSString *)valueForElement:(id<FBElement>)element
|
|
687
|
+
{
|
|
688
|
+
return FBBoolToString(element.wdHittable);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
@end
|
|
692
|
+
|
|
670
693
|
@implementation FBInternalIndexAttribute
|
|
671
694
|
|
|
672
695
|
+ (NSString *)name
|
|
@@ -160,6 +160,7 @@
|
|
|
160
160
|
XCTAssertNil(element.wdLabel);
|
|
161
161
|
XCTAssertEqualObjects(element.wdValue, @"1");
|
|
162
162
|
XCTAssertFalse(element.wdSelected);
|
|
163
|
+
XCTAssertTrue(element.wdHittable);
|
|
163
164
|
[element tap];
|
|
164
165
|
XCTAssertEqualObjects(element.wdValue, @"0");
|
|
165
166
|
XCTAssertFalse(element.wdSelected);
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <XCTest/XCTest.h>
|
|
11
11
|
|
|
12
12
|
#import "FBIntegrationTestCase.h"
|
|
13
|
+
#import "FBMacros.h"
|
|
13
14
|
#import "FBTestMacros.h"
|
|
14
15
|
#import "FBXPath.h"
|
|
15
16
|
#import "FBXCodeCompatibility.h"
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
|
|
59
60
|
options:nil];
|
|
60
61
|
XCTAssertNotNil(xmlStr);
|
|
61
|
-
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, wrappedSnapshot.wdEnabled
|
|
62
|
+
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex];
|
|
62
63
|
XCTAssertEqualObjects(xmlStr, expectedXml);
|
|
63
64
|
}
|
|
64
65
|
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
|
|
72
73
|
options:options];
|
|
73
74
|
XCTAssertNotNil(xmlStr);
|
|
74
|
-
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@>\n <%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n</%@>\n", scope, wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, wrappedSnapshot.wdEnabled
|
|
75
|
+
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@>\n <%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n</%@>\n", scope, wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex, scope];
|
|
75
76
|
XCTAssertEqualObjects(xmlStr, expectedXml);
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
|
|
85
86
|
options:options];
|
|
86
87
|
XCTAssertNotNil(xmlStr);
|
|
87
|
-
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, wrappedSnapshot.wdAccessible
|
|
88
|
+
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue]];
|
|
88
89
|
XCTAssertEqualObjects(xmlStr, expectedXml);
|
|
89
90
|
}
|
|
90
91
|
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
|
|
128
128
|
- (void)testSingleDescendantWithXPathQuery
|
|
129
129
|
{
|
|
130
|
-
NSArray<XCUIElement *> *matchingSnapshots = [self.testedApplication fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton"
|
|
130
|
+
NSArray<XCUIElement *> *matchingSnapshots = [self.testedApplication fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@hittable='true']"
|
|
131
131
|
shouldReturnAfterFirstMatch:YES];
|
|
132
132
|
XCTAssertEqual(matchingSnapshots.count, 1);
|
|
133
133
|
XCUIElement *matchingSnapshot = [matchingSnapshots firstObject];
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
#import "FBXCAccessibilityElement.h"
|
|
13
13
|
#import "FBXCElementSnapshot.h"
|
|
14
|
+
#import "XCUIHitPointResult.h"
|
|
14
15
|
|
|
15
16
|
@implementation XCElementSnapshotDouble
|
|
16
17
|
|
|
@@ -87,6 +88,11 @@
|
|
|
87
88
|
return nil;
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
- (XCUIHitPointResult *)hitPoint:(NSError **)error
|
|
92
|
+
{
|
|
93
|
+
return [[XCUIHitPointResult alloc] initWithHitPoint:CGPointZero hittable:YES];
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
- (NSArray *)children
|
|
91
97
|
{
|
|
92
98
|
return @[];
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
@property (nonatomic, readwrite) NSUInteger wdIndex;
|
|
33
33
|
@property (nonatomic, readwrite, getter=isWDVisible) BOOL wdVisible;
|
|
34
34
|
@property (nonatomic, readwrite, getter=isWDAccessible) BOOL wdAccessible;
|
|
35
|
+
@property (nonatomic, readwrite, getter = isWDFocused) BOOL wdFocused;
|
|
36
|
+
@property (nonatomic, readwrite, getter = isWDHittable) BOOL wdHittable;
|
|
35
37
|
@property (copy, nonnull) NSArray *children;
|
|
36
38
|
@property (nonatomic, readwrite, assign) XCUIElementType elementType;
|
|
37
39
|
@property (nonatomic, readwrite, getter=isWDAccessibilityContainer) BOOL wdAccessibilityContainer;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
#import <XCTest/XCTest.h>
|
|
11
11
|
|
|
12
|
+
#import "FBMacros.h"
|
|
12
13
|
#import "FBXPath.h"
|
|
13
14
|
#import "FBXPath-Private.h"
|
|
14
15
|
#import "XCUIElementDouble.h"
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
xpathQuery:nil
|
|
64
65
|
excludingAttributes:nil];
|
|
65
66
|
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" value=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" private_indexPath=\"top\"/>\n",
|
|
66
|
-
element.wdType, element.wdType, element.wdValue, element.wdName, element.wdLabel, element.wdEnabled
|
|
67
|
+
element.wdType, element.wdType, element.wdValue, element.wdName, element.wdLabel, FBBoolToString(element.wdEnabled), FBBoolToString(element.wdVisible), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"], element.wdIndex];
|
|
67
68
|
XCTAssertTrue([resultXml isEqualToString: expectedXml]);
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
xpathQuery:nil
|
|
76
77
|
excludingAttributes:@[@"type", @"visible", @"value", @"index"]];
|
|
77
78
|
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ name=\"%@\" label=\"%@\" enabled=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" private_indexPath=\"top\"/>\n",
|
|
78
|
-
element.wdType, element.wdName, element.wdLabel,
|
|
79
|
+
element.wdType, element.wdName, element.wdLabel, FBBoolToString(element.wdEnabled), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"]];
|
|
79
80
|
XCTAssertEqualObjects(resultXml, expectedXml);
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -88,9 +89,9 @@
|
|
|
88
89
|
NSString *resultXml = [self xmlStringWithElement:element
|
|
89
90
|
xpathQuery:[NSString stringWithFormat:@"//%@[@*]", element.wdType]
|
|
90
91
|
excludingAttributes:@[@"visible"]];
|
|
91
|
-
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" value=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" private_indexPath=\"top\"/>\n",
|
|
92
|
-
element.wdType, element.wdType, @"йоло<>&"", element.wdName, @"a b", element.wdEnabled
|
|
93
|
-
|
|
92
|
+
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" value=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" hittable=\"%@\" private_indexPath=\"top\"/>\n",
|
|
93
|
+
element.wdType, element.wdType, @"йоло<>&"", element.wdName, @"a b", FBBoolToString(element.wdEnabled), FBBoolToString(element.wdVisible), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"], element.wdIndex, FBBoolToString(element.wdHittable)];
|
|
94
|
+
XCTAssertEqualObjects(expectedXml, resultXml);
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
- (void)testXPathPresentationBasedOnQueryMatchingSomeAttributes
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
@property (nonatomic, readwrite, getter=isWDVisible) BOOL wdVisible;
|
|
33
33
|
@property (nonatomic, readwrite, getter=isWDAccessible) BOOL wdAccessible;
|
|
34
34
|
@property (nonatomic, readwrite, getter=isWDFocused) BOOL wdFocused;
|
|
35
|
+
@property (nonatomic, readwrite, getter = isWDHittable) BOOL wdHittable;
|
|
35
36
|
@property (copy, nonnull) NSArray *children;
|
|
36
37
|
@property (nonatomic, readwrite, assign) XCUIElementType elementType;
|
|
37
38
|
@property (nonatomic, readwrite, getter=isWDAccessibilityContainer) BOOL wdAccessibilityContainer;
|
package/build/index.js
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
5
17
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.WDA_BASE_URL = exports.PROJECT_FILE = exports.WDA_RUNNER_BUNDLE_ID = exports.BOOTSTRAP_PATH = exports.resetTestProcesses = exports.bundleWDASim = exports.checkForDependencies = exports.NoSessionProxy = exports.WebDriverAgent = void 0;
|
|
27
|
+
const dependencies = __importStar(require("./lib/check-dependencies"));
|
|
28
|
+
const proxies = __importStar(require("./lib/no-session-proxy"));
|
|
29
|
+
const driver = __importStar(require("./lib/webdriveragent"));
|
|
30
|
+
const constants = __importStar(require("./lib/constants"));
|
|
31
|
+
const utils = __importStar(require("./lib/utils"));
|
|
32
|
+
const { checkForDependencies, bundleWDASim } = dependencies;
|
|
20
33
|
exports.checkForDependencies = checkForDependencies;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = proxies;
|
|
34
|
+
exports.bundleWDASim = bundleWDASim;
|
|
35
|
+
const { NoSessionProxy } = proxies;
|
|
24
36
|
exports.NoSessionProxy = NoSessionProxy;
|
|
25
|
-
const {
|
|
26
|
-
WebDriverAgent
|
|
27
|
-
} = driver;
|
|
37
|
+
const { WebDriverAgent } = driver;
|
|
28
38
|
exports.WebDriverAgent = WebDriverAgent;
|
|
29
|
-
const {
|
|
30
|
-
WDA_BASE_URL,
|
|
31
|
-
WDA_RUNNER_BUNDLE_ID,
|
|
32
|
-
PROJECT_FILE
|
|
33
|
-
} = constants;
|
|
34
|
-
exports.PROJECT_FILE = PROJECT_FILE;
|
|
35
|
-
exports.WDA_RUNNER_BUNDLE_ID = WDA_RUNNER_BUNDLE_ID;
|
|
39
|
+
const { WDA_BASE_URL, WDA_RUNNER_BUNDLE_ID, PROJECT_FILE } = constants;
|
|
36
40
|
exports.WDA_BASE_URL = WDA_BASE_URL;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = utils;
|
|
41
|
-
exports.BOOTSTRAP_PATH = BOOTSTRAP_PATH;
|
|
41
|
+
exports.WDA_RUNNER_BUNDLE_ID = WDA_RUNNER_BUNDLE_ID;
|
|
42
|
+
exports.PROJECT_FILE = PROJECT_FILE;
|
|
43
|
+
const { resetTestProcesses, BOOTSTRAP_PATH } = utils;
|
|
42
44
|
exports.resetTestProcesses = resetTestProcesses;
|
|
43
|
-
|
|
45
|
+
exports.BOOTSTRAP_PATH = BOOTSTRAP_PATH;
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-dependencies.d.ts","sourceRoot":"","sources":["../../lib/check-dependencies.js"],"names":[],"mappings":"AAwBA,yDAGC;AAED,+DAYC"}
|
|
@@ -1,39 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
require("
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _constants = require("./constants");
|
|
16
|
-
var _utils = require("./utils");
|
|
17
|
-
var _logger = _interopRequireDefault(require("./logger"));
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.bundleWDASim = exports.checkForDependencies = void 0;
|
|
7
|
+
const support_1 = require("@appium/support");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const teen_process_1 = require("teen_process");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const xcodebuild_1 = __importDefault(require("./xcodebuild"));
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
const utils_1 = require("./utils");
|
|
14
|
+
const logger_1 = __importDefault(require("./logger"));
|
|
18
15
|
async function buildWDASim() {
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
const args = [
|
|
17
|
+
'-project', path_1.default.join(utils_1.BOOTSTRAP_PATH, 'WebDriverAgent.xcodeproj'),
|
|
18
|
+
'-scheme', constants_1.WDA_SCHEME,
|
|
19
|
+
'-sdk', constants_1.SDK_SIMULATOR,
|
|
20
|
+
'CODE_SIGN_IDENTITY=""',
|
|
21
|
+
'CODE_SIGNING_REQUIRED="NO"',
|
|
22
|
+
'GCC_TREAT_WARNINGS_AS_ERRORS=0',
|
|
23
|
+
];
|
|
24
|
+
await (0, teen_process_1.exec)('xcodebuild', args);
|
|
21
25
|
}
|
|
26
|
+
// eslint-disable-next-line require-await
|
|
22
27
|
async function checkForDependencies() {
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
logger_1.default.debug('Dependencies are up to date');
|
|
29
|
+
return false;
|
|
25
30
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
xcodebuild
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
exports.checkForDependencies = checkForDependencies;
|
|
32
|
+
async function bundleWDASim(xcodebuild) {
|
|
33
|
+
if (xcodebuild && !lodash_1.default.isFunction(xcodebuild.retrieveDerivedDataPath)) {
|
|
34
|
+
xcodebuild = new xcodebuild_1.default('', {});
|
|
35
|
+
}
|
|
36
|
+
const derivedDataPath = await xcodebuild.retrieveDerivedDataPath();
|
|
37
|
+
const wdaBundlePath = path_1.default.join(derivedDataPath, 'Build', 'Products', 'Debug-iphonesimulator', constants_1.WDA_RUNNER_APP);
|
|
38
|
+
if (await support_1.fs.exists(wdaBundlePath)) {
|
|
39
|
+
return wdaBundlePath;
|
|
40
|
+
}
|
|
41
|
+
await buildWDASim();
|
|
34
42
|
return wdaBundlePath;
|
|
35
|
-
}
|
|
36
|
-
await buildWDASim(xcodebuild, opts);
|
|
37
|
-
return wdaBundlePath;
|
|
38
43
|
}
|
|
39
|
-
|
|
44
|
+
exports.bundleWDASim = bundleWDASim;
|
|
45
|
+
//# sourceMappingURL=check-dependencies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-dependencies.js","
|
|
1
|
+
{"version":3,"file":"check-dependencies.js","sourceRoot":"","sources":["../../lib/check-dependencies.js"],"names":[],"mappings":";;;;;;AAAA,6CAAqC;AACrC,oDAAuB;AACvB,+CAAoC;AACpC,gDAAwB;AACxB,8DAAsC;AACtC,2CAEqB;AACrB,mCAAyC;AACzC,sDAA2B;AAE3B,KAAK,UAAU,WAAW;IACxB,MAAM,IAAI,GAAG;QACX,UAAU,EAAE,cAAI,CAAC,IAAI,CAAC,sBAAc,EAAE,0BAA0B,CAAC;QACjE,SAAS,EAAE,sBAAU;QACrB,MAAM,EAAE,yBAAa;QACrB,uBAAuB;QACvB,4BAA4B;QAC5B,gCAAgC;KACjC,CAAC;IACF,MAAM,IAAA,mBAAI,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,yCAAyC;AACzC,KAAK,UAAU,oBAAoB;IACjC,gBAAG,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC;AAgBQ,oDAAoB;AAd7B,KAAK,UAAU,YAAY,CAAE,UAAU;IACrC,IAAI,UAAU,IAAI,CAAC,gBAAC,CAAC,UAAU,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE;QACnE,UAAU,GAAG,IAAI,oBAAU,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;KACrC;IAED,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,uBAAuB,EAAE,CAAC;IACnE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,0BAAc,CAAC,CAAC;IAC/G,IAAI,MAAM,YAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAClC,OAAO,aAAa,CAAC;KACtB;IACD,MAAM,WAAW,EAAE,CAAC;IACpB,OAAO,aAAa,CAAC;AACvB,CAAC;AAE8B,oCAAY"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const WDA_RUNNER_BUNDLE_ID: "com.facebook.WebDriverAgentRunner";
|
|
2
|
+
export const WDA_RUNNER_APP: "WebDriverAgentRunner-Runner.app";
|
|
3
|
+
export const PROJECT_FILE: "project.pbxproj";
|
|
4
|
+
export const WDA_SCHEME: "WebDriverAgentRunner";
|
|
5
|
+
export const PLATFORM_NAME_TVOS: "tvOS";
|
|
6
|
+
export const PLATFORM_NAME_IOS: "iOS";
|
|
7
|
+
export const SDK_SIMULATOR: "iphonesimulator";
|
|
8
|
+
export const SDK_DEVICE: "iphoneos";
|
|
9
|
+
export const WDA_BASE_URL: "http://127.0.0.1";
|
|
10
|
+
export const WDA_UPGRADE_TIMESTAMP_PATH: string;
|
|
11
|
+
export const WDA_RUNNER_BUNDLE_ID_FOR_XCTEST: "com.facebook.WebDriverAgentRunner.xctrunner";
|
|
12
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../lib/constants.js"],"names":[],"mappings":"AAEA,uEAAiE;AAEjE,+DAAyD;AAEzD,6CAAuC;AADvC,gDAA0C;AAI1C,wCAAkC;AAClC,sCAAgC;AAEhC,8CAAwC;AACxC,oCAA8B;AAN9B,8CAAwC;AAQxC,gDAA0F;AAZ1F,4FAA4E"}
|
package/build/lib/constants.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
require("source-map-support/register");
|
|
9
|
-
var _path = _interopRequireDefault(require("path"));
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WDA_RUNNER_BUNDLE_ID_FOR_XCTEST = exports.WDA_UPGRADE_TIMESTAMP_PATH = exports.WDA_BASE_URL = exports.SDK_DEVICE = exports.SDK_SIMULATOR = exports.PLATFORM_NAME_IOS = exports.PLATFORM_NAME_TVOS = exports.WDA_SCHEME = exports.PROJECT_FILE = exports.WDA_RUNNER_APP = exports.WDA_RUNNER_BUNDLE_ID = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
10
8
|
const WDA_RUNNER_BUNDLE_ID = 'com.facebook.WebDriverAgentRunner';
|
|
11
9
|
exports.WDA_RUNNER_BUNDLE_ID = WDA_RUNNER_BUNDLE_ID;
|
|
12
10
|
const WDA_RUNNER_BUNDLE_ID_FOR_XCTEST = `${WDA_RUNNER_BUNDLE_ID}.xctrunner`;
|
|
@@ -27,6 +25,6 @@ const SDK_SIMULATOR = 'iphonesimulator';
|
|
|
27
25
|
exports.SDK_SIMULATOR = SDK_SIMULATOR;
|
|
28
26
|
const SDK_DEVICE = 'iphoneos';
|
|
29
27
|
exports.SDK_DEVICE = SDK_DEVICE;
|
|
30
|
-
const WDA_UPGRADE_TIMESTAMP_PATH =
|
|
28
|
+
const WDA_UPGRADE_TIMESTAMP_PATH = path_1.default.join('.appium', 'webdriveragent', 'upgrade.time');
|
|
31
29
|
exports.WDA_UPGRADE_TIMESTAMP_PATH = WDA_UPGRADE_TIMESTAMP_PATH;
|
|
32
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../lib/constants.js"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAgB/D,oDAAoB;AAftB,MAAM,+BAA+B,GAAG,GAAG,oBAAoB,YAAY,CAAC;AAkB1E,0EAA+B;AAjBjC,MAAM,cAAc,GAAG,iCAAiC,CAAC;AAcjC,wCAAc;AAbtC,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAcxC,gCAAU;AAbZ,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAYC,oCAAY;AAXpD,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAaX,oCAAY;AAXzC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAUpB,gDAAkB;AAThC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AASE,8CAAiB;AAPnD,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAQtC,sCAAa;AAPf,MAAM,UAAU,GAAG,UAAU,CAAC;AAOb,gCAAU;AAL3B,MAAM,0BAA0B,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAK/C,gEAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/logger.js"],"names":[],"mappings":";AAEA,wDAA+C"}
|
package/build/lib/logger.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require("source-map-support/register");
|
|
8
|
-
var _support = require("@appium/support");
|
|
9
|
-
const log = _support.logger.getLogger('WebDriverAgent');
|
|
10
|
-
var _default = log;
|
|
11
|
-
exports.default = _default;
|
|
12
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfc3VwcG9ydCIsInJlcXVpcmUiLCJsb2ciLCJsb2dnZXIiLCJnZXRMb2dnZXIiLCJfZGVmYXVsdCIsImV4cG9ydHMiLCJkZWZhdWx0Il0sInNvdXJjZXMiOlsiLi4vLi4vbGliL2xvZ2dlci5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBsb2dnZXIgfSBmcm9tICdAYXBwaXVtL3N1cHBvcnQnO1xuXG5jb25zdCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdXZWJEcml2ZXJBZ2VudCcpO1xuXG5leHBvcnQgZGVmYXVsdCBsb2c7XG4iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQSxJQUFBQSxRQUFBLEdBQUFDLE9BQUE7QUFFQSxNQUFNQyxHQUFHLEdBQUdDLGVBQU0sQ0FBQ0MsU0FBUyxDQUFDLGdCQUFnQixDQUFDO0FBQUMsSUFBQUMsUUFBQSxHQUVoQ0gsR0FBRztBQUFBSSxPQUFBLENBQUFDLE9BQUEsR0FBQUYsUUFBQSJ9
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const support_1 = require("@appium/support");
|
|
4
|
+
const log = support_1.logger.getLogger('WebDriverAgent');
|
|
5
|
+
exports.default = log;
|
|
6
|
+
//# sourceMappingURL=logger.js.map
|