Skip to content

Commit 44314db

Browse files
committed
Skip tests expected to fail in screen reader mode
1 parent 68ac963 commit 44314db

11 files changed

+166
-66
lines changed

test/CompletionTest.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ public void MenuCompletions_FilterByTyping()
177177
[SkippableFact]
178178
public void MenuCompletions_Navigation1()
179179
{
180+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
181+
180182
// Test 'RightArrow' and 'LeftArrow' with the following menu:
181183
// Get-Many0 Get-Many3 Get-Many6 Get-Many9 Get-Many12
182184
// Get-Many1 Get-Many4 Get-Many7 Get-Many10 Get-Many13
@@ -304,6 +306,8 @@ public void MenuCompletions_Navigation1()
304306
[SkippableFact]
305307
public void MenuCompletions_Navigation2()
306308
{
309+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
310+
307311
// Test 'RightArrow' with the following menu:
308312
// Get-Less0 Get-Less3 Get-Less6 Get-Less9 Get-Less12
309313
// Get-Less1 Get-Less4 Get-Less7 Get-Less10
@@ -387,6 +391,8 @@ public void MenuCompletions_Navigation2()
387391
[SkippableFact]
388392
public void MenuCompletions_Navigation3()
389393
{
394+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
395+
390396
// Test 'LeftArrow' with the following menu:
391397
// Get-Less0 Get-Less3 Get-Less6 Get-Less9 Get-Less12
392398
// Get-Less1 Get-Less4 Get-Less7 Get-Less10
@@ -462,6 +468,8 @@ public void MenuCompletions_Navigation3()
462468
[SkippableFact]
463469
public void MenuCompletions_Navigation4()
464470
{
471+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
472+
465473
// Test 'UpArrow' and 'DownArrow' with the following menu:
466474
// Get-Less0 Get-Less3 Get-Less6 Get-Less9 Get-Less12
467475
// Get-Less1 Get-Less4 Get-Less7 Get-Less10
@@ -633,6 +641,8 @@ public void MenuCompletions_Navigation5()
633641
[SkippableFact]
634642
public void MenuCompletions_Navigation6()
635643
{
644+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
645+
636646
// Test 'UpArrow', 'DownArrow', 'LeftArrow', and 'RightArrow' with the following menu:
637647
// Get-NewDynamicParameters Get-NewStyle
638648
// Get-NewIdea
@@ -736,6 +746,8 @@ public void MenuCompletions_Navigation6()
736746
[SkippableFact]
737747
public void MenuCompletions_Navigation7()
738748
{
749+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
750+
739751
// Trigger the menu completion from the last line in the screen buffer, which will cause the screen
740752
// to scroll up. Then test 'DownArrow' and 'UpArrow' with the following menu to verify if scrolling
741753
// was handled correctly:
@@ -968,6 +980,8 @@ public void MenuCompletions_ClearProperly()
968980
[SkippableFact]
969981
public void MenuCompletions_WorkWithListView()
970982
{
983+
Skip.If(ScreenReaderModeEnabled, "List view is not supported in screen reader mode.");
984+
971985
TestSetup(KeyMode.Cmd, new KeyHandler("Ctrl+Spacebar", PSConsoleReadLine.MenuComplete));
972986

973987
int listWidth = CheckWindowSize();
@@ -1032,6 +1046,8 @@ public void MenuCompletions_WorkWithListView()
10321046
[SkippableFact]
10331047
public void MenuCompletions_HandleScrolling1()
10341048
{
1049+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
1050+
10351051
// This test case covers the fix to https://github.com/PowerShell/PSReadLine/issues/2928.
10361052
var basicScrollingConsole = new BasicScrollingConsole(keyboardLayout: _, width: 133, height: 10);
10371053
TestSetup(basicScrollingConsole, KeyMode.Cmd, new KeyHandler("Ctrl+Spacebar", PSConsoleReadLine.MenuComplete));
@@ -1127,6 +1143,8 @@ public void MenuCompletions_HandleScrolling1()
11271143
[SkippableFact]
11281144
public void MenuCompletions_HandleScrolling2()
11291145
{
1146+
Skip.If(ScreenReaderModeEnabled, "Menu completions are not supported in screen reader mode.");
1147+
11301148
// This test case covers the fix to https://github.com/PowerShell/PSReadLine/issues/2948.
11311149
var basicScrollingConsole = new BasicScrollingConsole(keyboardLayout: _, width: 133, height: 10);
11321150
TestSetup(basicScrollingConsole, KeyMode.Cmd, new KeyHandler("Ctrl+Spacebar", PSConsoleReadLine.MenuComplete));

test/DigitArgumentTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public void DigitArgumentValues()
4646
[SkippableFact]
4747
public void DigitArgumentPrompt()
4848
{
49+
Skip.If(ScreenReaderModeEnabled, "Digit argument prompt is not supported in screen reader mode.");
50+
4951
TestSetup(KeyMode.Emacs);
5052

5153
Test("", Keys(

test/HistoryTest.VI.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public void ViHistory()
5353
[SkippableFact]
5454
public void ViSearchHistory()
5555
{
56+
Skip.If(ScreenReaderModeEnabled, "Incremental search prompt is not supported in screen reader mode.");
57+
5658
TestSetup(KeyMode.Vi);
5759

5860
// Clear history in case the above added some history (but it shouldn't)

test/HistoryTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@ public void EndOfHistory()
882882
[SkippableFact]
883883
public void InteractiveHistorySearch()
884884
{
885+
Skip.If(ScreenReaderModeEnabled, "Incremental search prompt is not supported in screen reader mode.");
886+
885887
TestSetup(KeyMode.Emacs);
886888

887889
SetHistory("echo aaa");

test/InlinePredictionTest.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public partial class ReadLine
1414
[SkippableFact]
1515
public void Inline_RenderSuggestion()
1616
{
17+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
18+
1719
TestSetup(KeyMode.Cmd,
1820
new KeyHandler("Ctrl+f", PSConsoleReadLine.ForwardWord));
1921
using var disp = SetPrediction(PredictionSource.History, PredictionViewStyle.InlineView);
@@ -92,6 +94,8 @@ public void Inline_RenderSuggestion()
9294
[SkippableFact]
9395
public void Inline_CustomKeyBindingsToAcceptSuggestion()
9496
{
97+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
98+
9599
TestSetup(KeyMode.Cmd,
96100
new KeyHandler("Alt+g", PSConsoleReadLine.AcceptSuggestion),
97101
new KeyHandler("Alt+f", PSConsoleReadLine.AcceptNextSuggestionWord));
@@ -156,6 +160,8 @@ public void Inline_CustomKeyBindingsToAcceptSuggestion()
156160
[SkippableFact]
157161
public void Inline_AcceptNextSuggestionWordCanAcceptMoreThanOneWords()
158162
{
163+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
164+
159165
TestSetup(KeyMode.Cmd,
160166
new KeyHandler("Ctrl+f", PSConsoleReadLine.ForwardWord),
161167
new KeyHandler("Alt+f", PSConsoleReadLine.AcceptNextSuggestionWord));
@@ -192,6 +198,8 @@ public void Inline_AcceptNextSuggestionWordCanAcceptMoreThanOneWords()
192198
[SkippableFact]
193199
public void Inline_AcceptSuggestionWithSelection()
194200
{
201+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
202+
195203
TestSetup(KeyMode.Cmd,
196204
new KeyHandler("Ctrl+f", PSConsoleReadLine.ForwardWord));
197205
using var disp = SetPrediction(PredictionSource.History, PredictionViewStyle.InlineView);
@@ -261,6 +269,8 @@ public void Inline_DisablePrediction()
261269
[SkippableFact]
262270
public void Inline_SetPredictionColor()
263271
{
272+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
273+
264274
TestSetup(KeyMode.Cmd);
265275
var predictionColor = MakeCombinedColor(ConsoleColor.DarkYellow, ConsoleColor.Yellow);
266276
var predictionColorToCheck = Tuple.Create(ConsoleColor.DarkYellow, ConsoleColor.Yellow);
@@ -288,6 +298,8 @@ public void Inline_SetPredictionColor()
288298
[SkippableFact]
289299
public void Inline_HistoryEditsCanUndoProperly()
290300
{
301+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
302+
291303
TestSetup(KeyMode.Cmd,
292304
new KeyHandler("Ctrl+f", PSConsoleReadLine.ForwardWord));
293305
SetHistory("git checkout -b branch origin/bbbb");
@@ -320,6 +332,8 @@ public void Inline_HistoryEditsCanUndoProperly()
320332
[SkippableFact]
321333
public void Inline_AcceptSuggestionInVIMode()
322334
{
335+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
336+
323337
TestSetup(KeyMode.Vi);
324338
using var disp = SetPrediction(PredictionSource.History, PredictionViewStyle.InlineView);
325339

@@ -367,6 +381,8 @@ public void Inline_AcceptSuggestionInVIMode()
367381
[SkippableFact]
368382
public void ViDefect2408()
369383
{
384+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
385+
370386
TestSetup(KeyMode.Vi);
371387
using var disp = SetPrediction(PredictionSource.History, PredictionViewStyle.InlineView);
372388

@@ -460,6 +476,8 @@ internal static List<PredictionResult> MockedPredictInput(Ast ast, Token[] token
460476
[SkippableFact]
461477
public void Inline_PluginSource_Acceptance()
462478
{
479+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
480+
463481
// Using the 'Plugin' source will make PSReadLine get prediction from the plugin only.
464482
TestSetup(KeyMode.Cmd,
465483
new KeyHandler("Ctrl+f", PSConsoleReadLine.ForwardWord));
@@ -534,6 +552,8 @@ public void Inline_PluginSource_Acceptance()
534552
[SkippableFact]
535553
public void Inline_HistoryAndPluginSource_Acceptance()
536554
{
555+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
556+
537557
// Using the 'HistoryAndPlugin' source will make PSReadLine get prediction from the plugin and history,
538558
// and plugin takes precedence.
539559
TestSetup(KeyMode.Cmd,
@@ -798,6 +818,8 @@ public void Inline_HistoryAndPluginSource_ExecutionStatus()
798818
[SkippableFact]
799819
public void Inline_TruncateVeryLongSuggestion()
800820
{
821+
Skip.If(ScreenReaderModeEnabled, "Inline predictions are not supported in screen reader mode.");
822+
801823
TestSetup(new TestConsole(keyboardLayout: _, width: 10, height: 2), KeyMode.Cmd);
802824
using var disp = SetPrediction(PredictionSource.History, PredictionViewStyle.InlineView);
803825

test/KeyBindingsTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public partial class ReadLine
99
[SkippableFact]
1010
public void WhatIsKey()
1111
{
12+
Skip.If(ScreenReaderModeEnabled, "The what-is-key prompt is not supported in screen reader mode.");
13+
1214
TestSetup(KeyMode.Cmd);
1315

1416
Test("", Keys(

0 commit comments

Comments
 (0)