EarlGrey
EarlGrey copied to clipboard
Support test recording
I recently evaluated EarlGrey and XCUITest frameworks to understand pros and cons of each. I found the biggest advantage of EarlGrey is that since my test code runs inside the app process I can launch any view controller directly with different combinations of input parameters. Tests run a lot faster and I don't have to set up many objects (such as user profiles) on server side. The advantage of XCUITest is the test recorder. It puts the app in interactive mode so I can manually drive the UI while xcode records everything. In EarlGrey I often need to add button tap code, rebuild and run it, break it under debugger, inspect element tree to see what attributes to use for the next tap. I wonder if it's possible to add recording to EarlGrey:
- Developer adds a function call into test case:
EarlGrey.recordTest()
- The function call puts app in interactive mode and intercept all input events. Generate code and output to console.
- Developer copies code from console into file.
It doesn't have to work perfectly. If it can handle actions on static text (assert visible), buttons (perform tap action) and text fields (input text), that would save developers tons of work.
This is definitely on our radar but we will likely get to it after EG 2.0 is released.
Is this feature in progress?