appium-webdriveragent 5.0.0 → 5.1.1
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 +19 -0
- package/WebDriverAgent.xcodeproj/project.pbxproj +0 -20
- package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +0 -12
- package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +1 -15
- package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +7 -37
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.h +0 -7
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +0 -49
- package/WebDriverAgentLib/Commands/FBElementCommands.m +37 -19
- package/WebDriverAgentLib/FBApplication.h +10 -0
- package/WebDriverAgentLib/FBApplication.m +36 -0
- package/WebDriverAgentLib/Routing/FBExceptionHandler.m +2 -1
- package/WebDriverAgentLib/Routing/FBExceptions.h +3 -0
- package/WebDriverAgentLib/Routing/FBExceptions.m +1 -0
- package/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.m +23 -15
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h +4 -13
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m +36 -56
- package/WebDriverAgentLib/Utilities/FBMathUtils.h +0 -6
- package/WebDriverAgentLib/Utilities/FBMathUtils.m +0 -29
- package/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m +23 -29
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h +0 -4
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +0 -12
- package/WebDriverAgentTests/IntegrationTests/FBAppiumTouchActionsIntegrationTests.m +0 -16
- package/WebDriverAgentTests/IntegrationTests/FBSessionIntegrationTests.m +29 -0
- package/WebDriverAgentTests/IntegrationTests/FBW3CTouchActionsIntegrationTests.m +0 -19
- package/WebDriverAgentTests/UnitTests/FBMathUtilsTests.m +0 -12
- package/package.json +1 -1
- package/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.h +0 -18
- package/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.m +0 -46
- package/WebDriverAgentTests/IntegrationTests/FBElementScreenshotTests.m +0 -52
- package/WebDriverAgentTests/UnitTests/XCUICoordinateFix.m +0 -63
|
@@ -1,46 +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 "XCUICoordinate+FBFix.h"
|
|
11
|
-
|
|
12
|
-
#import "XCUICoordinate.h"
|
|
13
|
-
#import "XCUIElement+FBUtilities.h"
|
|
14
|
-
|
|
15
|
-
# if !TARGET_OS_TV
|
|
16
|
-
@implementation XCUICoordinate (FBFix)
|
|
17
|
-
|
|
18
|
-
- (CGPoint)fb_screenPoint
|
|
19
|
-
{
|
|
20
|
-
CGPoint referencePoint = CGPointMake(0, 0);
|
|
21
|
-
NSValue *referencedElementFrame = nil;
|
|
22
|
-
if (self.element) {
|
|
23
|
-
CGRect elementFrame = self.element.frame;
|
|
24
|
-
if (self.referencedElement == self.element) {
|
|
25
|
-
referencedElementFrame = [NSValue valueWithCGRect:elementFrame];
|
|
26
|
-
}
|
|
27
|
-
referencePoint = CGPointMake(
|
|
28
|
-
CGRectGetMinX(elementFrame) + CGRectGetWidth(elementFrame) * self.normalizedOffset.dx,
|
|
29
|
-
CGRectGetMinY(elementFrame) + CGRectGetHeight(elementFrame) * self.normalizedOffset.dy);
|
|
30
|
-
} else if (self.coordinate) {
|
|
31
|
-
referencePoint = self.coordinate.fb_screenPoint;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
CGPoint screenPoint = CGPointMake(
|
|
35
|
-
referencePoint.x + self.pointsOffset.dx,
|
|
36
|
-
referencePoint.y + self.pointsOffset.dy);
|
|
37
|
-
if (nil == referencedElementFrame) {
|
|
38
|
-
referencedElementFrame = [NSValue valueWithCGRect:self.referencedElement.frame];
|
|
39
|
-
}
|
|
40
|
-
return CGPointMake(
|
|
41
|
-
MIN(CGRectGetMaxX(referencedElementFrame.CGRectValue), screenPoint.x),
|
|
42
|
-
MIN(CGRectGetMaxY(referencedElementFrame.CGRectValue), screenPoint.y));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@end
|
|
46
|
-
#endif
|
|
@@ -1,52 +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
|
-
|
|
12
|
-
#import "FBMacros.h"
|
|
13
|
-
#import "FBIntegrationTestCase.h"
|
|
14
|
-
#import "XCUIDevice+FBRotation.h"
|
|
15
|
-
#import "XCUIElement+FBUtilities.h"
|
|
16
|
-
#import "XCUIScreen.h"
|
|
17
|
-
|
|
18
|
-
@interface FBElementScreenshotTests : FBIntegrationTestCase
|
|
19
|
-
@end
|
|
20
|
-
|
|
21
|
-
@implementation FBElementScreenshotTests
|
|
22
|
-
|
|
23
|
-
- (void)setUp
|
|
24
|
-
{
|
|
25
|
-
[super setUp];
|
|
26
|
-
static dispatch_once_t onceToken;
|
|
27
|
-
dispatch_once(&onceToken, ^{
|
|
28
|
-
[self launchApplication];
|
|
29
|
-
[self goToAlertsPage];
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
- (void)tearDown
|
|
34
|
-
{
|
|
35
|
-
[self resetOrientation];
|
|
36
|
-
[super tearDown];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
- (void)testElementScreenshot
|
|
40
|
-
{
|
|
41
|
-
[[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:UIDeviceOrientationLandscapeLeft];
|
|
42
|
-
XCUIElement *button = self.testedApplication.buttons[FBShowAlertButtonName];
|
|
43
|
-
NSError *error = nil;
|
|
44
|
-
NSData *screenshotData = [button fb_screenshotWithError:&error];
|
|
45
|
-
XCTAssertNotNil(screenshotData);
|
|
46
|
-
XCTAssertNil(error);
|
|
47
|
-
UIImage *image = [UIImage imageWithData:screenshotData];
|
|
48
|
-
XCTAssertNotNil(image);
|
|
49
|
-
XCTAssertTrue(image.size.width > image.size.height);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@end
|
|
@@ -1,63 +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
|
-
|
|
12
|
-
#import "FBMathUtils.h"
|
|
13
|
-
#import "XCUICoordinate.h"
|
|
14
|
-
#import "XCUICoordinate+FBFix.h"
|
|
15
|
-
#import "XCUIElementDouble.h"
|
|
16
|
-
|
|
17
|
-
@interface XCUICoordinateFix : XCTestCase
|
|
18
|
-
@property (nonatomic, strong, nullable) XCUIElement *mockElement;
|
|
19
|
-
@property (nonatomic, strong, nullable) XCUICoordinate *defaultCoordinate;
|
|
20
|
-
@end
|
|
21
|
-
|
|
22
|
-
@implementation XCUICoordinateFix
|
|
23
|
-
|
|
24
|
-
- (void)setUp
|
|
25
|
-
{
|
|
26
|
-
[super setUp];
|
|
27
|
-
XCUIElementDouble *element = [XCUIElementDouble new];
|
|
28
|
-
element.frame = CGRectMake(1, 2, 9, 10);
|
|
29
|
-
self.mockElement = (XCUIElement *)element;
|
|
30
|
-
self.defaultCoordinate = [[XCUICoordinate alloc] initWithElement:self.mockElement normalizedOffset:CGVectorMake(0.0, 0.0)];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
- (void)testCoordinateWithElement
|
|
34
|
-
{
|
|
35
|
-
XCUICoordinate *coordinate = [[XCUICoordinate alloc] initWithElement:self.mockElement normalizedOffset:CGVectorMake(0.0, 0.0)];
|
|
36
|
-
XCTAssertTrue(FBPointFuzzyEqualToPoint(coordinate.fb_screenPoint, CGPointMake(1, 2), 0.1));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
- (void)testCoordinateWithElementWithOffset
|
|
40
|
-
{
|
|
41
|
-
XCUICoordinate *coordinate = [[XCUICoordinate alloc] initWithElement:self.mockElement normalizedOffset:CGVectorMake(0.5, 0.5)];
|
|
42
|
-
XCTAssertTrue(FBPointFuzzyEqualToPoint(coordinate.fb_screenPoint, CGPointMake(5.5, 7), 0.1));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
- (void)testCoordinateWithCoordinate
|
|
46
|
-
{
|
|
47
|
-
XCUICoordinate *coordinate = [[XCUICoordinate alloc] initWithCoordinate:self.defaultCoordinate pointsOffset:CGVectorMake(0, 0)];
|
|
48
|
-
XCTAssertTrue(FBPointFuzzyEqualToPoint(coordinate.fb_screenPoint, CGPointMake(1, 2), 0.1));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
- (void)testCoordinateWithCoordinateWithOffset
|
|
52
|
-
{
|
|
53
|
-
XCUICoordinate *coordinate = [[XCUICoordinate alloc] initWithCoordinate:self.defaultCoordinate pointsOffset:CGVectorMake(1, 2)];
|
|
54
|
-
XCTAssertTrue(FBPointFuzzyEqualToPoint(coordinate.fb_screenPoint, CGPointMake(2, 4), 0.1));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
- (void)testCoordinateWithCoordinateWithOffsetOffBounds
|
|
58
|
-
{
|
|
59
|
-
XCUICoordinate *coordinate = [[XCUICoordinate alloc] initWithCoordinate:self.defaultCoordinate pointsOffset:CGVectorMake(200, 200)];
|
|
60
|
-
XCTAssertTrue(FBPointFuzzyEqualToPoint(coordinate.fb_screenPoint, CGPointMake(10, 12), 0.1));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@end
|