Search code examples
swiftxcodexcode-ui-testingui-testing

Xcode UI tests recorder generates long lines with multiple options


Are there any settings to reduce the amount of code generated?

This is what gets generated

windowsQuery/*@START_MENU_TOKEN@*/.tabs["{ Test }"]/*[[".tabGroups.tabs[\"{ Test }\"]",".tabs[\"{ Test }\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.click()

whereas everything i need is just

windowsQuery.tabs["{ Test }"].click()

I wouldn't care about that but Swiftlint is complaining. It shows ok in the editor but copy/pasting experience is horrible. It works ok but it's not needed.


Solution

  • Double tapping the optional code converts it into simple text. It's not intuitive but it works on xcode 10.2.1.