Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lay Foundation For Automation Testing #1804

Merged
merged 5 commits into from
Jul 12, 2024

Conversation

thecoolwinter
Copy link
Collaborator

@thecoolwinter thecoolwinter commented Jul 10, 2024

Description

  • Lays the foundations for automation testing, filling out the first automation test and getting a few handy types ready.
  • Makes a few small changes to the editor tabs:
    • They're no longer a button due to it removing all accessibility elements from the tab.
    • The Close button and label register in accessibility inspection.
    • When the tab is clicked down, the tab turns grey (exactly like Xcode).
    • On light mode, the close button's click color has been lightened.
    • The isPressed modifier is not activated when the close button is being hovered (Exactly like Xcode).
    • The tab switch action is only activated on mouse up and if the mouse is inside the tab.
  • Adds accessibility labels, identifiers and elements to various components in the app.
  • Converts the project to use a test plan instead of schemes (any automations that run tests work the same).
  • Fixed a small bug that's been buggin (haha) me for a while where the navigator's tab buttons would focus when the app launched. I disabled focusing them and it fixed it, they're still keyboard navigable.
  • Also made the tab bars have accessibility labels and identifiers instead of just image descriptions.

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

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

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):
Screenshot 2024-07-10 at 4 02 22 PM

New tab accessibility inspection. Tab title and close button are differentiated. Tab bar is labeled.
Screenshot 2024-07-10 at 4 09 14 PM

@thecoolwinter thecoolwinter mentioned this pull request Jul 10, 2024
6 tasks
@thecoolwinter thecoolwinter merged commit f3524cc into CodeEditApp:main Jul 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants