@@ -18,10 +18,49 @@ await Expect(page.GetByTestId(UiTestIds.Teleprompter.Page))
1818 . ToBeVisibleAsync ( new ( ) { Timeout = BrowserTestConstants . Timing . ExtendedVisibleTimeoutMs } ) ;
1919
2020 await page . GetByTestId ( UiTestIds . Teleprompter . Page ) . FocusAsync ( ) ;
21+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . Space ) ;
22+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . PlayToggle ) )
23+ . ToHaveAttributeAsync (
24+ BrowserTestConstants . State . ActiveAttribute ,
25+ BrowserTestConstants . Teleprompter . ActiveStateValue ) ;
26+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . PauseIcon ) ) . ToBeVisibleAsync ( ) ;
27+
28+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . Space ) ;
29+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . PlayToggle ) )
30+ . ToHaveAttributeAsync (
31+ BrowserTestConstants . State . ActiveAttribute ,
32+ BrowserTestConstants . Teleprompter . InactiveStateValue ) ;
33+
34+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . ArrowRight ) ;
35+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . BlockIndicator ) )
36+ . ToHaveTextAsync ( BrowserTestConstants . Regexes . ReaderSecondBlockIndicator ) ;
37+
38+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . ArrowLeft ) ;
39+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . BlockIndicator ) )
40+ . ToHaveTextAsync ( BrowserTestConstants . Regexes . ReaderFirstBlockIndicator ) ;
41+
42+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . O ) ;
43+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . ClusterWrap ) )
44+ . ToHaveAttributeAsync (
45+ BrowserTestConstants . TeleprompterFlow . ReaderOrientationAttribute ,
46+ BrowserTestConstants . TeleprompterFlow . OrientationPortraitValue ) ;
47+
2148 await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . H ) ;
2249 await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . MirrorHorizontalToggle ) )
2350 . ToHaveAttributeAsync ( BrowserTestConstants . State . ActiveAttribute , BrowserTestConstants . Teleprompter . ActiveStateValue ) ;
2451
52+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . V ) ;
53+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . MirrorVerticalToggle ) )
54+ . ToHaveAttributeAsync ( BrowserTestConstants . State . ActiveAttribute , BrowserTestConstants . Teleprompter . ActiveStateValue ) ;
55+
56+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . Digit2 ) ;
57+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . AlignmentCenter ) )
58+ . ToHaveAttributeAsync ( BrowserTestConstants . State . ActiveAttribute , BrowserTestConstants . Teleprompter . ActiveStateValue ) ;
59+
60+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . Digit3 ) ;
61+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . AlignmentRight ) )
62+ . ToHaveAttributeAsync ( BrowserTestConstants . State . ActiveAttribute , BrowserTestConstants . Teleprompter . ActiveStateValue ) ;
63+
2564 await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . Digit4 ) ;
2665 await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . AlignmentJustify ) )
2766 . ToHaveAttributeAsync ( BrowserTestConstants . State . ActiveAttribute , BrowserTestConstants . Teleprompter . ActiveStateValue ) ;
@@ -35,4 +74,34 @@ await UiScenarioArtifacts.CapturePageAsync(
3574 BrowserTestConstants . Teleprompter . ShortcutScenarioName ,
3675 BrowserTestConstants . Teleprompter . ShortcutStep ) ;
3776 } ) ;
77+
78+ [ Test ]
79+ public Task TeleprompterPage_KeyboardShortcuts_KeepRangeInputFocusFromTriggeringPageShortcuts ( ) =>
80+ RunPageAsync ( async page =>
81+ {
82+ UiScenarioArtifacts . ResetScenario ( BrowserTestConstants . Teleprompter . ShortcutInputFocusScenarioName ) ;
83+
84+ await ReaderRouteDriver . OpenTeleprompterAsync ( page , BrowserTestConstants . Routes . TeleprompterDemo ) ;
85+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . Page ) )
86+ . ToBeVisibleAsync ( new ( ) { Timeout = BrowserTestConstants . Timing . ExtendedVisibleTimeoutMs } ) ;
87+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . BlockIndicator ) )
88+ . ToHaveTextAsync ( BrowserTestConstants . Regexes . ReaderFirstBlockIndicator ) ;
89+
90+ await page . GetByTestId ( UiTestIds . Teleprompter . WidthSlider ) . FocusAsync ( ) ;
91+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . PageDown ) ;
92+
93+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . BlockIndicator ) )
94+ . ToHaveTextAsync ( BrowserTestConstants . Regexes . ReaderFirstBlockIndicator ) ;
95+
96+ await page . Keyboard . PressAsync ( BrowserTestConstants . Keyboard . O ) ;
97+ await Expect ( page . GetByTestId ( UiTestIds . Teleprompter . ClusterWrap ) )
98+ . ToHaveAttributeAsync (
99+ BrowserTestConstants . TeleprompterFlow . ReaderOrientationAttribute ,
100+ BrowserTestConstants . TeleprompterFlow . OrientationLandscapeValue ) ;
101+
102+ await UiScenarioArtifacts . CapturePageAsync (
103+ page ,
104+ BrowserTestConstants . Teleprompter . ShortcutInputFocusScenarioName ,
105+ BrowserTestConstants . Teleprompter . ShortcutInputFocusStep ) ;
106+ } ) ;
38107}
0 commit comments