expo/detox-expo-helpers

reloadApp is slow

ArsenyYankovsky opened this issue · 1 comments

I'm running a simple assert on my first screen and it takes around 80-90 seconds to run my test.

I had to move reloadApp to a beforeAll section instead of beforeEach because it takes a lot of time to reload it. Every test case takes around 50 seconds if I do a reloadApp.

Is that expected? It seems like most of the time it's just waiting because I can see in a simulator that the app is ready.

My test cases:

const { reloadApp } = require('detox-expo-helpers')

describe('Example', () => {
  beforeEach(async () => {
    await reloadApp()
  })

  it('should show feed on a first screen', async () => {
    await expect(element(by.id('FeaturedFeed'))).toBeVisible()
  })

  it('should switch to a write screen', async () => {
    await element(by.id('GoToWrite')).atIndex(0).tap()
    await expect(element(by.id('LoginProposition').withAncestor(by.id('WriteScreen')))).toBeVisible()
  })
})

Results in something like that:

 PASS  e2e/firstTest.spec.js (169.461s)
  Example
    ✓ should show feed on a first screen (88747ms)
    ✓ should switch to a write screen (59989ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        169.513s

Environment:

    "detox": "^9.1.2",
    "detox-expo-helpers": "^0.6.0",
    "expo-detox-hook": "^1.0.10",

I'm running iOS simulator on macOS 10.14.2

Same issue here!