Skip to content

Commit bd182cc

Browse files
committed
fix(a11y-testing-spike): updates to align with barebones
1 parent 650cbb6 commit bd182cc

File tree

8 files changed

+535
-571
lines changed

8 files changed

+535
-571
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ chromatic-diagnostics*.json
138138
chromatic.config.json
139139

140140
# Playwright test reports (generated)
141-
first-gen/test/playwright-a11y/report/
142-
second-gen/test/playwright-a11y/report/
141+
1st-gen/test/playwright-a11y/report/
142+
2nd-gen/test/playwright-a11y/report/
143143

144144
# Playwright test results (generated)
145145
playwright-report/

1st-gen/playwright.a11y.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const config: PlaywrightTestConfig = {
4141
},
4242
{
4343
name: '2nd-gen',
44-
testDir: '../second-gen/',
44+
testDir: '../2nd-gen/',
4545
testMatch: '**/packages/swc/components/*/test/**/*.a11y.spec.ts',
4646
use: {
4747
...devices['Desktop Chrome'],
@@ -58,7 +58,7 @@ const config: PlaywrightTestConfig = {
5858
timeout: 120 * 1000,
5959
},
6060
{
61-
command: 'cd ../second-gen/packages/swc && yarn storybook',
61+
command: 'cd ../2nd-gen/packages/swc && yarn storybook',
6262
port: 6006,
6363
reuseExistingServer: !process.env.CI,
6464
timeout: 120 * 1000,

1st-gen/playwright.config.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

2nd-gen/packages/swc/components/badge/test/badge.a11y.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import AxeBuilder from '@axe-core/playwright';
1414
import { expect, test } from '@playwright/test';
1515

16-
import { gotoStory } from '../../../../../../first-gen/test/a11y-helpers.js';
16+
import { gotoStory } from '../../../../../../1st-gen/test/a11y-helpers.js';
1717

1818
/**
1919
* Accessibility tests for Badge component (2nd Generation)

2nd-gen/packages/swc/components/status-light/test/status-light.a11y.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import AxeBuilder from '@axe-core/playwright';
1414
import { expect, test } from '@playwright/test';
1515

16-
import { gotoStory } from '../../../../../../first-gen/test/a11y-helpers.js';
16+
import { gotoStory } from '../../../../../../1st-gen/test/a11y-helpers.js';
1717

1818
/**
1919
* Accessibility tests for Status Light component (2nd Generation)

ACCESSIBILITY_TESTING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Automatically checks ~50+ WCAG 2.0/2.1 Level A/AA rules:
5050
Create `<component>.a11y.spec.ts` in your component's `test/` directory:
5151

5252
```typescript
53-
// first-gen/packages/badge/test/badge.a11y.spec.ts
53+
// 1st-gen/packages/badge/test/badge.a11y.spec.ts
5454

5555
import { expect, test } from '@playwright/test';
5656
import AxeBuilder from '@axe-core/playwright';
@@ -87,11 +87,11 @@ test.describe('Badge - aXe Validation', () => {
8787
Same pattern, different details:
8888

8989
```typescript
90-
// second-gen/packages/swc/components/badge/test/badge.a11y.spec.ts
90+
// 2nd-gen/packages/swc/components/badge/test/badge.a11y.spec.ts
9191

9292
import { expect, test } from '@playwright/test';
9393
import AxeBuilder from '@axe-core/playwright';
94-
import { gotoStory } from '../../../../../../first-gen/test/a11y-helpers.js';
94+
import { gotoStory } from '../../../../../../1st-gen/test/a11y-helpers.js';
9595

9696
test.describe('Badge - ARIA Snapshots', () => {
9797
test('should have correct accessibility tree', async ({ page }) => {
@@ -125,7 +125,7 @@ test.describe('Badge - aXe Validation', () => {
125125

126126
## Test helper reference
127127

128-
Shared helpers live in `first-gen/test/a11y-helpers.ts` and work for both generations.
128+
Shared helpers live in `1st-gen/test/a11y-helpers.ts` and work for both generations.
129129

130130
### `gotoStory(page, storyId, elementSelector)`
131131

@@ -206,10 +206,10 @@ yarn test:a11y:2nd # Only 2nd generation
206206
yarn test:a11y:ui # Interactive UI mode
207207
```
208208

209-
### From first-gen directory
209+
### From 1st-gen directory
210210

211211
```zsh
212-
cd first-gen
212+
cd 1st-gen
213213

214214
yarn test:a11y # All tests
215215
yarn test:a11y badge # Specific component
@@ -326,7 +326,7 @@ Received: [
326326
327327
### Playwright config
328328
329-
`first-gen/playwright.a11y.config.ts` defines two projects:
329+
`1st-gen/playwright.a11y.config.ts` defines two projects:
330330
331331
```typescript
332332
projects: [
@@ -357,7 +357,7 @@ webServer: [
357357
reuseExistingServer: !process.env.CI,
358358
},
359359
{
360-
command: 'cd ../second-gen/packages/swc && yarn storybook',
360+
command: 'cd ../2nd-gen/packages/swc && yarn storybook',
361361
port: 6006,
362362
reuseExistingServer: !process.env.CI,
363363
},
@@ -369,7 +369,7 @@ webServer: [
369369
```
370370
spectrum-web-components/
371371
├── ACCESSIBILITY_TESTING.md # This guide
372-
├── first-gen/
372+
├── 1st-gen/
373373
│ ├── playwright.a11y.config.ts # Playwright config (both gens)
374374
│ ├── package.json # Test scripts
375375
│ ├── test/
@@ -381,7 +381,7 @@ spectrum-web-components/
381381
│ └── status-light/test/
382382
│ ├── status-light.a11y.spec.ts
383383
│ └── status-light.a11y.spec.ts-snapshots/
384-
└── second-gen/packages/swc/components/
384+
└── 2nd-gen/packages/swc/components/
385385
├── badge/test/
386386
│ ├── badge.a11y.spec.ts
387387
│ └── badge.a11y.spec.ts-snapshots/

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@
1515
},
1616
"type": "module",
1717
"scripts": {
18-
"build": "yarn build:first-gen && yarn build:second-gen",
19-
"build:first-gen": "yarn workspace @adobe/spectrum-web-components build",
20-
"build:second-gen": "yarn workspace @adobe/swc build",
21-
"lint": "yarn lint:first-gen && yarn lint:second-gen",
22-
"lint:first-gen": "yarn workspace @adobe/spectrum-web-components lint",
23-
"lint:second-gen": "yarn workspace @adobe/swc lint",
18+
"build": "yarn build:1st-gen && yarn build:2nd-gen",
19+
"build:1st-gen": "yarn workspace @spectrum-web-components/1st-gen build",
20+
"build:2nd-gen": "yarn workspace @adobe/swc build",
21+
"lint": "yarn lint:1st-gen && yarn lint:2nd-gen",
22+
"lint:1st-gen": "yarn workspace @spectrum-web-components/1st-gen lint",
23+
"lint:2nd-gen": "yarn workspace @adobe/swc lint",
2424
"postinstall": "husky || true && patch-package",
25-
"start": "yarn start:first-gen & yarn start:second-gen",
26-
"start:first-gen": "yarn workspace @adobe/spectrum-web-components start",
27-
"start:second-gen": "yarn workspace @adobe/swc start",
28-
"test": "yarn test:first-gen & yarn test:second-gen",
29-
"test:first-gen": "yarn workspace @adobe/spectrum-web-components test",
30-
"test:second-gen": "yarn workspace @adobe/swc test",
31-
"test:a11y": "yarn workspace @adobe/spectrum-web-components test:a11y",
32-
"test:a11y:ui": "yarn workspace @adobe/spectrum-web-components test:a11y:ui",
33-
"test:a11y:1st": "yarn workspace @adobe/spectrum-web-components test:a11y:1st",
34-
"test:a11y:2nd": "yarn workspace @adobe/spectrum-web-components test:a11y:2nd"
25+
"start": "yarn start:1st-gen & yarn start:2nd-gen",
26+
"start:1st-gen": "yarn workspace @spectrum-web-components/1st-gen start",
27+
"start:2nd-gen": "yarn workspace @adobe/swc start",
28+
"test": "yarn test:1st-gen & yarn test:2nd-gen",
29+
"test:1st-gen": "yarn workspace @spectrum-web-components/1st-gen test",
30+
"test:2nd-gen": "yarn workspace @adobe/swc test",
31+
"test:a11y": "yarn workspace @spectrum-web-components/1st-gen test:a11y",
32+
"test:a11y:ui": "yarn workspace @spectrum-web-components/1st-gen test:a11y:ui",
33+
"test:a11y:1st": "yarn workspace @spectrum-web-components/1st-gen test:a11y:1st",
34+
"test:a11y:2nd": "yarn workspace @spectrum-web-components/1st-gen test:a11y:2nd"
3535
},
3636
"workspaces": [
37-
"first-gen",
38-
"first-gen/packages/*",
39-
"first-gen/tools/*",
40-
"first-gen/linters/*",
41-
"second-gen",
42-
"second-gen/packages/*"
37+
"1st-gen",
38+
"1st-gen/packages/*",
39+
"1st-gen/tools/*",
40+
"1st-gen/linters/*",
41+
"2nd-gen",
42+
"2nd-gen/packages/*"
4343
],
4444
"resolutions": {
4545
"playwright": "1.53.1"

0 commit comments

Comments
 (0)