Lay Foundation For Automation Testing #1804
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Note
This is not using snapshot testing, snapshot testing does not work for automation testing. Automation testing won't test if an element has changed exactly but is useful for testing flows in an app.
For instance, the implemented test opens a file, checks that it was opened, opens a folder, checks it loaded files, closes the folder, and checks that it hid files. If the UI was the wrong color, it wouldn't catch it. But if a bug was introduced crashing the app when a folder is opened, it would catch it.
The second (rather large) benefit is we get much better accessibility support for CodeEdit due to the fact that automation testing uses the accessibility API to navigate the app. If our app isn't accessible, we can't test it. So even in this small PR I've made three components much more accessible very quickly.
Related Issues
N/A
Checklist
Screenshots
Xcode tabs:
Screen.Recording.2024-07-10.at.3.59.29.PM.mov
CodeEdit tabs:
Screen.Recording.2024-07-10.at.4.00.19.PM.mov
Previous tab accessibility inspection (note the lack of button, no separation between button and label, close button is an image):
New tab accessibility inspection. Tab title and close button are differentiated. Tab bar is labeled.