Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Commit

Permalink
fb_isVisible using interfaceOrientation instead of Device orientation.
Browse files Browse the repository at this point in the history
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 #875

Reviewed By: marekcirkos

Differential Revision: D7067153

Pulled By: antiarchit

fbshipit-source-id: c6aa8f8823d0f43e5072a190c34df931d0d6b8b8
  • Loading branch information
Jon Gabilondo authored and facebook-github-bot committed Feb 26, 2018
1 parent 1199aa4 commit 20246d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (BOOL)fb_isVisible
return [(NSNumber *)[self fb_attributeValue:FB_XCAXAIsVisibleAttribute] boolValue];
}
CGRect appFrame = [self fb_rootElement].frame;
CGSize screenSize = FBAdjustDimensionsForApplication(appFrame.size, (UIInterfaceOrientation)[XCUIDevice sharedDevice].orientation);
CGSize screenSize = FBAdjustDimensionsForApplication(appFrame.size, self.application.interfaceOrientation);
CGRect screenFrame = CGRectMake(0, 0, screenSize.width, screenSize.height);
if (!CGRectIntersectsRect(frame, screenFrame)) {
return NO;
Expand Down

0 comments on commit 20246d3

Please sign in to comment.