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

Introduce ARIA snapshot tests for all components #3271

Merged
merged 11 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:
run: |
USE_BROWSER=firefox bundle exec rake test:system
visual:
name: Visual Regressions
name: Visual and Semantic Markup Regressions
if: ${{ github.event_name == 'pull_request' }}
timeout-minutes: 20
runs-on: ubuntu-latest-8-cores
Expand Down Expand Up @@ -257,17 +257,17 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Generating component snapshots
file_pattern: .playwright/screenshots/**/*.png
file_pattern: .playwright/screenshots/**/*.png .playwright/screenshots/**/*.yml
- name: "Changes detected"
if: steps.auto-commit.outputs.changes_detected == 'true'
uses: phulsechinmay/[email protected]
with:
message: |
### ⚠️ Visual differences found
### ⚠️ Visual or Semantic markup differences found

Our visual comparison tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional.
Our visual and semantic markup comparison tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional.

[Review visual differences](https://github.com/primer/view_components/pull/${{ github.event.number }}/files?file-filters%5B%5D=.png&show-viewed-files=false)
[Review differences](https://github.com/primer/view_components/pull/${{ github.event.number }}/files?file-filters%5B%5D=.png&file-filters%5B%5D=.yml&show-viewed-files=false)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_IDENTIFIER: 'visual-comparison-diff'
- uses: actions/upload-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- toolbar:
- button "Search"
- button "Edit"
- button "Archive"
- button "Heart"
- button "Bookmark"
- button "Mention"
- button "Attach"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- heading "Action List" [level=3]
- list "Action List":
- listitem:
- link "Item one"
- listitem:
- link "Item two"
- listitem:
- link "Item three"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- heading "This is a title" [level=3]
- text: This is a subtitle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- list "List heading":
- listitem:
- link "Active item"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- list "List heading":
- listitem:
- link "Danger item"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- list "List heading":
- listitem:
- link "Default item"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- list "List heading":
- listitem:
- button "Disabled item Item description" [disabled]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- list "List heading":
- listitem:
- link "Item with trailing visual"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- list "List heading":
- listitem:
- link "Default item"
- button "Button tooltip"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- list "List heading":
- listitem:
- link "Default item This is a description"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- list "List heading":
- listitem:
- link "Default item This is a description"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- list "List heading":
- listitem:
- button "Really really long label that may wrap, truncate, or appear as a tooltip"
- listitem:
- button "Really really long label that may wrap, truncate, or appear as a tooltip"
- listitem:
- button "Really really long label that may wrap, truncate, or appear as a tooltip"
- listitem:
- button "Really really long label that may wrap, truncate, or appear as a tooltip"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- button "Menu"
- menu "Menu":
- menuitem "Copy link"
- menuitem "Quote reply"
- menuitem "Reference in new issue"
- menuitem "Edit Change settings"
- menuitem "Delete Sayonara"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Menu"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- button "Menu"
- menu "Menu":
- menuitemcheckbox "langermank Katie Langerman" [checked]
- menuitemcheckbox "jonrohan Jon Rohan"
- menuitemcheckbox "broccolinisoup Armağan Ersöz" [checked]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Menu"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- 'button "Menu: Quote reply"'
- 'menu "Menu: Quote reply"':
- menuitemradio "Copy link Recommended"
- menuitemradio "Quote reply" [checked]
- menuitemradio "Reference in new issue"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- 'button "Menu: Quote reply"'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- button "Menu"
- menu "Menu":
- menuitemradio "Copy link"
- menuitemradio "Quote reply" [checked]
- menuitemradio "Reference in new issue"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Menu"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- button "A wider menu"
- menu "A wider menu":
- menuitemradio "Default This is an example for wide ActionMenus Recommended" [checked]
- menuitemradio "Extended It allows for extended descriptions with extra afforance for additional visuals"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "A wider menu"
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- button "Favorite character"
- menu "Favorite character":
- text: Battlestar Galactica
- group "Battlestar Galactica":
- menuitem "William Adama"
- menuitem "Kara \"Starbuck\" Thrace"
- menuitem "Sharon \"Boomer\" Valerii"
- menuitem "Gaius Baltar"
- text: Star Trek
- group "Star Trek":
- menuitem "Capt. Jean-luc Picard"
- menuitem "Capt. Kathryn M. Janeway"
- menuitem "Capt. Benjamin L. Sisko"
- menuitem "Capt. James T. Kirk"
- text: Star Wars
- group "Star Wars":
- menuitem "Leia Organa"
- menuitem "Luke Skywalker"
- menuitem "Han Solo"
- menuitem "Chewbacca"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Favorite character"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- button "Meal preference"
- menu "Meal preference":
- group:
- menuitem "Meat option"
- text: Vegetarian options
- group "Vegetarian options":
- menuitem "Grilled portbello mushroom"
- menuitem "Polenta"
- menuitem "Seitan"
- group:
- menuitem "Fish option"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Meal preference"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- text: Select a fruit
- combobox "Select a fruit"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- paragraph: This is a dismissable banner.
- button "Dismiss"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- paragraph: This is a full width banner.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- paragraph: This is a danger banner!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- paragraph: This is a default banner.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- paragraph: This is a success banner!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- paragraph: This is a warning banner!
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- paragraph: This is a banner with an action!
- button "Take action"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- paragraph: Did you know? Comments can be edited.
- button "Edit"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Default"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Default"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- checkbox "Jean-Luc Picard": "1"
- text: Jean-Luc Picard With a caption
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- group "I would go into battle with:":
- text: "I would go into battle with: With a caption"
- checkbox "Jean-Luc Picard": picard1
- text: Jean-Luc Picard
- checkbox "Hikaru Sulu": sulu1
- text: Hikaru Sulu
- checkbox "Kathryn Janeway": janeway1
- text: Kathryn Janeway
- checkbox "Benjamin Sisko": sisko1
- text: Benjamin Sisko
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- button "Show Dialog"
- dialog "Test Dialog":
- heading "Test Dialog" [level=1]
- button "Close"
- text: Content
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Show Dialog"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- button "Show overlay"
- button "Show Dialog"
- dialog "Test Dialog":
- heading "Test Dialog" [level=1]
- button "Close"
- text: Content
- button "Cancel"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Show overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- button "Show Dialog"
- dialog "Test Dialog":
- heading "Test Dialog" [level=1]
- button "Close"
- text: Content
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- button "Show Dialog"
- dialog "Test Dialog":
- heading "Test Dialog" [level=1]
- button "Close"
- text: Content
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- button "Show Dialog"
- dialog "Test Dialog":
- heading "Test Dialog" [level=1]
- button "Close"
- text: Content
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Show Dialog"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- button "Show Dialog"
- dialog "Test Dialog":
- heading "Test Dialog" [level=1]
- button "Close"
- text: Content
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- button "Show Dialog"
Loading
Loading