Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subliminal incorrectly thinks elements are invisible in non-portrait orientations #135

Open
MaxGabriel opened this issue Mar 9, 2014 · 4 comments
Assignees

Comments

@MaxGabriel
Copy link
Contributor

Hi, I think there's a bug where Subliminal incorrectly labels an element invisible in non-portrait orientations. I created a sample project replicating this bug.

I believe the problem comes from this block of code. In landscape, Subliminal considers the center to be covered, but in portrait it thinks it is not.

I tried to investigate down into numberOfPointsFromSet:... and renderViewRecursively:..., but got lost in the Core Graphics code. Any idea what the problem could be? My suspicion is that its a screen coordinates != logical coordinates type of issue, but I'm not sure.

Steps to replicate

  1. git clone https://github.com/MaxGabriel/SubliminalLandscapeBug.git
  2. cd SubliminalLandscapeBug
  3. git submodule update --init
  4. open Subliminal.xcodeproj
  5. Run integration tests target (I ran against the iOS 7 4" simulator)

EDIT (@wearhere): This issue originally described the failure as occurring in landscape orientations, but tests added in #180 revealed that the failure actually occurs in any non-portrait orientation. This issue's title and description have been updated accordingly.

@MaxGabriel
Copy link
Contributor Author

Doubt it'd be helpful, but here's the trace file from the Instruments run https://s3.amazonaws.com/uploads.hipchat.com/1658/151914/AnCa4c6gojjpUMA/SubliminalLandscapeTrace.trace.zip

@wearhere wearhere added the bug label Mar 10, 2014
@wearhere
Copy link
Contributor

Thanks for the terrific bug report @MaxGabriel! I can reproduce. I imagine that it’s a matter of needing to transform the context into which the view is rendered, but I'm not quite sure how to do that myself... @aegolden can you take a look?

@wearhere
Copy link
Contributor

Hey @MaxGabriel, we're looking into the bug. In the meantime, you can fall back on UIAutomation's visibility routine using the following:

#import <Subliminal/SLUIAElement+Subclassing.h>

@interface SLUIAElement (LandscapeVisibility)
- (BOOL)uiaIsVisible;
@end

@implementation SLUIAElement (LandscapeVisibility)
- (BOOL)uiaIsVisible {
    return [[self waitUntilTappable:NO thenSendMessage:@"isVisible()"] boolValue];
}
@end

Sorry for the inconvenience.

@MaxGabriel
Copy link
Contributor Author

Cool no problem.

wearhere pushed a commit that referenced this issue Apr 12, 2014
…tions. (refs #135)

As a workaround for the failure of our visibility routine.
wearhere pushed a commit that referenced this issue Apr 12, 2014
…tions. (refs #135)

As a workaround for the failure of our visibility routine.
wearhere pushed a commit that referenced this issue Apr 12, 2014
…ntations. (refs #135)

As a workaround for the failure of our visibility routine.
@wearhere wearhere changed the title Subliminal incorrectly thinks elements are invisible in landscape Subliminal incorrectly thinks elements are invisible in non-portrait orientations Apr 12, 2014
wearhere pushed a commit that referenced this issue Apr 20, 2014
…ntations. (refs #135)

As a workaround for the failure of our visibility routine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants