forked from facebookarchive/WebDriverAgent
-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync the recent changes with the main branch (#68)
* Remove TableView scrolling integration tests Summary: We have duplicated scrolling tests for regular tableViews and simple scrollviews. It was usefull to have them, but now testing scrolling on scrollviews covers both cases anyway and we will waste less time testing. Reviewed By: antiarchit Differential Revision: D6543548 fbshipit-source-id: 35e717c43208b8f138a706798d9aa8a9e34b302a * Use fb_tapWithError in alert integration tests Summary: Some alert integration tests are flaky on our CI. I suspect this happens due to failing `tap` command, which might be failing to tap on animated view. This know XCTest issue. Fortunately we have `fb_tapWithError` that handels are common pitfalls. Reviewed By: antiarchit Differential Revision: D6543616 fbshipit-source-id: f12ea7da67058253deff53fa980ebf2e55a93899 * Fix rotation integeation tests Summary: Rather then depending on XCUITest information on orientation, we should test what is application perception Reviewed By: antiarchit Differential Revision: D6543511 fbshipit-source-id: 192e50d0202f96bd6119921c9353a72789b33ad4 * Kill testExtrasIconContent Summary: This test is super device/simulator specific, that was used to interate on visibility improvements. Right now it does not bring much value anyway. Reviewed By: antiarchit Differential Revision: D6543627 fbshipit-source-id: ffbda3b0b5ecde6a632e88030e84fae5af614347 * Use Xcode 9.2 and iOS 11.2 on Travis Summary: It is time to move on. Reviewed By: antiarchit Differential Revision: D6692223 fbshipit-source-id: 81913167551191b2f9e177ff1ead943f6fc25752 * Fix scrolling on big scroll offsets Summary: `XCUICoordinate` seems to have a bug that will return half of offset in case coordinate referance point goes off screen. I suspect this has something to do with retina displays. Instead of using Apple's implementation of `screenPoint` I implemented our own. Reviewed By: antiarchit Differential Revision: D6702218 fbshipit-source-id: b01ef061732281cdf8c6707de38a11b6e31b9c28 * Run testInvisibleDescendantWithXPathQuery test on scroll page Summary: With all visibility changes tested pageindicator is no longer considered invisible. For the time being this is ok with us. This diff uses different invisible elements to run same test of search for invisible elements Reviewed By: antiarchit Differential Revision: D6702252 fbshipit-source-id: a2bd5198d14f05cb1b33afe76a6b5bda7e34a847 * Do not run testSpringBoardIcons on iPads Summary: This test was not intended to run on iPad, so we should turn it off so that we can make Travis green again :). Reviewed By: antiarchit Differential Revision: D6726707 fbshipit-source-id: db92f23b2dc755e7c1464069c04b1838717b8ff4 * Fix resolving XCUIApplication snapshots Summary: With new xcode it looks like, calling `query`, `resolve` on XCUIApplication will in some sense break it. Not sure exactly what goes wrong, but final result is that it's missing some children and description of that object is empty. Instead we can use new API for fetching snapshots for debugging. Reviewed By: lawrencelomax Differential Revision: D6723102 fbshipit-source-id: a33d9caf03eef4450f3879996493493c2cb257b4 * Use visibleFrame to calculate scrolling vector Summary: Using views frame for calculating scroling vector might be buggy when application is doing tricky stuff with scolling views eg. nesting scrollview within scrollview. In that case frame of the second scrollview will be huge and make scrolling imposible as we will try to use points of the screen. Instead we should visible frame. Reviewed By: antiarchit Differential Revision: D6819626 fbshipit-source-id: 27062f593485b4ec55ae8bd1a9c9a32a89630b92 * fb_isVisible using interfaceOrientation instead of Device orientation. Summary: [XCUIDevice sharedDevice].orientation may get values like FaceUp, which cause wrong calculation of the app frame size, in landscape. With devices in Lab, standing portrait, this problem is less common. Working on development with devices on the table it happens more often causing a great deal of confusion. From my tests, using app interfaceOrientation gives always the reality of the App. Closes facebookarchive#875 Reviewed By: marekcirkos Differential Revision: D7067153 Pulled By: antiarchit fbshipit-source-id: c6aa8f8823d0f43e5072a190c34df931d0d6b8b8 * Fix testIconsFromSearchDashboard integration test Summary: It might be there is more than one `IntegrationApp` icon on the dashboard while integration tests are running on Travis. Addresses https://travis-ci.org/facebook/WebDriverAgent/jobs/349725814 Closes facebookarchive#883 Differential Revision: D7289614 Pulled By: marekcirkos fbshipit-source-id: e5060888f2a752c039fcf815984e24579a3cef06 * Skip testSheetAlert under Xcode8
- Loading branch information
Showing
17 changed files
with
256 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
#import <XCTest/XCTest.h> | ||
|
||
@interface XCUICoordinate (FBFix) | ||
|
||
- (CGPoint)fb_screenPoint; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
#import "XCUICoordinate+FBFix.h" | ||
|
||
#import "XCUICoordinate.h" | ||
#import "XCUIElement+FBUtilities.h" | ||
#import "XCElementSnapshot+FBHitPoint.h" | ||
|
||
@implementation XCUICoordinate (FBFix) | ||
|
||
- (CGPoint)fb_screenPoint | ||
{ | ||
CGPoint referencePoint = CGPointMake(0, 0); | ||
if (self.element) { | ||
CGRect frame = self.element.frame; | ||
referencePoint = CGPointMake( | ||
CGRectGetMinX(frame) + CGRectGetWidth(frame) * self.normalizedOffset.dx, | ||
CGRectGetMinY(frame) + CGRectGetHeight(frame) * self.normalizedOffset.dy); | ||
} | ||
else if (self.coordinate) { | ||
referencePoint = self.coordinate.fb_screenPoint; | ||
} | ||
CGPoint screenPoint = CGPointMake( | ||
referencePoint.x + self.pointsOffset.dx, | ||
referencePoint.y + self.pointsOffset.dy); | ||
CGRect rect = self.referencedElement.frame; | ||
return CGPointMake( | ||
MIN(CGRectGetMaxX(rect), screenPoint.x), | ||
MIN(CGRectGetMaxY(rect), screenPoint.y)); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.