Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate Detox with Fastlane

I did set up some e2e tests with detox for my react-native app. I'm running those tests manually with the detox test command, but I cannot find (neither in the detox's issues, nor in Fastlane's documentation) a way to integrate these tests directly in Fastlane. None of these options seems to be adapted to what I'm looking for.

Anyone managed to implement this before or do I have to find a workaround for this?

Thanks in advance!

like image 442
Guillaume Munsch Avatar asked Oct 27 '22 00:10

Guillaume Munsch


1 Answers

I solved it for iOS (./ios/fastlane/Fastfile) in the following way:

platform :ios do

  lane :e2e do
    Dir.chdir "../.." do # Navigate to the root of the project where the Detox files are placed.
      sh("detox build --configuration ios.sim.release")
      sh("detox test --configuration ios.sim.release --cleanup")
    end
  end

end

And Android (./android/fastlane/Fastfile):

platform :android do

  lane :e2e do
    Dir.chdir "../.." do # Navigate to the root of the project where the Detox files are placed.
      sh("detox build --configuration android.emu.release")
      sh("detox test --configuration android.emu.release --cleanup")
    end
  end

end
like image 89
Bart van Kleef Avatar answered Nov 15 '22 12:11

Bart van Kleef