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

device.launchApp won't give notification permissions on 7.3.2 #653

Closed
vonovak opened this issue Mar 28, 2018 · 5 comments
Closed

device.launchApp won't give notification permissions on 7.3.2 #653

vonovak opened this issue Mar 28, 2018 · 5 comments

Comments

@vonovak
Copy link
Contributor

vonovak commented Mar 28, 2018

Description

I use detox for testing RN app only on ios and jest as test runner. After upgrade from 7.2.0 to 7.3.2, tests do not pass - they fail on timeout:

Steps to Reproduce

create an app that asks for notification permissions on start.

//App.js
import FCM from 'react-native-fcm';
...
componentDidMount() {
    FCM.requestPermissions()
      .then(() => console.debug('notifications granted'))
      .catch(() => console.debug('notifications rejected'));
}
//init.js
...
beforeAll(async () => {
  await detox.init(config);

  await device.launchApp({
    permissions: {
      notifications: 'YES',
    },
  });
});
...

boot simulator, reset its content and settings, run detox test and you will see that app starts, and the alert asking for notification permissions shows up, but is not handled by detox. The app will hang in there until the timeout fails the tests.

Interestingly, if you kill the tests before the timeout and run them again, the notification permissions are set and the tests pass.

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.2
  • React Native: 0.53
  • Node:9.7.1
  • Device: ios simulator
  • Xcode: 9.2
  • macOS: 10.13.3

Device and verbose Detox logs

first run (fails but I killed it before the timeout): gist
second run (succeeds): gist

@LeoNatan
Copy link
Contributor

LeoNatan commented Mar 30, 2018

On the first log, I don't see a call to applesimutils --setPermissions. @rotemmiz

@LeoNatan
Copy link
Contributor

@vonovak
Copy link
Contributor Author

vonovak commented Mar 30, 2018 via email

@vonovak
Copy link
Contributor Author

vonovak commented Mar 30, 2018

sorry, not quite sure what happened, but I cannot reproduce it any more.

@LeoNatan
Copy link
Contributor

If you reproduce again, please open a new issue. Thanks.

@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants