google / google/EarlGrey

Support test recording

Open
#538 2 comments 6 reactions 0 assignees View on GitHub
P2
Dominant language
Objective-C
Stars
5.7k
Forks
737
Avg merge
1d 20h
Merged PRs (30d)
5

Description

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:

1. Developer adds a function call into test case: `EarlGrey.recordTest()`
2. The function call puts app in interactive mode and intercept all input events. Generate code and output to console.
3. 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.

Contributor guide

Open the contributing guide

Research direction

Start from the proposed EarlGrey.recordTest() entry point and the described interactive mode that intercepts input events. Define the smallest supported scope around static-text visibility assertions, button taps, and text-field input, with generated code printed to the console; done means those actions can be recorded and copied into a test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.