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

前端 未结 8 873
陌清茗
陌清茗 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 00:46

    Bear in mind a few details. Firstly, XCUIAppliction is not a singleton, therefore, if you call XCUIApplication().arguments.append("myargument") and then you call XCUIApplication().launch(), it won't send the arguments. Check it here.

    Second, if you modify the arguments after launching the app it won't work, it will send the new arguments to the next execution.

提交回复
热议问题