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

End-to-end tests fail on iOS 15.0 with a freshly scaffolded app #1804

Closed
glesperance opened this issue Oct 11, 2021 · 3 comments · Fixed by #1808
Closed

End-to-end tests fail on iOS 15.0 with a freshly scaffolded app #1804

glesperance opened this issue Oct 11, 2021 · 3 comments · Fixed by #1808
Assignees
Labels

Comments

@glesperance
Copy link

What's going on?
End-to-end tests fail with a freshly scaffolded app. iOS build works, test build works, but the actual run of the tests fails.
When the test suite tries to run, we first see the app open, and then immediately crash, then the tests fails with

detox[99221] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
 DetoxRuntimeError: Aborted detox.init() execution, and now running detox.cleanup()

HINT: Most likely, your test runner is tearing down the suite due to the timeout error
    at Detox.[_assertNoPendingInit] (/Users/gabriel/Workspace/paltap-io/TestApp/node_modules/detox/src/Detox.js:204:9)
    at Detox.beforeEach (/Users/gabriel/Workspace/paltap-io/TestApp/node_modules/detox/src/Detox.js:111:37)
    at DetoxExportWrapper.<computed> (/Users/gabriel/Workspace/paltap-io/TestApp/node_modules/detox/src/DetoxExportWrapper.js:87:32)
    at DetoxAdapterImpl.beforeEach (/Users/gabriel/Workspace/paltap-io/TestApp/node_modules/detox/runners/jest/DetoxAdapterImpl.js:28:22)
    at DetoxAdapterJasmine.beforeEach (/Users/gabriel/Workspace/paltap-io/TestApp/node_modules/detox/runners/jest/DetoxAdapterJasmine.js:19:5)

and then hangs.

Simulator logs give nothing at all.

If we then run the build manually in the simulator it launches without crashing.


Steps to reproduce

  1. $ npx ignite-cli new TestApp
  2. $ cd TestApp
  3. $ yarn ios --> works.
  4. $ yarn build:e2e --> works.
  5. $ yarn test:e2e --> fails.

npx ignite-cli doctor results:

System
  platform           darwin
  arch               x64
  cpu                16 cores     Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  directory          TestApp      /Users/gabriel/Workspace/paltap-io/TestApp

JavaScript (and globally-installed packages)
  node               14.17.6      /Users/gabriel/.nvm/versions/node/v14.17.6/bin/node
  npm                6.14.15      /Users/gabriel/.nvm/versions/node/v14.17.6/bin/npm
    detox-cli        18.20.1
    expo-cli         4.12.0
    npm              6.14.15
    yarn             1.22.15
  yarn               1.22.15      /Users/gabriel/.nvm/versions/node/v14.17.6/bin/yarn
    detox-cli        18.20.1

Ignite
  ignite-cli         7.5.0        /Users/gabriel/.npm/_npx/99982/bin/ignite
  ignite src         build        /Users/gabriel/.npm/_npx/99982/lib/node_modules/ignite-cli/build

Android
  java               1.8.0_292    /usr/bin/java
  android home       -            /Users/gabriel/Library/Android/sdk

iOS
  xcode              13.0
  cocoapods          1.11.2       /usr/local/bin/pod
@glesperance
Copy link
Author

Related to:

To temporarily fix this you can modify your Detox config in package.json:

"detox": {
    "test-runner": "jest",
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/PaltapIOApp.app",
        "build": "xcodebuild -workspace ios/PaltapIOApp.xcworkspace -scheme PaltapIOApp -configuration Debug -sdk iphonesimula
tor -derivedDataPath ios/build -destination 'name=iPhone 11'",
          "type": "ios.simulator",
-         "name": "iPhone 11"
+         "device": { "name": "iPhone 11", "os": "iOS 14.5" }
      },
      "ios.sim.release": {
        "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/PaltapIOApp.app",
        "build": "xcodebuild -workspace ios/PaltapIOApp.xcworkspace -scheme PaltapIOApp -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -destination 'name=iPhone 11'",
        "type": "ios.simulator",
-         "name": "iPhone 11"
+         "device": { "name": "iPhone 11", "os": "iOS 14.5" }
      }
    }

Not sure about closing this though as it is only a workaround until the template is modified to the above, or until Detox is fixed AND updated.

@glesperance glesperance changed the title End-to-end tests fail with a freshly scaffolded app End-to-end tests fail on iOS 15.0 with a freshly scaffolded app Oct 11, 2021
@derekgreenberg
Copy link
Member

derekgreenberg commented Oct 13, 2021

I like the specific configuration setting of device more than name, even if Detox is updated with the fix for Fishhook, which has been merged into master, but not yet released.

Combined with an update to e2e/README.md that provides some guidance for viewing installed simulators and their OS versions in Xcode, this change to the Detox config will fix this issue for freshly ignited apps.

@infinitered-circleci
Copy link

🎉 This issue has been resolved in version 7.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants