Skip to content

Commit

Permalink
Force accessibility support
Browse files Browse the repository at this point in the history
Help with #95
  • Loading branch information
LeoNatan authored Jul 5, 2017
1 parent 5c891ed commit febf554
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions detox/ios/Detox/DetoxManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 23,9 @@ @interface DetoxManager()
__attribute__((constructor))
static void detoxConditionalInit()
{
//This forces accessibility support in the application.
[[[NSUserDefaults alloc] initWithSuiteName:@"com.apple.Accessibility"] setBool:YES forKey:@"ApplicationAccessibilityEnabled"];

//Timeout will be regulated by mochaJS. Perhaps it would be best to somehow pass the timeout value from JS to here. For now, this will do.
[[GREYConfiguration sharedInstance] setDefaultValue:@(DBL_MAX) forConfigKey:kGREYConfigKeyInteractionTimeoutDuration];

Expand Down

3 comments on commit febf554

@jeduden
Copy link

@jeduden jeduden commented on febf554 Jul 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeoNatan : used this to search inside earlgrey. looks like they are doing something similar and more "magic": inside the method grey_enableAccessibility https://github.com/google/EarlGrey/blob/master/EarlGrey/Core/GREYAutomationSetup.m#L147

@LeoNatan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. So this code might not be called in Detox for some reason. Worth investigating.

@simonracz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grey_enableAccessibility is called only for XCTest cases and only for simulators. They have a compile time branch for devices, but part doesn't run ever.

I looked at its code. I actually prefer your fix.

Please sign in to comment.