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

test(guidepup): accordion #2997

Merged
merged 37 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8635460
docs: adds install commands to readme
bruno-sch Aug 6, 2024
319cab3
feat: adds empty guidepup test for accordion
bruno-sch Aug 6, 2024
3574daa
docs: adds installation guide for playwright and guidepup
bruno-sch Aug 6, 2024
d5f71bc
test: adds ignore line
bruno-sch Aug 6, 2024
5368d69
test: adds guidepup tests for accordion
bruno-sch Aug 6, 2024
7a8724b
feat: added missing snapshot
mfranzke Aug 7, 2024
6e4311e
fix: removes empty last line
bruno-sch Aug 7, 2024
de88b0d
Merge branch 'main' into test-guidepup-accordion
bruno-sch Aug 7, 2024
390a43e
Update README.md
mfranzke Aug 8, 2024
246000f
chore: update snapshots for windows
nmerget Aug 8, 2024
70d182b
Merge remote-tracking branch 'origin/test-guidepup-accordion' into te…
nmerget Aug 8, 2024
ca2e7c0
Merge branch 'main' into test-guidepup-accordion
nmerget Aug 8, 2024
57ea737
fix: issue with sr accordion test
nmerget Aug 8, 2024
0ffa2fb
chore: remove line ending
nmerget Aug 8, 2024
d19f412
Update DBAccordion-should-open-two-items-while-both-remain-unfolded-n…
mfranzke Aug 9, 2024
870e4c3
Merge branch 'main' into test-guidepup-accordion
mfranzke Aug 12, 2024
0b1d736
chore: prettyfication
mfranzke Aug 12, 2024
4199557
Merge branch 'main' into test-guidepup-accordion
mfranzke Aug 12, 2024
032bb28
test: adds title to test, removes obsolete screenshot
bruno-sch Aug 12, 2024
cf879f1
test: simplifies guidepup test for accordion
bruno-sch Aug 13, 2024
9e14bf1
Merge branch 'main' into test-guidepup-accordion
mfranzke Aug 13, 2024
5fc3a76
Merge branch 'main' into test-guidepup-accordion
mfranzke Aug 14, 2024
78468f5
feat: added missing snapshot
mfranzke Aug 14, 2024
e7b23fb
Merge branch 'main' into test-guidepup-accordion
bruno-sch Aug 22, 2024
ba90f9a
chore: merged with main
bruno-sch Aug 22, 2024
6f9ade8
test: improves guidepup accordion test
bruno-sch Aug 22, 2024
8e678fd
test: improves guidepup accordion test
bruno-sch Aug 22, 2024
42278fd
Merge branch 'main' into test-guidepup-accordion
bruno-sch Aug 26, 2024
3335863
Merge branch 'main' into test-guidepup-accordion
bruno-sch Sep 2, 2024
0e10f9d
Merge remote-tracking branch 'origin/test-guidepup-accordion' into te…
bruno-sch Sep 2, 2024
54c7802
Update accordion.spec.ts
mfranzke Sep 2, 2024
3daf19e
Merge branch 'main' into test-guidepup-accordion
bruno-sch Sep 3, 2024
3e658a1
Merge branch 'main' into test-guidepup-accordion
bruno-sch Sep 4, 2024
45e250a
chore: fix input test
bruno-sch Sep 4, 2024
9f9af30
chore: regenerated snapshots for input
bruno-sch Sep 4, 2024
6824e38
chore: update windows sr snapshot for accordion
bruno-sch Sep 4, 2024
cbf294d
Merge remote-tracking branch 'origin/test-guidepup-accordion' into te…
bruno-sch Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions showcases/screen-reader/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# Screen Automated Reader (ScAR 🦁🔥💀)

## Install

```shell
npx playwright install
npx @guidepup/setup
```

If errors occur after the automatic setup of Guidepup (e.g. no connection to Voiceover), the setup must be executed manually. See [instructions](https://www.guidepup.dev/docs/guides/manual-voiceover-setup).

## Start

Start a test with these commands:

## MacOS
### MacOS

```shell
npm run test:screen-reader:macos --workspace=react-showcase -- --ui
```

## Windows
### Windows

```shell
npm run test:screen-reader:windows --workspace=react-showcase -- --ui
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["Item 1 collapsed summary","Item 1 chevron_down expanded summary","Content 1","Item 2 collapsed summary","Item 2 chevron_down expanded summary","Content 2","Item 2 chevron_down expanded summary","Item 1 chevron_down collapsed summary"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["Item 1 collapsed summary","Item 1 chevron_down expanded summary","Content 1","Item 2 collapsed summary","Item 2 chevron_down expanded summary","Content 2","Item 2 chevron_down expanded summary","Content 1","Item 1 chevron_down expanded summary"]
3 changes: 2 additions & 1 deletion showcases/screen-reader/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ const cleanSpeakInstructions = (phraseLog: string[]): string[] =>
sPhrase.includes('To click') ||
sPhrase.includes('To select') ||
sPhrase.includes('To interact') ||
sPhrase.includes('Press Control')
sPhrase.includes('Press Control') ||
sPhrase.includes('To expand')
)
)
.join('. ')
Expand Down
53 changes: 53 additions & 0 deletions showcases/screen-reader/tests/accordion.spec.ts
bruno-sch marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { getTest, testDefault } from '../default';

const test = getTest();

test.describe('DBAccordion', () => {
testDefault({
test,
title: 'should open two items while both remain unfolded (next)',
url: './#/04/accordion?page=behaviour',
async testFn(voiceOver, nvda) {
if (nvda) {
await nvda?.next();
}

const screenReader = voiceOver ?? nvda;
await screenReader?.clearSpokenPhraseLog();
await screenReader?.next(); // Focus: "item 1"
await screenReader?.act(); // Interact: "item 1"
await screenReader?.next(); // Focus: "content 1"
await screenReader?.next(); // Focus: "item 2"
await screenReader?.act(); // Interact: "item 2"
await screenReader?.next(); // Focus: "content 2"
await screenReader?.previous(); // Focus: "item 2"
await screenReader?.previous(); // Focus: "content 1"
await screenReader?.previous(); // Focus: "item 1"
}
});
testDefault({
test,
title: 'one item should open, then the next, whereby the first should then close automatically (next)',
url: './#/04/accordion?page=behaviour',
async testFn(voiceOver, nvda) {
if (nvda) {
await nvda?.next();
}

const screenReader = voiceOver ?? nvda;
await screenReader?.next();
await screenReader?.next();
await screenReader?.next();
await screenReader?.next();
await screenReader?.clearSpokenPhraseLog();
await screenReader?.next(); // Focus example "Single","Item 1"
await screenReader?.act(); // Interact: "item 1"
await screenReader?.next(); // Focus: "content 1"
await screenReader?.next(); // Focus: "item 2"
await screenReader?.act(); // Interact: "item 2"
await screenReader?.next(); // Focus: "content 2"
await screenReader?.previous(); // Focus: "item 2"
await screenReader?.previous(); // Focus: "item 1"
}
});
});
Loading