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

Can't run detox tests for the iOS native app #254

Closed
katnem opened this issue Aug 31, 2017 · 11 comments
Closed

Can't run detox tests for the iOS native app #254

katnem opened this issue Aug 31, 2017 · 11 comments

Comments

@katnem
Copy link

katnem commented Aug 31, 2017

Description

I'm trying to run the detox tests for the example native iOS app and getting the following:
Error: Cannot find module 'babel-polyfill' ... Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.release ...
I've installed the 'babel-polyfill', but now getting similar error for module 'npmlog'. Installing that module didn't help.

Node, Device, Xcode and macOS Versions

  • Node: v8.4.0
  • Device: iphone 7 plus (iOS 10.3)
  • Xcode: 8.3.3
  • macOS: 10.12.6
@LeoNatan
Copy link
Contributor

LeoNatan commented Sep 5, 2017

Our demo projects have not been maintained in quite a while, sadly. We will have to fix them at some point. Thanks for your report.

In the mean time, you can test it on your own app by following the documentation.

@katnem
Copy link
Author

katnem commented Sep 14, 2017

Hi @LeoNatan, I've browsed through the docs and didn't find any mention of dealing with native iOS apps. Say, if I'm managing dependencies via cocoapods, I can't even build with detox (CompileSwiftSources fails when external libs are encountered, e.g. Alamofire).
Is there any documentation I've missed?

@LeoNatan
Copy link
Contributor

@rotemmiz Can you please assist here? Thanks

@katnem Ifnypu have a native project, you shouldn’t bring Detox with CocoaPods. Build your project as you normally do. You should bring Detox using npm or yarn.

@LeoNatan
Copy link
Contributor

Please know there is an active issue with swift which we intend to solve really soon.

@katnem
Copy link
Author

katnem commented Sep 15, 2017

@LeoNatan Yeah, I meant for the native stuff I use cocoapods and npm for detox. What I meant by building with detox was this: detox build --configuration ios.sim.release

@LeoNatan
Copy link
Contributor

Are you sure you have provided the correct build command in package json? E.g, with CocoaPods, you should build the workspace and not just the project.

@katnem
Copy link
Author

katnem commented Sep 18, 2017

Right, I was building the project rather than workspace, so now able to build. No luck with the test bit (detox test --configuration ios.sim.release) though (same issue as described at the very beginning). My structure within e2e dir looks like this:
PageObjects init.js my_test.spec.js mocha.opts

@LeoNatan
Copy link
Contributor

@katnem Hey, were you able to resolve your issue? Our Swift issue has been fixed since a while ago. Please try again.

@katnem
Copy link
Author

katnem commented Nov 9, 2017

Hi @LeoNatan , unfortunately, I don't have my old setup anymore to verify the issue. However, I've tried to run the tests for the example project that you have
[https://github.com/wix/detox/tree/master/examples/demo-native-ios] and have the same issue when running tests:
`detox test --configuration ios.sim.release
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.release
module.js:491
throw err;
^

Error: Cannot find module 'babel-polyfill'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
...`.
Environment details:
Node: v8.3.0
Device: iphone 7 plus (iOS 10.3)
Xcode: 9.1
macOS: 10.13.1

@karkb
Copy link

karkb commented Nov 20, 2017

Hey @katnem, I had the same issue, but it's already fixed by adding babel-polyfill. I did not get npmlog error.

Environment details:
Node: v8.0.0 ( which I think you give it try )
Device: iphone 7 (iOS 11.1)
Xcode: 9.1
macOS: 10.12.6

(EDIT)

  • I realized that I was able to run the test of this exmple: detox/examples/demo-react-native

  • For detox/test example I got npmlog error. same issue here.

@LeoNatan
Copy link
Contributor

Thanks guys. I will close this issue for now. Feel free to open a new issue if you hit this. I am still not sure whether a Detox issue or an environment mishap.

@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

3 participants