-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixing pa11y and fa11y commands for iOS8.1+ #128
Conversation
@@ -77,7 +77,7 @@ def forceStartAccessibilityServer(): | |||
#We try to start accessibility server only if we don't have needed method active | |||
if not fb.evaluateBooleanExpression('[UIView instancesRespondToSelector:@selector(_accessibilityElementsInContainer:)]'): | |||
#Starting accessibility server is different for simulator and device | |||
if fb.evaluateExpressionValue('(id)[[UIDevice currentDevice] model]').GetObjectDescription().lower().find('simulator') >= 0: | |||
if fb.evaluateExpressionValue('(id)[[UIDevice currentDevice] name]').GetObjectDescription().lower().find('simulator') >= 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a backwards compatible change, will it still work < iOS 8.1?
Thanks @gkassabli! I have a couple questions. |
Thanks for good point, @kastiglione. Addressed your comments! |
@@ -77,7 +77,7 @@ def forceStartAccessibilityServer(): | |||
#We try to start accessibility server only if we don't have needed method active | |||
if not fb.evaluateBooleanExpression('[UIView instancesRespondToSelector:@selector(_accessibilityElementsInContainer:)]'): | |||
#Starting accessibility server is different for simulator and device | |||
if fb.evaluateExpressionValue('(id)[[UIDevice currentDevice] model]').GetObjectDescription().lower().find('simulator') >= 0: | |||
if (fb.evaluateExpressionValue('(id)[[UIDevice currentDevice] model]').GetObjectDescription().lower().find('simulator') >= 0) | (fb.evaluateExpressionValue('(id)[[UIDevice currentDevice] name]').GetObjectDescription().lower().find('simulator') >= 0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This should use
or
instead of binary|
. - Maybe extract into a helper method,
isSimulator
? - Is there a reason this isn't using
evaluateObjectExpression
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will address first 2 comments
3. EvaluateObjectExpression will give us string address, while we need string python representation. expressionValue().GetObjectDescription() seems best way for that
Thanks @gkassabli. One more comment, but otherwise looks good! |
Thank you 💎 |
Fixing pa11y and fa11y commands for iOS8.1+
Pa11y and fa11y weren't working since iOS8.1 because of Apple API changes. This fix should work both on newer and older versions