appium-webdriveragent 4.7.0 → 4.8.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/PrivateHeaders/XCTest/XCAXClient_iOS.h +2 -4
- package/PrivateHeaders/XCTest/XCActivityRecord.h +3 -3
- package/PrivateHeaders/XCTest/XCApplicationQuery.h +3 -3
- package/PrivateHeaders/XCTest/XCTElementSetTransformer-Protocol.h +2 -2
- package/PrivateHeaders/XCTest/XCTRunnerDaemonSession.h +1 -1
- package/PrivateHeaders/XCTest/XCTestManager_IDEInterface-Protocol.h +5 -5
- package/PrivateHeaders/XCTest/XCTestManager_ManagerInterface-Protocol.h +8 -8
- package/PrivateHeaders/XCTest/XCUIApplication.h +2 -2
- package/PrivateHeaders/XCTest/XCUIApplicationImpl.h +2 -2
- package/PrivateHeaders/XCTest/XCUIApplicationProcess.h +3 -5
- package/PrivateHeaders/XCTest/XCUIElement.h +3 -3
- package/PrivateHeaders/XCTest/XCUIElementQuery.h +4 -4
- package/PrivateHeaders/XCTest/XCUIRecorderNodeFinder.h +3 -3
- package/PrivateHeaders/XCTest/XCUIRecorderUtilities.h +3 -3
- package/Scripts/build.sh +3 -6
- package/WebDriverAgent.xcodeproj/project.pbxproj +66 -70
- package/WebDriverAgentLib/Categories/{XCElementSnapshot+FBHelpers.h → FBXCElementSnapshotWrapper+Helpers.h} +18 -11
- package/WebDriverAgentLib/Categories/{XCElementSnapshot+FBHelpers.m → FBXCElementSnapshotWrapper+Helpers.m} +57 -39
- package/WebDriverAgentLib/Categories/NSExpression+FBFormat.m +8 -3
- package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.m +8 -7
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +2 -2
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +29 -28
- package/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.m +5 -0
- package/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.m +0 -1
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +8 -5
- package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.h +2 -2
- package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.m +5 -4
- package/WebDriverAgentLib/Categories/XCUIElement+FBCaching.m +3 -2
- package/WebDriverAgentLib/Categories/XCUIElement+FBFind.m +22 -18
- package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.h +2 -3
- package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +28 -26
- package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +2 -1
- package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.m +8 -4
- package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +73 -51
- package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +11 -10
- package/WebDriverAgentLib/Categories/XCUIElement+FBUID.h +10 -5
- package/WebDriverAgentLib/Categories/XCUIElement+FBUID.m +15 -3
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.h +7 -7
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +29 -20
- package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.h +2 -2
- package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +17 -14
- package/WebDriverAgentLib/Categories/XCUIElementQuery+FBHelpers.h +2 -3
- package/WebDriverAgentLib/Categories/XCUIElementQuery+FBHelpers.m +3 -3
- package/WebDriverAgentLib/Commands/FBElementCommands.m +17 -15
- package/WebDriverAgentLib/Commands/FBFindElementCommands.m +5 -6
- package/WebDriverAgentLib/FBAlert.m +16 -13
- package/WebDriverAgentLib/FBApplication.m +8 -8
- package/WebDriverAgentLib/Routing/FBElementUtils.h +11 -2
- package/WebDriverAgentLib/Routing/FBElementUtils.m +15 -12
- package/WebDriverAgentLib/Routing/FBResponsePayload.m +11 -10
- package/WebDriverAgentLib/Routing/FBSession.m +1 -1
- package/{PrivateHeaders/XCTest/XCAccessibilityElement.h → WebDriverAgentLib/Routing/FBXCAccessibilityElement.h} +19 -18
- package/WebDriverAgentLib/{Categories/XCAccessibilityElement+FBComparison.m → Routing/FBXCAccessibilityElement.m} +5 -11
- package/WebDriverAgentLib/Routing/FBXCDeviceEvent.h +35 -0
- package/WebDriverAgentLib/Routing/FBXCDeviceEvent.m +43 -0
- package/{PrivateHeaders/XCTest/XCElementSnapshot.h → WebDriverAgentLib/Routing/FBXCElementSnapshot.h} +25 -44
- package/WebDriverAgentLib/Routing/FBXCElementSnapshot.m +10 -0
- package/WebDriverAgentLib/Routing/FBXCElementSnapshotWrapper.h +30 -0
- package/WebDriverAgentLib/Routing/FBXCElementSnapshotWrapper.m +45 -0
- package/WebDriverAgentLib/Utilities/FBActiveAppDetectionPoint.h +3 -4
- package/WebDriverAgentLib/Utilities/FBActiveAppDetectionPoint.m +4 -4
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h +2 -2
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m +7 -8
- package/WebDriverAgentLib/Utilities/FBClassChainQueryParser.m +1 -2
- package/WebDriverAgentLib/Utilities/FBConfiguration.m +0 -1
- package/WebDriverAgentLib/Utilities/FBImageIOScaler.m +3 -0
- package/WebDriverAgentLib/Utilities/FBKeyboard.m +1 -2
- package/WebDriverAgentLib/Utilities/FBPasteboard.m +91 -3
- package/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m +1 -1
- package/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m +3 -3
- package/WebDriverAgentLib/Utilities/FBXCAXClientProxy.h +10 -9
- package/WebDriverAgentLib/Utilities/FBXCAXClientProxy.m +14 -8
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h +0 -1
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +6 -0
- package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +0 -10
- package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +0 -24
- package/WebDriverAgentLib/Utilities/FBXPath-Private.h +1 -1
- package/WebDriverAgentLib/Utilities/FBXPath.h +3 -3
- package/WebDriverAgentLib/Utilities/FBXPath.m +15 -13
- package/WebDriverAgentLib/Utilities/NSPredicate+FBFormat.h +14 -1
- package/WebDriverAgentLib/Utilities/NSPredicate+FBFormat.m +18 -9
- package/WebDriverAgentLib/Utilities/XCTestPrivateSymbols.m +9 -3
- package/WebDriverAgentLib/Utilities/XCUIApplicationProcessDelay.m +7 -1
- package/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +7 -1
- package/WebDriverAgentLib/WebDriverAgentLib.h +0 -1
- package/WebDriverAgentRunner-Runner.app.zip +0 -0
- package/WebDriverAgentTests/IntegrationTests/FBPasteboardTests.m +1 -5
- package/WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m +26 -19
- package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHelperTests.m +24 -29
- package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHitPointTests.m +2 -2
- package/WebDriverAgentTests/IntegrationTests/XCUIElementFBFindTests.m +5 -3
- package/WebDriverAgentTests/IntegrationTests/XCUIElementHelperIntegrationTests.m +2 -1
- package/{WebDriverAgentLib/Categories/XCElementSnapshot+FBHitPoint.h → WebDriverAgentTests/UnitTests/Doubles/XCElementSnapshotDouble.h} +3 -14
- package/WebDriverAgentTests/UnitTests/Doubles/XCElementSnapshotDouble.m +99 -0
- package/WebDriverAgentTests/UnitTests/FBXPathTests.m +21 -13
- package/WebDriverAgentTests/UnitTests/NSPredicateFBFormatTests.m +4 -5
- package/package.json +1 -1
- package/WebDriverAgentLib/Categories/XCAccessibilityElement+FBComparison.h +0 -27
- package/WebDriverAgentLib/Categories/XCElementSnapshot+FBHitPoint.m +0 -29
- package/WebDriverAgentLib/Utilities/FBPredicate.h +0 -28
- package/WebDriverAgentLib/Utilities/FBPredicate.m +0 -29
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
#import "FBXPath.h"
|
|
13
13
|
#import "FBXPath-Private.h"
|
|
14
14
|
#import "XCUIElementDouble.h"
|
|
15
|
+
#import "XCElementSnapshotDouble.h"
|
|
16
|
+
#import "FBXCElementSnapshotWrapper+Helpers.h"
|
|
15
17
|
|
|
16
18
|
@interface FBXPathTests : XCTestCase
|
|
17
19
|
@end
|
|
@@ -30,11 +32,11 @@
|
|
|
30
32
|
xmlChar *xmlbuff;
|
|
31
33
|
int rc = xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL);
|
|
32
34
|
if (rc >= 0) {
|
|
33
|
-
rc = [FBXPath xmlRepresentationWithRootElement:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
rc = [FBXPath xmlRepresentationWithRootElement:element
|
|
36
|
+
writer:writer
|
|
37
|
+
elementStore:elementStore
|
|
38
|
+
query:query
|
|
39
|
+
excludingAttributes:excludedAttributes];
|
|
38
40
|
if (rc >= 0) {
|
|
39
41
|
rc = xmlTextWriterEndDocument(writer);
|
|
40
42
|
}
|
|
@@ -55,7 +57,8 @@
|
|
|
55
57
|
|
|
56
58
|
- (void)testDefaultXPathPresentation
|
|
57
59
|
{
|
|
58
|
-
|
|
60
|
+
XCElementSnapshotDouble *snapshot = [XCElementSnapshotDouble new];
|
|
61
|
+
id<FBElement> element = (id<FBElement>)[FBXCElementSnapshotWrapper ensureWrapped:(id)snapshot];
|
|
59
62
|
NSString *resultXml = [self xmlStringWithElement:element
|
|
60
63
|
xpathQuery:nil
|
|
61
64
|
excludingAttributes:nil];
|
|
@@ -66,7 +69,8 @@
|
|
|
66
69
|
|
|
67
70
|
- (void)testtXPathPresentationWithSomeAttributesExcluded
|
|
68
71
|
{
|
|
69
|
-
|
|
72
|
+
XCElementSnapshotDouble *snapshot = [XCElementSnapshotDouble new];
|
|
73
|
+
id<FBElement> element = (id<FBElement>)[FBXCElementSnapshotWrapper ensureWrapped:(id)snapshot];
|
|
70
74
|
NSString *resultXml = [self xmlStringWithElement:element
|
|
71
75
|
xpathQuery:nil
|
|
72
76
|
excludingAttributes:@[@"type", @"visible", @"value", @"index"]];
|
|
@@ -77,8 +81,9 @@
|
|
|
77
81
|
|
|
78
82
|
- (void)testXPathPresentationBasedOnQueryMatchingAllAttributes
|
|
79
83
|
{
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
XCElementSnapshotDouble *snapshot = [XCElementSnapshotDouble new];
|
|
85
|
+
snapshot.value = @"йоло<>&\"";
|
|
86
|
+
id<FBElement> element = (id<FBElement>)[FBXCElementSnapshotWrapper ensureWrapped:(id)snapshot];
|
|
82
87
|
NSString *resultXml = [self xmlStringWithElement:element
|
|
83
88
|
xpathQuery:[NSString stringWithFormat:@"//%@[@*]", element.wdType]
|
|
84
89
|
excludingAttributes:@[@"visible"]];
|
|
@@ -89,7 +94,8 @@
|
|
|
89
94
|
|
|
90
95
|
- (void)testXPathPresentationBasedOnQueryMatchingSomeAttributes
|
|
91
96
|
{
|
|
92
|
-
|
|
97
|
+
XCElementSnapshotDouble *snapshot = [XCElementSnapshotDouble new];
|
|
98
|
+
id<FBElement> element = (id<FBElement>)[FBXCElementSnapshotWrapper ensureWrapped:(id)snapshot];
|
|
93
99
|
NSString *resultXml = [self xmlStringWithElement:element
|
|
94
100
|
xpathQuery:[NSString stringWithFormat:@"//%@[@%@ and contains(@%@, 'blabla')]", element.wdType, @"value", @"name"]
|
|
95
101
|
excludingAttributes:nil];
|
|
@@ -104,11 +110,12 @@
|
|
|
104
110
|
|
|
105
111
|
xmlTextWriterPtr writer = xmlNewTextWriterDoc(&doc, 0);
|
|
106
112
|
NSMutableDictionary *elementStore = [NSMutableDictionary dictionary];
|
|
107
|
-
|
|
113
|
+
XCElementSnapshotDouble *snapshot = [XCElementSnapshotDouble new];
|
|
114
|
+
id<FBElement> root = (id<FBElement>)[FBXCElementSnapshotWrapper ensureWrapped:(id)snapshot];
|
|
108
115
|
NSString *query = [NSString stringWithFormat:@"//%@", root.wdType];
|
|
109
116
|
int rc = xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL);
|
|
110
117
|
if (rc >= 0) {
|
|
111
|
-
rc = [FBXPath xmlRepresentationWithRootElement:
|
|
118
|
+
rc = [FBXPath xmlRepresentationWithRootElement:root
|
|
112
119
|
writer:writer
|
|
113
120
|
elementStore:elementStore
|
|
114
121
|
query:query
|
|
@@ -130,7 +137,8 @@
|
|
|
130
137
|
XCTAssertNotEqual(NULL, queryResult);
|
|
131
138
|
}
|
|
132
139
|
|
|
133
|
-
NSArray *matchingSnapshots = [FBXPath collectMatchingSnapshots:queryResult->nodesetval
|
|
140
|
+
NSArray *matchingSnapshots = [FBXPath collectMatchingSnapshots:queryResult->nodesetval
|
|
141
|
+
elementStore:elementStore];
|
|
134
142
|
xmlXPathFreeObject(queryResult);
|
|
135
143
|
xmlFreeTextWriter(writer);
|
|
136
144
|
xmlFreeDoc(doc);
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
#import <XCTest/XCTest.h>
|
|
11
11
|
|
|
12
|
-
#import "FBPredicate.h"
|
|
13
12
|
#import "NSPredicate+FBFormat.h"
|
|
14
13
|
|
|
15
14
|
@interface NSPredicateFBFormatTests : XCTestCase
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
|
|
38
37
|
- (void)testFormattingForComplexExpression
|
|
39
38
|
{
|
|
40
|
-
NSPredicate *expr = [NSPredicate predicateWithFormat:@"visible == 1 AND type == 'blabla'"];
|
|
39
|
+
NSPredicate *expr = [NSPredicate predicateWithFormat:@"visible == 1 AND NOT (type == 'blabla' OR NOT (label IN {'3', '4'}))"];
|
|
41
40
|
XCTAssertNotNil([NSPredicate fb_formatSearchPredicate:expr]);
|
|
42
41
|
}
|
|
43
42
|
|
|
@@ -65,10 +64,10 @@
|
|
|
65
64
|
XCTAssertThrows([NSPredicate fb_formatSearchPredicate:expr]);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
- (void)
|
|
67
|
+
- (void)testBlockPredicateCreation
|
|
69
68
|
{
|
|
70
|
-
NSPredicate *
|
|
71
|
-
XCTAssertNotNil([NSPredicate
|
|
69
|
+
NSPredicate *expr = [NSPredicate predicateWithFormat:@"rect.x == '0'"];
|
|
70
|
+
XCTAssertNotNil([NSPredicate fb_snapshotBlockPredicateWithPredicate:expr]);
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
@end
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#import <XCTest/XCTest.h>
|
|
11
|
-
#import "XCAccessibilityElement.h"
|
|
12
|
-
|
|
13
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
-
|
|
15
|
-
@interface XCAccessibilityElement (FBComparison)
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
Compares two XCAccessibilityElement instances
|
|
19
|
-
|
|
20
|
-
@param other the other element instance
|
|
21
|
-
@return YES if both elements are equal
|
|
22
|
-
*/
|
|
23
|
-
- (BOOL)fb_isEqualToElement:(nullable XCAccessibilityElement *)other;
|
|
24
|
-
|
|
25
|
-
@end
|
|
26
|
-
|
|
27
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#import "XCElementSnapshot+FBHitPoint.h"
|
|
11
|
-
|
|
12
|
-
#import "FBLogger.h"
|
|
13
|
-
#import "XCUIHitPointResult.h"
|
|
14
|
-
#import "XCElementSnapshot+FBHelpers.h"
|
|
15
|
-
|
|
16
|
-
@implementation XCElementSnapshot (FBHitPoint)
|
|
17
|
-
|
|
18
|
-
- (NSValue *)fb_hitPoint
|
|
19
|
-
{
|
|
20
|
-
NSError *error;
|
|
21
|
-
XCUIHitPointResult *result = [self hitPoint:&error];
|
|
22
|
-
if (nil != error) {
|
|
23
|
-
[FBLogger logFmt:@"Failed to fetch hit point for %@ - %@", self.fb_description, error.localizedDescription];
|
|
24
|
-
return nil;
|
|
25
|
-
}
|
|
26
|
-
return [NSValue valueWithCGPoint:result.hitPoint];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#import <Foundation/Foundation.h>
|
|
11
|
-
|
|
12
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
HACK!!!
|
|
16
|
-
This is hacky predicate that will force XCTest to evaluate whole XCElementSnapshot.
|
|
17
|
-
Of course we should aim not to use this, but it buys us some time.
|
|
18
|
-
*/
|
|
19
|
-
@interface FBPredicate : NSPredicate
|
|
20
|
-
|
|
21
|
-
+ (NSPredicate *)predicateWithFormat:(NSString *)predicateFormat, ...;
|
|
22
|
-
|
|
23
|
-
/*! Predicate string attached to original predicate to force resolve it in XCTest */
|
|
24
|
-
+ (NSString *)forceResolvePredicateString;
|
|
25
|
-
|
|
26
|
-
@end
|
|
27
|
-
|
|
28
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#import "FBPredicate.h"
|
|
11
|
-
|
|
12
|
-
@implementation FBPredicate
|
|
13
|
-
|
|
14
|
-
+ (NSPredicate *)predicateWithFormat:(NSString *)predicateFormat, ...
|
|
15
|
-
{
|
|
16
|
-
va_list args;
|
|
17
|
-
va_start(args, predicateFormat);
|
|
18
|
-
NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateFormat arguments:args];
|
|
19
|
-
va_end(args);
|
|
20
|
-
NSPredicate *hackPredicate = [NSPredicate predicateWithFormat:self.forceResolvePredicateString];
|
|
21
|
-
return [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate, hackPredicate]];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
+ (NSString *)forceResolvePredicateString
|
|
25
|
-
{
|
|
26
|
-
return @"1 == 1 or identifier == 0 or frame == 0 or value == 0 or title == 0 or label == 0 or elementType == 0 or enabled == 0 or placeholderValue == 0 or selected == 0";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@end
|