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
Creates tests for the editor view,
this is a prerequisite PR for the fix for #1545.This also adds back a few tests that were previously removed,and adds content to the CodeEditUITests target.I've also added a few helper functions for future UI tests that may require snapshot testing or a test workspace to use.It's also important to note the separation between tests. There's tests for the editor view in both the CodeEditTests target and the CodeEditUITests target. The CodeEditTests target performs tests that can be done without user interaction. For example, creating an editor layout with a certain selection or split layout is done in this target. However for testing the focus button and that focusing a tab correctly displays in a workspace environment, the CodeEditUITests target is used as it can perform interaction.
I've also added small helpers in the CodeEditUITests target to do two things:- Disable sandboxing in the UI Testing app (to allow snapshots to be saved and accessed)- Create a consistent screenshot of an element query (often the snapshot method returns inconsistently sized images that appear exactly the same but are different).Also in this PR:
CommandLine
for checking if the app is being run in debug mode. These checks are only enabled in a debug build. These options should be used in interactive UI tests when they're added back.A note about the previous draft status
Instead of waiting for a (as of writing) 3 year old PR to be merged into the snapshot testing library, I've written a small wrapper that generates a consistent image for an
NSView
or SwiftUIView
regardless of what resolution a machine is running on. This results in snapshots that are 1/2 the quality as they were before, but will be deterministic moving forward.Related Issues
Checklist
Screenshots
No UI Changes