Skip to content

Commit 9398dff

Browse files
authored
Minor test changes (#1027)
1 parent c8e2453 commit 9398dff

File tree

3 files changed

+14
-27
lines changed

3 files changed

+14
-27
lines changed

lib/PuppeteerSharp.Tests/ConnectionTests/ConnectionTests.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ public ConnectionTests(ITestOutputHelper output) : base(output)
1111
{
1212
}
1313

14-
[Fact]
15-
public async Task ShouldThrowNiceErrors()
16-
{
17-
var exception = await Assert.ThrowsAsync<MessageException>(async () =>
18-
{
19-
await TheSourceOfTheProblems();
20-
});
21-
Assert.Contains("TheSourceOfTheProblems", exception.StackTrace);
22-
Assert.Contains("ThisCommand.DoesNotExist", exception.Message);
23-
}
24-
2514
[Fact]
2615
public async Task ShouldCleanCallbackList()
2716
{
@@ -33,7 +22,5 @@ public async Task ShouldCleanCallbackList()
3322
await Page.SetJavaScriptEnabledAsync(true);
3423
Assert.False(Page.Client.HasPendingCallbacks());
3524
}
36-
37-
private async Task TheSourceOfTheProblems() => await Page.Client.SendAsync("ThisCommand.DoesNotExist");
3825
}
3926
}

lib/PuppeteerSharp.Tests/InputTests/KeyboardTests.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,6 @@ await Page.EvaluateExpressionAsync(@"{
182182
Assert.Equal("He Wrd!", await Page.EvaluateExpressionAsync<string>("textarea.value"));
183183
}
184184

185-
[Fact]
186-
public async Task KeyboardModifiers()
187-
{
188-
var keyboard = Page.Keyboard;
189-
Assert.Equal(0, keyboard.Modifiers);
190-
await keyboard.DownAsync(Key.Shift);
191-
Assert.Equal(8, keyboard.Modifiers);
192-
await keyboard.DownAsync(Key.Alt);
193-
Assert.Equal(9, keyboard.Modifiers);
194-
await keyboard.UpAsync(Key.Shift);
195-
await keyboard.UpAsync(Key.Alt);
196-
Assert.Equal(0, keyboard.Modifiers);
197-
}
198-
199185
[Fact]
200186
public async Task ShouldSpecifyRepeatProperty()
201187
{

lib/PuppeteerSharp.Tests/TargetTests/CreateCDPSessionTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,19 @@ public async Task ShouldBeAbleToDetachSession()
8787
}));
8888
Assert.Contains("Session closed.", exception.Message);
8989
}
90+
91+
[Fact]
92+
public async Task ShouldThrowNiceErrors()
93+
{
94+
var client = await Page.Target.CreateCDPSessionAsync();
95+
async Task TheSourceOfTheProblems() => await client.SendAsync("ThisCommand.DoesNotExist");
96+
97+
var exception = await Assert.ThrowsAsync<MessageException>(async () =>
98+
{
99+
await TheSourceOfTheProblems();
100+
});
101+
Assert.Contains("TheSourceOfTheProblems", exception.StackTrace);
102+
Assert.Contains("ThisCommand.DoesNotExist", exception.Message);
103+
}
90104
}
91105
}

0 commit comments

Comments
 (0)