Skip to content

Commit

Permalink
Merge pull request #3100 from db-ui/test-guidepup-select
Browse files Browse the repository at this point in the history
Test guidepup select
  • Loading branch information
bruno-sch authored Aug 30, 2024
2 parents 9140294 + c46b4ae commit 474c16f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["Label Functional pop up button","","Option 1","Option 2","Closing menu Option 2 Label Functional pop up button"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["Label, combo box, collapsed, (Default) Regular","expanded. list. list item, 1 of 3","Option 1, not selected, 2 of 3","Option 2, not selected, 3 of 3"]
2 changes: 2 additions & 0 deletions showcases/screen-reader/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const standardPhrases = [
'To begin interacting',
'To display a',
'To move between items',
'To close',
'To choose',
'To toggle'
];

Expand Down
39 changes: 39 additions & 0 deletions showcases/screen-reader/tests/select.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { generateSnapshot, getTest, testDefault } from '../default';

const test = getTest();

test.describe('DBSelect', () => {
testDefault({
test,
title: 'default',
description: 'should open and close select (next())',
url: './#/03/select?page=density',
async testFn(voiceOver, nvda) {
if (nvda) {
await nvda?.press('Tab'); // Focus select
await nvda?.act(); // Open select
await nvda?.next(); // Option 1
await nvda?.next(); // Option 2
} else if (voiceOver) {
await voiceOver?.clearSpokenPhraseLog();
await voiceOver?.next(); // Focus select
await voiceOver?.act(); // Open select
await voiceOver?.press('ArrowDown'); // Move to "Option 1"
await voiceOver?.press('ArrowDown'); // Move to "Option 2"
await voiceOver?.act(); // Select "Option 2"
}
},
async postTestFn(voiceOver, nvda, retry) {
if (nvda) {
await generateSnapshot(nvda, retry);
} else if (voiceOver) {
/*
* There is a timing issue for macOS for reading menu items length
*/
await generateSnapshot(voiceOver, retry, (phraseLog) =>
phraseLog.map((log) => log.replace('menu 3 items ✓', ''))
);
}
}
});
});

0 comments on commit 474c16f

Please sign in to comment.