lundi 26 octobre 2020

Passing environment variables to XCUITest

I run UI tests on CI/CD provider (like CircleCI), I need to read multiple secret environment variables (like testing username and password). I could easily set it but I don't understand how to pass them properly to test cases.

I found 2 ways to do that:

  1. Store it inside shared scheme (in XCode Arguments), it's a bad idea because that secrets shouldn't be stored in git repo.
  2. Injecting variables via text replacement in Swift / Obj-C / xconfig files (like small perl scripts). I don't think that is a good way in 2020.

I use fastlane but haven't found anything about that.

How to do that properly?

Aucun commentaire:

Enregistrer un commentaire