Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amaitland committed Jul 13, 2024
1 parent 019aa1d commit 32cca1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PuppeteerSharp.Dom.Tests/ElementHandleTests/ClickTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task ShouldThrowForDetachedNodes()
var button = await Page.QuerySelectorAsync<HtmlButtonElement>("button");
await button.RemoveAsync();
var exception = await Assert.ThrowsAsync<PuppeteerException>(async () => await button.ClickAsync());
Assert.Equal("Node is either not visible or not an HTMLElement", exception.Message);
Assert.Equal("Node is detached from document", exception.Message);
}

[PuppeteerDomFact]
Expand All @@ -49,7 +49,7 @@ await button.GetStyleAsync()
.AndThen(x => x.SetPropertyAsync("display", "none"));
//await Page.EvaluateFunctionAsync("button => button.style.display = 'none'", (JSHandle)button);
var exception = await Assert.ThrowsAsync<PuppeteerException>(async () => await button.ClickAsync());
Assert.Equal("Node is either not visible or not an HTMLElement", exception.Message);
Assert.Equal("Node is either not clickable or not an Element", exception.Message);
}

[PuppeteerDomFact]
Expand All @@ -61,7 +61,7 @@ await button.GetParentElementAsync<HtmlElement>()
.AndThen(x => x.GetStyleAsync())
.AndThen(x => x.SetPropertyAsync("display", "none"));
var exception = await Assert.ThrowsAsync<PuppeteerException>(async () => await button.ClickAsync());
Assert.Equal("Node is either not visible or not an HTMLElement", exception.Message);
Assert.Equal("Node is either not clickable or not an Element", exception.Message);
}

[PuppeteerDomFact]
Expand All @@ -70,7 +70,7 @@ public async Task ShouldThrowForBrElements()
await Page.SetContentAsync("hello<br>goodbye");
var br = await Page.QuerySelectorAsync<HtmlElement>("br");
var exception = await Assert.ThrowsAsync<PuppeteerException>(async () => await br.ClickAsync());
Assert.Equal("Node is either not visible or not an HTMLElement", exception.Message);
Assert.Equal("Node is either not clickable or not an Element", exception.Message);
}
}
}

0 comments on commit 32cca1b

Please sign in to comment.