简体   繁体   中英

How to run unit test only in Fastlane

Is there a way to run unit tests only?

Currently, run_test ( https://docs.fastlane.tools/actions/run_tests/ ) will trigger both UI and unit test

Do you have a separate XCode scheme for UI and Unit tests? If it's so, you can specify a scheme to run which contains only UI/Unit tests:

run_tests(
  workspace: "App.xcworkspace",
  scheme: "MyAppUITests"
)

在此处输入图像描述 在此处输入图像描述

I can make it with UI testing schema. However, I still fails on unit test scheme. i can see this kind of error in fastlane

  lane :testsunit do
    run_tests(
      scheme: "XXX_Dev_UnitTests",
      # devices: ["iPhone 7", "iPhone 12"],
      )
  end

The scheme 'XXXX_Dev_UnitTests' has nothing configured to build for Running and has no executable specified to Run. Edit the scheme to configure the Run action. [10:04:50]: Exit status: 70

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM