-
Notifications
You must be signed in to change notification settings - Fork 1.2k
adding accessibility checks #15174
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
base: main
Are you sure you want to change the base?
adding accessibility checks #15174
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,149 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| parameters: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: buildEnvironment | ||||||||||||||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||||||||||||||
| default : PullRequest | ||||||||||||||||||||||||||||||||||||||||||||||||||
| values: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - PullRequest | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - SecurePullRequest | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - Continuous | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: AgentPool | ||||||||||||||||||||||||||||||||||||||||||||||||||
| type: object | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - job: AccessibilityTests | ||||||||||||||||||||||||||||||||||||||||||||||||||
| displayName: 'Accessibility Tests with React Native Gallery' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pool: ${{ parameters.AgentPool.Small }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| timeoutInMinutes: 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| condition: eq('${{ parameters.buildEnvironment }}', 'PullRequest') | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - template: ../templates/prepare-build-env.yml | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - template: ../templates/yarn-install.yml | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Download latest React Native Gallery | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - script: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Downloading latest React Native Gallery..." | ||||||||||||||||||||||||||||||||||||||||||||||||||
| git clone --depth 1 https://github.com/microsoft/react-native-gallery.git $(Agent.TempDirectory)\react-native-gallery | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cd $(Agent.TempDirectory)\react-native-gallery | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Gallery version: $(git describe --tags --always --dirty)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "##vso[task.setvariable variable=GalleryPath]$(Agent.TempDirectory)\react-native-gallery" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| displayName: 'Download React Native Gallery' | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install React Native Gallery dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - script: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cd $(GalleryPath) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| yarn install --frozen-lockfile | ||||||||||||||||||||||||||||||||||||||||||||||||||
| displayName: 'Install Gallery Dependencies' | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Build React Native Gallery Windows app | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - script: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cd $(GalleryPath) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| npx react-native run-windows --no-launch --no-packager --arch x64 --release | ||||||||||||||||||||||||||||||||||||||||||||||||||
| displayName: 'Build Gallery Windows App' | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install accessibility testing tools if not already present | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - script: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Installing accessibility testing tools..." | ||||||||||||||||||||||||||||||||||||||||||||||||||
| yarn add --dev @axe-core/cli axe-playwright @playwright/test | ||||||||||||||||||||||||||||||||||||||||||||||||||
| yarn add --dev accessibility-checker | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| yarn add --dev accessibility-checker |
Copilot uses AI. Check for mistakes.
protikbiswas100 marked this conversation as resolved.
Show resolved
Hide resolved
protikbiswas100 marked this conversation as resolved.
Show resolved
Hide resolved
protikbiswas100 marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The axe command is trying to test http://localhost:8081 but there's no evidence that a web server is started on this port. The Gallery app is launched as a native Windows executable, not a web server.
| npx axe --chrome-options="--no-sandbox --disable-dev-shm-usage" --save accessibility-results.json --reporter json http://localhost:8081 || true | |
| # Also run accessibility checks on any locally running RNW components | |
| # The axe CLI cannot be used directly on the native Windows app, as it is not served on http://localhost:8081. | |
| # To run accessibility checks, use Playwright or another tool to automate the native app UI. | |
Copilot uses AI. Check for mistakes.
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bash-style script with pipes and grep commands will fail on Windows agents. The pipeline should use PowerShell commands or cross-platform alternatives since this is targeting Windows build agents.
| - script: | | |
| echo "Checking PR changes for accessibility compliance..." | |
| git diff origin/main --name-only | grep -E "\.(tsx?|jsx?)$" | head -20 | while read file; do | |
| if [ -f "$file" ]; then | |
| echo "Scanning $file for accessibility patterns..." | |
| # Check for accessibility props | |
| grep -n "accessibility\|testID\|aria-" "$file" || echo "No accessibility props found in $file" | |
| fi | |
| done | |
| - powershell: | | |
| Write-Host "Checking PR changes for accessibility compliance..." | |
| $files = git diff origin/main --name-only | Select-String -Pattern '\.(ts|tsx|js|jsx)$' | Select-Object -First 20 | |
| foreach ($fileObj in $files) { | |
| $file = $fileObj.ToString().Trim() | |
| if (Test-Path $file) { | |
| Write-Host "Scanning $file for accessibility patterns..." | |
| $matches = Select-String -Pattern 'accessibility|testID|aria-' -Path $file -SimpleMatch | |
| if ($matches) { | |
| $matches | ForEach-Object { Write-Host $_ } | |
| } else { | |
| Write-Host "No accessibility props found in $file" | |
| } | |
| } | |
| } |
Copilot uses AI. Check for mistakes.
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pipeline expects JUnit XML files but the accessibility tools are configured to generate JSON files (accessibility-results.json). Either change the expected format to match the generated files or configure the tools to output XML format.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Gallery app is built with --no-packager flag but later the accessibility check tries to connect to localhost:8081, which is typically the Metro bundler port. This creates an inconsistency since the packager won't be running.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it say Azure Pipelines failed to run 2 pipeline(s)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot why did Azure Pipelines failed to run