Detox icon indicating copy to clipboard operation
Detox copied to clipboard

device.launchApp with permission doesn't work in iOS 16.4

Open frankA10019 opened this issue 1 year ago • 3 comments

What happened?

device.launchApp with permission doesn't work, it still has pop up after app launch and test stuck until timeout. My applesimutils version is 0.9.10.

Below is the message when test stuck: detox[32742] i The app is busy with the following tasks: • Run loop "Main Run Loop" is awake. • There are 1 work items pending on the dispatch queue: "Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)".

If I tap allow button manual. The test run well and success completed. Please help.

What was the expected behaviour?

launch app with no permission dialogue. the test start run.

Was it tested on latest Detox?

  • [X] I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

describe('Employee', () => { beforeAll(async () => { device.launchApp({ permissions: { notifications: 'YES' } }); }); // beforeEach(async () => { // await device.reloadReactNative(); // }); it('should display welcome message', async () => { await waitFor(element(by.id('forgetPassword'))) .toHaveText('忘記密碼') .withTimeout(2000); }); });

In what environment did this happen?

Detox version: 20.11.1 React Native version: 0.72.4 Has Fabric (React Native's new rendering system) enabled: (yes/no) Node version: Device model: iPhone 14 simulator iOS version: 16.4 macOS version: sonoma 14.1.1(23B81) Xcode version: 15.2.0 Test-runner (select one): jest / other

Detox logs

Detox logs
detox[32742] i The app is busy with the following tasks:
• Run loop "Main Run Loop" is awake.
• There are 1 work items pending on the dispatch queue: "Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)".

Device logs

Device logs
paste your device.log here!

More data, please!

No response

frankA10019 avatar Apr 30 '24 04:04 frankA10019

beforeAll(async () => { await device.launchApp({ permissions: {notifications: 'YES'} }) });

Daha62 avatar May 20 '24 04:05 Daha62

@frankA10019 you're missing the await (thanks @Daha62 for the catch). Did this solve your problem?

asafkorem avatar Jun 22 '24 23:06 asafkorem

@asafkorem , I am using the below code beforeAll(async () => { await device.launchApp({ permissions: { notifications: 'YES' } }); });

However, I faced an issue that my Simulator locked automatically as I ran a test. And it's timeout without running test suite.

https://github.com/user-attachments/assets/7b01b9a3-902a-4b3b-aa53-601a6074ae98

saadi-ninjasCode avatar Jul 24 '24 11:07 saadi-ninjasCode