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

Enable notifications permission not working #1533

Closed
amadeu01 opened this issue Jul 16, 2019 · 2 comments
Closed

Enable notifications permission not working #1533

amadeu01 opened this issue Jul 16, 2019 · 2 comments

Comments

@amadeu01
Copy link

amadeu01 commented Jul 16, 2019

describe('Mobile test', () => {
  beforeAll(async () => {
    await detox.init(config, { launchApp: false });
    await device.launchApp({ permissions: { notifications: 'YES' } });
  });

  describe('Smoke', () => {
    it('my test', async () => {
      mock.cardData.assignee = mock.signupData.profile.fullName;
      await Operator.signup(mock.signupData);
    });
  });
});

I'm trying to enable the permissions by using device.launchApp({ permissions: { notifications: 'YES' } }), however it seems not being called

detox[8345] INFO:  [DetoxServer.js] server listening on localhost:65156...
detox[8345] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:65156
detox[8345] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3
detox[8345] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3
detox[8345] DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox[8345] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone X" --byOS "12.2"
detox[8345] DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone X...
detox[8345] DEBUG: [exec.js/EXEC_CMD, #2] applesimutils --list --byId "B2E486B7-8CD7-4B94-9969-3C6901591BD8"
detox[8345] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp
detox[8345] DEBUG: [exec.js/EXEC_TRY, #3] Uninstalling com.amadeu.mobileapp...
detox[8345] DEBUG: [exec.js/EXEC_SUCCESS, #3] com.amadeu.mobileapp uninstalled
detox[8345] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl install B2E486B7-8CD7-4B94-9969-3C6901591BD8 "/Users/amadeu.filho/Developer/amadeu-mobile/ios/build/Build/Products/Debug-iphonesimulator/amadeumobile.app"
detox[8345] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/amadeu.filho/Developer/amadeu-mobile/ios/build/Build/Products/Debug-iphonesimulator/amadeumobile.app...
detox[8345] DEBUG: [exec.js/EXEC_SUCCESS, #4] /Users/amadeu.filho/Developer/amadeu-mobile/ios/build/Build/Products/Debug-iphonesimulator/amadeumobile.app installed
detox[8345] DEBUG: [exec.js/EXEC_CMD, #5] /usr/bin/xcrun simctl terminate B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp
detox[8345] DEBUG: [exec.js/EXEC_TRY, #5] Terminating com.amadeu.mobileapp...
detox[8345] DEBUG: [exec.js/EXEC_SUCCESS, #5] com.amadeu.mobileapp terminated
detox[8345] DEBUG: [exec.js/EXEC_CMD, #6] SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/amadeu.filho/Library/Detox/ios/1ea4f89e9092026849f937e47281627c5f5251d6/Detox.framework/Detox" /usr/bin/xcrun simctl launch B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp --args -detoxServer "ws://localhost:65156" -detoxSessionId "087d9cea-5251-fbda-160a-f89d4927dee3"
detox[8345] DEBUG: [exec.js/EXEC_TRY, #6] Launching com.amadeu.mobileapp...
detox[8345] DEBUG: [exec.js/EXEC_CMD, #7] /usr/bin/xcrun simctl get_app_container B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp
detox[8345] INFO:  [AppleSimUtils.js] com.amadeu.mobileapp launched. To watch simulator logs, run:
        /usr/bin/xcrun simctl spawn B2E486B7-8CD7-4B94-9969-3C6901591BD8 log stream --level debug --style compact --predicate 'processImagePath beginsWith "/Users/amadeu.filho/Library/Developer/CoreSimulator/Devices/B2E486B7-8CD7-4B94-9969-3C6901591BD8/data/Containers/Bundle/Application/6F69DC89-7478-4502-8998-8B93E8D061C6/amadeumobile.app"'
detox[8345] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=087d9cea-5251-fbda-160a-f89d4927dee3)
detox[8345] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3
detox[8345] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3

I also tried to call applesimutils manually while the app is opened, however I don't know whether the detox uses a different bundle to run the test suite or not.

➜ applesimutils --byId "B2E486B7-8CD7-4B94-9969-3C6901591BD8" --bundle com.amadeu.mobileapp --setPermissions notifications=YES

I'm using an iPhone X simulator.

      "buildversion" : "16E226",
      "availability" : "(available)",
      "isAvailable" : true,
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2",
      "version" : "12.2",
      "name" : "iOS 12.2"
@support
Copy link

support bot commented Jul 16, 2019

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.

Feel free to post your Stack Overflow question here for more visility. We'll take a look at it.

For more information on bots in this reporsitory, read this discussion.

@support support bot closed this as completed Jul 16, 2019
@amadeu01
Copy link
Author

Stackoverflow question

@lock lock bot locked as resolved and limited conversation to collaborators Jul 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant