How to access launchEnvironment and launchArguments set in XCUIApplication, running UI tests in XCode?

前端 未结 8 893
陌清茗
陌清茗 2020-12-08 00:30

I\'ve tried setting attributes in the XCUIApplication instance, in my UI Tests setUp()

let app = XCUIApplication()
app.launchEnviro         


        
8条回答
  •  生来不讨喜
    2020-12-08 01:04

    If you need pass the environment variables from your schema to XCUITes, modify the XCTestCase -> app.launchEnvironment object, on each test class of this way:

    Swift 3

    override func setUp(){
        app.launchEnvironment = ProcessInfo.processInfo.environment
    }
    

提交回复
热议问题