Giter VIP home page Giter VIP logo

Comments (6)

EvanBacon avatar EvanBacon commented on September 19, 2024 6

@Norfeldt as far as I know, there aren't very good resources right now. I really don't like the current set of workarounds and hacks involved with getting Detox working so I'm not comfortable documenting them at the moment. Here is a pseudo example of using prebuild + detox in a monorepo, it's currently broken.

Somethings we're working on to fix this:

  1. You need to install expo-cli (npm i -g expo-cli) to run expo prebuild (ref). The global CLI takes a while to install and the global node modules aren't cached. To fix this, we're moving expo prebuild into the expo package so it's always versioned, cached, and fast to download.
  2. After we have a CLI interface in the expo package, we'll create a bundle and start command to override the npx react-native bundle and npx react-native start commands. This will enable us to resolve the main entry file using Node.js module resolution (i.e. respect the main field in the package.json), this will reduce the chance of error in monorepos and managed projects which tend to use node_modules/expo/AppEntry.js as the entry file.
  3. After all is working in some capacity, we can write up a step to cache the native build cache files which should introduce some nice time savings.
  4. We should add a feature to detox to automatically choose the first available simulator and emulator, right now it's unclear which devices are available and you end up having to log from the environment.

Really there are too many steps involved. E2E testing, auto screenshots, etc. would benefit a lot from some type of managed CI service.

If you manage to get an example repo working I'd love to hear your findings.

from config-plugins.

Norfeldt avatar Norfeldt commented on September 19, 2024 3

@EvanBacon thank you for taking the time to clarify the current situation. Now I understand that it's not just my googling on 'react native e2e' that is bad, but it's because it's a struggle to get a stable setup (all the examples I have found has been broken).

Yes, a managed CI service would be fantastic ๐ŸŽ‰๐ŸŽ‰ and I'm crossing my fingers for Expo coming to the rescue regarding E2E testing and auto screenshots. Been looking into Appcenter from MS but not much good resources are to find on that either (but the phone farm looks cool).

Expo has been knocking down roadblock in RN land:

  • ๐Ÿข run on physical device ๐Ÿ’ฅ Expo fixed that ๐Ÿ’ฅ
  • ๐Ÿข deploy to stores ๐Ÿ’ฅ Expo fixed that ๐Ÿ’ฅ
  • ๐Ÿข accept payments ๐Ÿ’ฅ Expo fixed that ๐Ÿ’ฅ
  • ๐Ÿข bring the 3rd platform (web) to RN ๐Ÿงจ Expo will fix that* ๐Ÿงจ
  • ๐Ÿข End to end testing ๐Ÿงจ Expo will fix that ๐Ÿงจ

*tried the expo web in the hope of doing test with cypress, but I seem to beak it quickly with even simple components (don't know if it was the hot reloading or something else).

from config-plugins.

jetaix avatar jetaix commented on September 19, 2024

@Norfeldt I think this should be useful to you

"scripts": {
	"e2e:ios": "npm run build:ios && npm run test:ios"
}

source: package.json

from config-plugins.

Norfeldt avatar Norfeldt commented on September 19, 2024

Oh, I thought I could use the plugin in a managed app with the expo go client.

I use a macBook but really enjoy not having to compile locally (or do anything in xcode)

from config-plugins.

EvanBacon avatar EvanBacon commented on September 19, 2024

@Norfeldt sorry for the misunderstanding. On the bright side, E2E tests generally run in CI environments.

from config-plugins.

Norfeldt avatar Norfeldt commented on September 19, 2024

@EvanBacon No need to be sorry about anything. You have been pushing RN with expo in the right direction for years now and I admire the work you do. I'm just having a really hard time finding some good videos/tutorials/guides on how to do detox testing in a managed app (and have a CI with it).

Do you have any good reference materials on how to get started or is there any chance that you could drop a quick YT video of you showing off a very very simple detox with expo?

from config-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.