Skip to content

Commit

Permalink
Merge pull request #3007 from db-ui/test-guidepup-brand
Browse files Browse the repository at this point in the history
test: adds guidepup test for brand
  • Loading branch information
bruno-sch authored Aug 14, 2024
2 parents ed2b034 + 5c19e02 commit 57c2505
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions showcases/screen-reader/__snapshots__/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# https://editorconfig.org/

[*.txt]
insert_final_newline = false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["(Default) With Logo","No Logo","this is a fancy placeholder logo image","Custom Logo"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["(Default) With Logo No Logo","graphic, this is a fancy placeholder logo","Custom Logo"]
3 changes: 2 additions & 1 deletion showcases/screen-reader/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const standardPhrases = [
'To click',
'To select',
'To interact',
'Press Control'
'Press Control',
'To begin interacting'
];

const cleanSpeakInstructions = (phraseLog: string[]): string[] =>
Expand Down
28 changes: 28 additions & 0 deletions showcases/screen-reader/tests/brand.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { getTest, testDefault } from '../default';

const test = getTest();

test.describe('DBBrand', () => {
testDefault({
test,
title: 'default',
description:
'should have inline texts, no icons, but the custom logo as image (next())',
url: './#/04/brand?page=variants',
async testFn(voiceOver, nvda) {
if (voiceOver) {
await voiceOver?.previous(); // Label 1
await voiceOver?.next(); // Label 2
await voiceOver?.next(); // Logo image
await voiceOver?.next(); // Label 3
} else if (nvda) {
/* We don't have a focusable element, so we are initially on the browser (i) button */
await nvda.press('Shift+Tab'); // Jump into the website
await nvda?.clearSpokenPhraseLog();
await nvda?.previous(); // Label 1 + 2
await nvda?.next(); // Logo image
await nvda?.next(); // Label 3
}
}
});
});

0 comments on commit 57c2505

Please sign in to comment.