diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3c512398f..312181cd6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -99,7 +99,8 @@ jobs: Xvfb :1 -screen 5 1024x768x8 & export DISPLAY=:1.5 cd lib/PuppeteerSharp.Tests - dotnet test -s test.runsettings -c Debug --logger "trx;LogFileName=TestResults.xml" --blame-hang-timeout 300000 + dotnet tool update -g dotnet-retest + dotnet retest --verbosity normal -- -s test.runsettings -c Debug --logger "trx;LogFileName=TestResults.xml" --blame-hang-timeout 300000 - name: Test (Windows) if: matrix.os == 'windows-latest' env: @@ -107,5 +108,6 @@ jobs: HEADLESS_MODE: ${{ matrix.mode }} run: | cd .\lib\PuppeteerSharp.Tests - dotnet test -s test.runsettings --blame-hang-timeout 300000 + dotnet tool update -g dotnet-retest + dotnet retest --verbosity normal -- -s test.runsettings --blame-hang-timeout 300000 diff --git a/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.upstream.json b/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.upstream.json index f3898292e..491b5d135 100644 --- a/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.upstream.json +++ b/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.upstream.json @@ -930,7 +930,7 @@ "comment": "Querying by a11y attributes is not standard behavior" }, { - "testIdPattern": "[bfcache.spec] BFCache can navigate to a BFCached page containing an OOPIF and a worker", + "testIdPattern": "[bfcache.spec] *", "platforms": ["darwin", "linux", "win32"], "parameters": ["cdp", "firefox"], "expectations": ["SKIP"], @@ -1622,32 +1622,18 @@ "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" }, { - "testIdPattern": "[extensions.spec] extensions background_page target type should be available", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["cdp", "firefox"], - "expectations": ["SKIP"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" - }, - { - "testIdPattern": "[extensions.spec] extensions service_worker target type should be available", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["cdp", "firefox"], - "expectations": ["SKIP"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" - }, - { - "testIdPattern": "[extensions.spec] extensions target.page() should return a background_page", + "testIdPattern": "[extensions.spec] extensions *", "platforms": ["darwin", "linux", "win32"], "parameters": ["cdp", "firefox"], "expectations": ["SKIP"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" + "comment": "Chrome-specific test" }, { - "testIdPattern": "[extensions.spec] extensions target.page() should return a background_page", - "platforms": ["darwin", "linux", "win32"], + "testIdPattern": "[extensions.spec] extensions can evaluate in the service worker", + "platforms": ["win32"], "parameters": ["cdp", "chrome"], - "expectations": ["FAIL", "PASS"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" + "expectations": ["SKIP"], + "comment": "Flaky or failing on Windows. See https://github.com/puppeteer/puppeteer/issues/13417" }, { "testIdPattern": "[fixtures.spec] Fixtures should close the browser when the node process closes", @@ -3732,25 +3718,18 @@ "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" }, { - "testIdPattern": "[extensions.spec] extensions background_page target type should be available", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["cdp", "chrome", "chrome-headless-shell"], - "expectations": ["SKIP"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" - }, - { - "testIdPattern": "[extensions.spec] extensions service_worker target type should be available", - "platforms": ["darwin", "linux", "win32"], + "testIdPattern": "[mouse.spec] Mouse should select the text with mouse", + "platforms": ["win32"], "parameters": ["cdp", "chrome", "chrome-headless-shell"], - "expectations": ["SKIP"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" + "expectations": ["FAIL"], + "comment": "TODO: started to fail with Chrome headless shell 135 on Windows" }, { - "testIdPattern": "[extensions.spec] extensions target.page() should return a background_page", + "testIdPattern": "[extensions.spec] extensions *", "platforms": ["darwin", "linux", "win32"], "parameters": ["cdp", "chrome", "chrome-headless-shell"], "expectations": ["SKIP"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" + "comment": "No extensions in chrome-headless-shell" }, { "testIdPattern": "[network.spec] network Network Events Page.Events.Request", diff --git a/lib/PuppeteerSharp.TestServer/wwwroot/jscoverage/ranges.html b/lib/PuppeteerSharp.TestServer/wwwroot/jscoverage/ranges.html index a537a7da6..3d02670ae 100644 --- a/lib/PuppeteerSharp.TestServer/wwwroot/jscoverage/ranges.html +++ b/lib/PuppeteerSharp.TestServer/wwwroot/jscoverage/ranges.html @@ -1,2 +1,2 @@ +function unused(){}console.log('used!');if(true===false)console.log('unused!'); diff --git a/lib/PuppeteerSharp.Tests/AccessibilityTests/AccessibilityTests.cs b/lib/PuppeteerSharp.Tests/AccessibilityTests/AccessibilityTests.cs index 4754f061f..37780d481 100644 --- a/lib/PuppeteerSharp.Tests/AccessibilityTests/AccessibilityTests.cs +++ b/lib/PuppeteerSharp.Tests/AccessibilityTests/AccessibilityTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.AccessibilityTests { public class AccessibilityTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "should work")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "should work")] public async Task ShouldWork() { await Page.SetContentAsync(@" @@ -107,7 +107,7 @@ await Page.SetContentAsync(@" Assert.That(snapshot, Is.EqualTo(nodeToCheck)); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "should report uninteresting nodes")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "should report uninteresting nodes")] public async Task ShouldReportUninterestingNodes() { await Page.SetContentAsync(""); @@ -151,7 +151,7 @@ public async Task ShouldReportUninterestingNodes() })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "get snapshots while the tree is re-calculated")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "get snapshots while the tree is re-calculated")] public async Task GetSnapshotsWhileTheTreeIsReCalculated() { await Page.SetContentAsync(@" @@ -201,7 +201,7 @@ private async Task GetAccessibleNameAsync(IPage page, IElementHandle ele })).Name; } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "roledescription")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "roledescription")] public async Task RoleDescription() { await Page.SetContentAsync("
Hi
"); @@ -210,7 +210,7 @@ public async Task RoleDescription() Assert.That(snapshot.Children[0].RoleDescription, Is.Null); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "orientation")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "orientation")] public async Task Orientation() { await Page.SetContentAsync("11"); @@ -218,7 +218,7 @@ public async Task Orientation() Assert.That(snapshot.Children[0].Orientation, Is.EqualTo("vertical")); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "autocomplete")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "autocomplete")] public async Task AutoComplete() { await Page.SetContentAsync(""); @@ -226,7 +226,7 @@ public async Task AutoComplete() Assert.That(snapshot.Children[0].AutoComplete, Is.EqualTo("list")); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "multiselectable")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "multiselectable")] public async Task MultiSelectable() { await Page.SetContentAsync("
hey
"); @@ -234,7 +234,7 @@ public async Task MultiSelectable() Assert.That(snapshot.Children[0].Multiselectable, Is.True); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "Accessibility", "keyshortcuts")] + [Test, PuppeteerTest("accessibility.spec", "Accessibility", "keyshortcuts")] public async Task KeyShortcuts() { await Page.SetContentAsync("
hey
"); @@ -242,7 +242,7 @@ public async Task KeyShortcuts() Assert.That(snapshot.Children[0].KeyShortcuts, Is.EqualTo("foo")); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "should not report text nodes inside controls")] + [Test, PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "should not report text nodes inside controls")] public async Task ShouldNotReportTextNodesInsideControls() { await Page.SetContentAsync(@" @@ -271,7 +271,7 @@ await Page.Accessibility.SnapshotAsync(), })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "rich text editable fields should have children")] + [Test, PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "rich text editable fields should have children")] public async Task RichTextEditableFieldsShouldHaveChildren() { await Page.SetContentAsync(@" @@ -299,7 +299,7 @@ await Page.SetContentAsync(@" })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "rich text editable fields with role should have children")] + [Test, PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "rich text editable fields with role should have children")] public async Task RichTextEditableFieldsWithRoleShouldHaveChildren() { await Page.SetContentAsync(@" @@ -324,7 +324,7 @@ await Page.SetContentAsync(@" })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "plaintext contenteditable", "plain text field with role should not have children")] + [Test, PuppeteerTest("accessibility.spec", "plaintext contenteditable", "plain text field with role should not have children")] public async Task PlainTextFieldWithRoleShouldNotHaveChildren() { await Page.SetContentAsync("
Edit this image:my fake image
"); @@ -339,7 +339,7 @@ public async Task PlainTextFieldWithRoleShouldNotHaveChildren() })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "plaintext contenteditable", "plain text field with tabindex and without role should not have content")] + [Test, PuppeteerTest("accessibility.spec", "plaintext contenteditable", "plain text field with tabindex and without role should not have content")] public async Task PlainTextFieldWithoutRoleShouldNotHaveContent() { await Page.SetContentAsync( @@ -349,7 +349,7 @@ await Page.SetContentAsync( Assert.That(snapshot.Children[0].Name, Is.EqualTo(string.Empty)); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "non editable textbox with role and tabIndex and label should not have children")] + [Test, PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "non editable textbox with role and tabIndex and label should not have children")] public async Task NonEditableTextboxWithRoleAndTabIndexAndLabelShouldNotHaveChildren() { await Page.SetContentAsync(@" @@ -367,7 +367,7 @@ this is the inner content })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "checkbox with and tabIndex and label should not have children")] + [Test, PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "checkbox with and tabIndex and label should not have children")] public async Task CheckboxWithAndTabIndexAndLabelShouldNotHaveChildren() { await Page.SetContentAsync(@" @@ -385,7 +385,7 @@ this is the inner content })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "checkbox without label should not have children")] + [Test, PuppeteerTest("accessibility.spec", "filtering children of leaf nodes", "checkbox without label should not have children")] public async Task CheckboxWithoutLabelShouldNotHaveChildren() { await Page.SetContentAsync(@" diff --git a/lib/PuppeteerSharp.Tests/AccessibilityTests/RootOptionTests.cs b/lib/PuppeteerSharp.Tests/AccessibilityTests/RootOptionTests.cs index c1776988f..848bb6df9 100644 --- a/lib/PuppeteerSharp.Tests/AccessibilityTests/RootOptionTests.cs +++ b/lib/PuppeteerSharp.Tests/AccessibilityTests/RootOptionTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.AccessibilityTests { public class RootOptionTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("accessibility.spec", "root option", "should work a button")] + [Test, PuppeteerTest("accessibility.spec", "root option", "should work a button")] public async Task ShouldWorkAButton() { await Page.SetContentAsync(""); @@ -22,7 +22,7 @@ await Page.Accessibility.SnapshotAsync(new AccessibilitySnapshotOptions { Root = })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "root option", "should work an input")] + [Test, PuppeteerTest("accessibility.spec", "root option", "should work an input")] public async Task ShouldWorkAnInput() { await Page.SetContentAsync(""); @@ -38,7 +38,7 @@ await Page.Accessibility.SnapshotAsync(new AccessibilitySnapshotOptions { Root = })); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "root option", "should work a menu")] + [Test, PuppeteerTest("accessibility.spec", "root option", "should work a menu")] public async Task ShouldWorkAMenu() { await Page.SetContentAsync(@" @@ -79,7 +79,7 @@ await Page.SetContentAsync(@" Assert.That(snapshot, Is.EqualTo(nodeToCheck)); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "root option", "should return null when the element is no longer in DOM")] + [Test, PuppeteerTest("accessibility.spec", "root option", "should return null when the element is no longer in DOM")] public async Task ShouldReturnNullWhenTheElementIsNoLongerInDOM() { await Page.SetContentAsync(""); @@ -88,7 +88,7 @@ public async Task ShouldReturnNullWhenTheElementIsNoLongerInDOM() Assert.That(await Page.Accessibility.SnapshotAsync(new AccessibilitySnapshotOptions { Root = button }), Is.Null); } - [Test, Retry(2), PuppeteerTest("accessibility.spec", "root option", "should support the interestingOnly option")] + [Test, PuppeteerTest("accessibility.spec", "root option", "should support the interestingOnly option")] public async Task ShouldSupportTheInterestingOnlyOption() { await Page.SetContentAsync("
"); diff --git a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/ParseAriaSelectorTests.cs b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/ParseAriaSelectorTests.cs index 577e3c58f..75796d2ee 100644 --- a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/ParseAriaSelectorTests.cs +++ b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/ParseAriaSelectorTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.AriaQueryHandlerTests { public class ParseAriaSelectorTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should handle non-breaking spaces")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should handle non-breaking spaces")] public async Task ShouldHandleNonBreakingSpaces() { await Page.SetContentAsync( @@ -19,7 +19,7 @@ await Page.SetContentAsync( Assert.That(button, Is.Null); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should handle non-breaking spaces")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should handle non-breaking spaces")] public async Task ShouldHandleNonBreakingSpaces2() { await Page.SetContentAsync( @@ -32,7 +32,7 @@ await Page.SetContentAsync( await ExpectFound(button); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should handle zero width spaces")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should handle zero width spaces")] public async Task ShouldHandleZeroWidthSpaces() { await Page.SetContentAsync( @@ -45,7 +45,7 @@ await Page.SetContentAsync( Assert.That(button, Is.Null); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should find button")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "parseAriaSelector", "should find button")] public async Task ShouldFindButton() { await Page.SetContentAsync(@" diff --git a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllArrayTests.cs b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllArrayTests.cs index 3f0339d3f..05c835d00 100644 --- a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllArrayTests.cs +++ b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllArrayTests.cs @@ -10,7 +10,7 @@ public QueryAllArrayTests() : base() { } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "queryAllArray", "$$eval should handle many elements")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "queryAllArray", "$$eval should handle many elements")] public async Task EvalShouldHandleManyElements() { await Page.SetContentAsync(""); diff --git a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllTests.cs b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllTests.cs index 94299bc03..ebaf31edd 100644 --- a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllTests.cs +++ b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryAllTests.cs @@ -8,7 +8,7 @@ namespace PuppeteerSharp.Tests.AriaQueryHandlerTests { public class QueryAllTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "queryAll", "should find menu by name")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "queryAll", "should find menu by name")] public async Task ShouldFindMenuByName() { await Page.SetContentAsync(@" diff --git a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryOneTests.cs b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryOneTests.cs index 7361cb933..34e162aca 100644 --- a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryOneTests.cs +++ b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/QueryOneTests.cs @@ -10,7 +10,7 @@ public QueryOneTests() : base() { } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find button by role")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find button by role")] public async Task ShouldFindButtonByRole() { await Page.SetContentAsync("
"); @@ -19,7 +19,7 @@ public async Task ShouldFindButtonByRole() Assert.That(id, Is.EqualTo("btn")); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find button by name and role")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find button by name and role")] public async Task ShouldFindButtonNameAndByRole() { await Page.SetContentAsync("
"); @@ -28,7 +28,7 @@ public async Task ShouldFindButtonNameAndByRole() Assert.That(id, Is.EqualTo("btn")); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find first matching element")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find first matching element")] public async Task ShouldFindFirstMatchingElement() { await Page.SetContentAsync(@" @@ -40,7 +40,7 @@ await Page.SetContentAsync(@" Assert.That(id, Is.EqualTo("mnu1")); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find by name")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find by name")] public async Task ShouldFindByName() { await Page.SetContentAsync(@" @@ -52,7 +52,7 @@ await Page.SetContentAsync(@" Assert.That(id, Is.EqualTo("mnu1")); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find by name")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "queryOne", "should find by name")] public async Task ShouldFindByName2() { await Page.SetContentAsync(@" diff --git a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/WaitForSelectorAriaTests.cs b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/WaitForSelectorAriaTests.cs index 8d88d971c..01d26d86a 100644 --- a/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/WaitForSelectorAriaTests.cs +++ b/lib/PuppeteerSharp.Tests/AriaQueryHandlerTests/WaitForSelectorAriaTests.cs @@ -10,7 +10,7 @@ public class WaitForSelectorAriaTests : PuppeteerPageBaseTest { private const string AddElement = @"(tag) => document.body.appendChild(document.createElement(tag))"; - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should immediately resolve promise if node exists")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should immediately resolve promise if node exists")] public async Task ShouldImmediatelyResolvePromiseIfNodeExists() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -18,7 +18,7 @@ public async Task ShouldImmediatelyResolvePromiseIfNodeExists() await Page.WaitForSelectorAsync("aria/[role=\"button\"]"); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work for ElementHandle.waitForSelector")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work for ElementHandle.waitForSelector")] public async Task ShouldWorkForElementHandleWaitForSelector() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -30,7 +30,7 @@ await Page.EvaluateFunctionAsync( await element.WaitForSelectorAsync("aria/test"); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should persist query handler bindings across reloads")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should persist query handler bindings across reloads")] public async Task ShouldPersistQueryHandlerBindingsAcrossReloads() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -41,7 +41,7 @@ public async Task ShouldPersistQueryHandlerBindingsAcrossReloads() await Page.WaitForSelectorAsync("aria/[role=\"button\"]"); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should persist query handler bindings across navigations")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should persist query handler bindings across navigations")] public async Task ShouldPersistQueryHandlerBindingsAcrossNavigations() { await Page.GoToAsync("data:text/html,"); @@ -52,7 +52,7 @@ public async Task ShouldPersistQueryHandlerBindingsAcrossNavigations() await Page.WaitForSelectorAsync("aria/[role=\"button\"]"); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work independently of `exposeFunction")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work independently of `exposeFunction")] public async Task ShouldWorkIndependentlyOfExposeFunction() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -63,7 +63,7 @@ public async Task ShouldWorkIndependentlyOfExposeFunction() Assert.That(result, Is.EqualTo(10)); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work with removed MutationObserver")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work with removed MutationObserver")] public async Task ShouldWorkWithRemovedMutationObserver() { await Page.EvaluateFunctionAsync(@"() => delete window.MutationObserver"); @@ -75,7 +75,7 @@ await Task.WhenAll( Assert.That(await Page.EvaluateFunctionAsync("x => x.textContent", handleTask.Result), Is.EqualTo("anything")); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should resolve promise when node is added")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should resolve promise when node is added")] public async Task ShouldResolvePromiseWhenNodeIsAdded() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -90,7 +90,7 @@ await elementHandle.GetPropertyAsync("tagName") Assert.That(tagName, Is.EqualTo("H1")); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work when node is added through innerHTML")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should work when node is added through innerHTML")] public async Task ShouldWorkWhenNodeIsAddedThroughInnerHtml() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -103,7 +103,7 @@ await Page.EvaluateFunctionAsync(@"() => { await watchdog; } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "Page.waitForSelector is shortcut for main frame")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "Page.waitForSelector is shortcut for main frame")] public async Task PageWaitForSelectorIsShortcutForMainFrame() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -116,7 +116,7 @@ public async Task PageWaitForSelectorIsShortcutForMainFrame() Assert.That(Page.MainFrame, Is.SameAs(elementHandle.Frame)); } - [Test, Retry(2), PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should run in specified frame")] + [Test, PuppeteerTest("ariaqueryhandler.spec", "waitForSelector (aria)", "should run in specified frame")] public async Task ShouldRunInSpecifiedFrame() { await FrameUtils.AttachFrameAsync(Page, "frame1", TestConstants.EmptyPage); diff --git a/lib/PuppeteerSharp.Tests/Assets/service-worker-extension/background.js b/lib/PuppeteerSharp.Tests/Assets/service-worker-extension/background.js deleted file mode 100644 index 8b1a39374..000000000 --- a/lib/PuppeteerSharp.Tests/Assets/service-worker-extension/background.js +++ /dev/null @@ -1 +0,0 @@ -// empty diff --git a/lib/PuppeteerSharp.Tests/Assets/service-worker-extension/manifest.json b/lib/PuppeteerSharp.Tests/Assets/service-worker-extension/manifest.json deleted file mode 100644 index 25828b6d2..000000000 --- a/lib/PuppeteerSharp.Tests/Assets/service-worker-extension/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Simple extension", - "version": "0.1", - "background": { - "service_worker": "background.js" - }, - "permissions": ["background", "activeTab"], - "manifest_version": 3 -} diff --git a/lib/PuppeteerSharp.Tests/Assets/simple-extension/index.js b/lib/PuppeteerSharp.Tests/Assets/simple-extension/index.js index a0bb3f4ea..c31bbebf3 100644 --- a/lib/PuppeteerSharp.Tests/Assets/simple-extension/index.js +++ b/lib/PuppeteerSharp.Tests/Assets/simple-extension/index.js @@ -1,2 +1,2 @@ -// Mock script for background extension -window.MAGIC = 42; +// Mock script for service worker extension +globalThis.MAGIC = 42; diff --git a/lib/PuppeteerSharp.Tests/Assets/simple-extension/manifest.json b/lib/PuppeteerSharp.Tests/Assets/simple-extension/manifest.json index da2cd082e..39b77fc21 100644 --- a/lib/PuppeteerSharp.Tests/Assets/simple-extension/manifest.json +++ b/lib/PuppeteerSharp.Tests/Assets/simple-extension/manifest.json @@ -2,7 +2,7 @@ "name": "Simple extension", "version": "0.1", "background": { - "scripts": ["index.js"] + "service_worker": "index.js" }, "content_scripts": [{ "matches": [""], @@ -10,5 +10,5 @@ "js": ["content-script.js"] }], "permissions": ["background", "activeTab"], - "manifest_version": 2 + "manifest_version": 3 } diff --git a/lib/PuppeteerSharp.Tests/BFCacheTests/BFCacheTests.cs b/lib/PuppeteerSharp.Tests/BFCacheTests/BFCacheTests.cs index 5a671bab0..7f7104ea9 100644 --- a/lib/PuppeteerSharp.Tests/BFCacheTests/BFCacheTests.cs +++ b/lib/PuppeteerSharp.Tests/BFCacheTests/BFCacheTests.cs @@ -13,7 +13,7 @@ public BFCacheTests() DefaultOptions.AcceptInsecureCerts = true; } - [Test, Retry(2), PuppeteerTest("bfcache.spec", "BFCache", "can navigate to a BFCached page")] + [Test, PuppeteerTest("bfcache.spec", "BFCache", "can navigate to a BFCached page")] public async Task CanNavigateToABFCachedPage() { Page.DefaultTimeout = 30_000; @@ -25,7 +25,7 @@ public async Task CanNavigateToABFCachedPage() Assert.That(await Page.EvaluateExpressionAsync("document.body.innerText"), Is.EqualTo("BFCachednext")); } - [Test, Retry(2), PuppeteerTest("bfcache.spec", "BFCache", "can navigate to a BFCached page containing an OOPIF and a worker")] + [Test, PuppeteerTest("bfcache.spec", "BFCache", "can navigate to a BFCached page containing an OOPIF and a worker")] public async Task CanNavigateToABFCachedPageContainingAnOOPIFAndAWorker() { Page.DefaultTimeout = 30_000; diff --git a/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextOverridePermissionsTests.cs b/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextOverridePermissionsTests.cs index 900772630..e76ddee87 100644 --- a/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextOverridePermissionsTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextOverridePermissionsTests.cs @@ -17,14 +17,14 @@ private Task GetPermissionAsync(IPage page, string name) "name => navigator.permissions.query({ name }).then(result => result.state)", name); - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should be prompt by default")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should be prompt by default")] public async Task ShouldBePromptByDefault() { await Page.GoToAsync(TestConstants.EmptyPage); Assert.That(await GetPermissionAsync(Page, "geolocation"), Is.EqualTo("prompt")); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should deny permission when not listed")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should deny permission when not listed")] public async Task ShouldDenyPermissionWhenNotListed() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -32,7 +32,7 @@ public async Task ShouldDenyPermissionWhenNotListed() Assert.That(await GetPermissionAsync(Page, "geolocation"), Is.EqualTo("denied")); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should grant permission when listed")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should grant permission when listed")] public async Task ShouldGrantPermissionWhenListed() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -43,7 +43,7 @@ public async Task ShouldGrantPermissionWhenListed() Assert.That(await GetPermissionAsync(Page, "geolocation"), Is.EqualTo("granted")); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should reset permissions")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should reset permissions")] public async Task ShouldResetPermissions() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -56,7 +56,7 @@ public async Task ShouldResetPermissions() Assert.That(await GetPermissionAsync(Page, "geolocation"), Is.EqualTo("prompt")); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should trigger permission onchange")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should trigger permission onchange")] public async Task ShouldTriggerPermissionOnchange() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -83,7 +83,7 @@ await Page.EvaluateFunctionAsync(@"() => { await Page.EvaluateExpressionAsync("window.events"), Is.EqualTo(new string[] { "prompt", "denied", "granted", "prompt" })); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should isolate permissions between browser contexts")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext BrowserContext.overridePermissions", "should isolate permissions between browser contexts")] public async Task ShouldIsolatePermissionsBetweenBrowserContexts() { await Page.GoToAsync(TestConstants.EmptyPage); diff --git a/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextTests.cs b/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextTests.cs index e4f615176..603692dd0 100644 --- a/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextTests.cs @@ -8,7 +8,7 @@ namespace PuppeteerSharp.Tests.BrowserContextTests { public class BrowserContextTests : PuppeteerBrowserBaseTest { - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should have default context")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should have default context")] public void ShouldHaveDefaultContext() { Assert.That(Browser.BrowserContexts(), Has.Exactly(1).Items); @@ -18,7 +18,7 @@ public void ShouldHaveDefaultContext() Assert.That(exception!.Message, Does.Contain("cannot be closed")); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should create new incognito context")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should create new incognito context")] public async Task ShouldCreateNewIncognitoContext() { Assert.That(Browser.BrowserContexts(), Has.Exactly(1).Items); @@ -30,7 +30,7 @@ public async Task ShouldCreateNewIncognitoContext() Assert.That(Browser.BrowserContexts(), Has.Exactly(1).Items); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should close all belonging targets once closing context")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should close all belonging targets once closing context")] public async Task ShouldCloseAllBelongingTargetsOnceClosingContext() { Assert.That((await Browser.PagesAsync()), Has.Exactly(1).Items); @@ -44,7 +44,7 @@ public async Task ShouldCloseAllBelongingTargetsOnceClosingContext() Assert.That((await Browser.PagesAsync()), Has.Exactly(1).Items); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "window.open should use parent tab context")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "window.open should use parent tab context")] public async Task WindowOpenShouldUseParentTabContext() { var context = await Browser.CreateBrowserContextAsync(); @@ -63,7 +63,7 @@ await Task.WhenAll( await context.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should fire target events")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should fire target events")] public async Task ShouldFireTargetEvents() { var context = await Browser.CreateBrowserContextAsync(); @@ -85,7 +85,7 @@ public async Task ShouldFireTargetEvents() await context.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should isolate localStorage and cookies")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should isolate localStorage and cookies")] public async Task ShouldIsolateLocalStorageAndCookies() { // Create two incognito contexts. @@ -131,7 +131,7 @@ await page2.EvaluateExpressionAsync(@"{ Assert.That(Browser.BrowserContexts(), Has.Exactly(1).Items); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should work across sessions")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should work across sessions")] public async Task ShouldWorkAcrossSessions() { Assert.That(Browser.BrowserContexts(), Has.Exactly(1).Items); @@ -148,7 +148,7 @@ public async Task ShouldWorkAcrossSessions() await context.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should provide a context id")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should provide a context id")] public async Task ShouldProvideAContextId() { Assert.That(Browser.BrowserContexts(), Has.Exactly(1).Items); @@ -160,7 +160,7 @@ public async Task ShouldProvideAContextId() await context.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should wait for a target")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should wait for a target")] public async Task ShouldWaitForTarget() { var context = await Browser.CreateBrowserContextAsync(); @@ -173,7 +173,7 @@ public async Task ShouldWaitForTarget() await context.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("browsercontext.spec", "BrowserContext", "should timeout waiting for a non-existent target")] + [Test, PuppeteerTest("browsercontext.spec", "BrowserContext", "should timeout waiting for a non-existent target")] public async Task ShouldTimeoutWaitingForNonExistentTarget() { var context = await Browser.CreateBrowserContextAsync(); diff --git a/lib/PuppeteerSharp.Tests/BrowserContextTests/DefaultBrowserContextTests.cs b/lib/PuppeteerSharp.Tests/BrowserContextTests/DefaultBrowserContextTests.cs index 3f3d3d6d2..37893ad5d 100644 --- a/lib/PuppeteerSharp.Tests/BrowserContextTests/DefaultBrowserContextTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserContextTests/DefaultBrowserContextTests.cs @@ -18,7 +18,7 @@ public async Task CreateNewPageAsync() Page = await Context.NewPageAsync(); } - [Test, Retry(2), PuppeteerTest("defaultbrowsercontext.spec", "DefaultBrowserContext", "page.cookies() should work")] + [Test, PuppeteerTest("defaultbrowsercontext.spec", "DefaultBrowserContext", "page.cookies() should work")] public async Task PageGetCookiesAsyncShouldWork() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -36,7 +36,7 @@ public async Task PageGetCookiesAsyncShouldWork() Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("defaultbrowsercontext.spec", "DefaultBrowserContext", "page.setCookie() should work")] + [Test, PuppeteerTest("defaultbrowsercontext.spec", "DefaultBrowserContext", "page.setCookie() should work")] public async Task PageSetCookiesAsyncShouldWork() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -59,7 +59,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("defaultbrowsercontext.spec", "DefaultBrowserContext", "page.deleteCookie() should work")] + [Test, PuppeteerTest("defaultbrowsercontext.spec", "DefaultBrowserContext", "page.deleteCookie() should work")] public async Task PageDeleteCookieAsyncShouldWork() { await Page.GoToAsync(TestConstants.EmptyPage); diff --git a/lib/PuppeteerSharp.Tests/BrowserTests/BrowserVersionTests.cs b/lib/PuppeteerSharp.Tests/BrowserTests/BrowserVersionTests.cs index 44c8f9fc6..e142f39e1 100644 --- a/lib/PuppeteerSharp.Tests/BrowserTests/BrowserVersionTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserTests/BrowserVersionTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.BrowserTests { public class BrowserVersionTests : PuppeteerBrowserBaseTest { - [Test, Retry(2), PuppeteerTest("browser.spec", "Browser.version", "should return version")] + [Test, PuppeteerTest("browser.spec", "Browser.version", "should return version")] public async Task ShouldReturnVersion() { var version = await Browser.GetVersionAsync(); diff --git a/lib/PuppeteerSharp.Tests/BrowserTests/IsConnectedTests.cs b/lib/PuppeteerSharp.Tests/BrowserTests/IsConnectedTests.cs index 6aa9c73af..d214c06e3 100644 --- a/lib/PuppeteerSharp.Tests/BrowserTests/IsConnectedTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserTests/IsConnectedTests.cs @@ -10,7 +10,7 @@ public IsConnectedTests() : base() { } - [Test, Retry(2), PuppeteerTest("browser.spec", "Browser.isConnected", "should set the browser connected state")] + [Test, PuppeteerTest("browser.spec", "Browser.isConnected", "should set the browser connected state")] public async Task ShouldSetTheBrowserConnectedState() { var newBrowser = await Puppeteer.ConnectAsync(new ConnectOptions diff --git a/lib/PuppeteerSharp.Tests/BrowserTests/ProcessTests.cs b/lib/PuppeteerSharp.Tests/BrowserTests/ProcessTests.cs index 16c16d7ad..9635873d3 100644 --- a/lib/PuppeteerSharp.Tests/BrowserTests/ProcessTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserTests/ProcessTests.cs @@ -8,14 +8,14 @@ public class ProcessTests : PuppeteerBrowserBaseTest { public ProcessTests() : base() { } - [Test, Retry(2), PuppeteerTest("browser.spec", "Browser.process", "should return child_process instance")] + [Test, PuppeteerTest("browser.spec", "Browser.process", "should return child_process instance")] public void ShouldReturnProcessInstance() { var process = Browser.Process; Assert.That(process.Id, Is.GreaterThan(0)); } - [Test, Retry(2), PuppeteerTest("browser.spec", "Browser.process", "should not return child_process for remote browser")] + [Test, PuppeteerTest("browser.spec", "Browser.process", "should not return child_process for remote browser")] public async Task ShouldNotReturnChildProcessForRemoteBrowser() { var browserWSEndpoint = Browser.WebSocketEndpoint; diff --git a/lib/PuppeteerSharp.Tests/BrowserTests/TargetTests.cs b/lib/PuppeteerSharp.Tests/BrowserTests/TargetTests.cs index 3f5fbfcc5..96dbe4e6f 100644 --- a/lib/PuppeteerSharp.Tests/BrowserTests/TargetTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserTests/TargetTests.cs @@ -9,7 +9,7 @@ public TargetTests() : base() { } - [Test, Retry(2), PuppeteerTest("browser.spec", "Browser.target", "should return browser target")] + [Test, PuppeteerTest("browser.spec", "Browser.target", "should return browser target")] public void ShouldReturnBrowserTarget() => Assert.That(Browser.Target.Type, Is.EqualTo(TargetType.Browser)); } diff --git a/lib/PuppeteerSharp.Tests/BrowserTests/UserAgentTests.cs b/lib/PuppeteerSharp.Tests/BrowserTests/UserAgentTests.cs index f972001a8..54dc13dfd 100644 --- a/lib/PuppeteerSharp.Tests/BrowserTests/UserAgentTests.cs +++ b/lib/PuppeteerSharp.Tests/BrowserTests/UserAgentTests.cs @@ -10,7 +10,7 @@ public UserAgentTests() : base() { } - [Test, Retry(2), PuppeteerTest("browser.spec", "Browser.userAgent", "should include WebKit")] + [Test, PuppeteerTest("browser.spec", "Browser.userAgent", "should include WebKit")] public async Task ShouldIncludeWebKit() { var userAgent = await Browser.GetUserAgentAsync(); diff --git a/lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs b/lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs index cc2c61076..e7a70f95c 100644 --- a/lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs +++ b/lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs @@ -59,7 +59,7 @@ public async Task Usage() #endregion } - [Test, Retry(2), PuppeteerTest("chrome-data.spec", "Chrome", "should resolve download URLs")] + [Test, PuppeteerTest("chrome-data.spec", "Chrome", "should resolve download URLs")] public void ShouldResolveDownloadUrls() { Assert.That( @@ -79,7 +79,7 @@ public void ShouldResolveDownloadUrls() Is.EqualTo("https://storage.googleapis.com/chrome-for-testing-public/113.0.5672.0/win64/chrome-win64.zip")); } - [Test, Retry(2), PuppeteerTest("chrome-data.spec", "Chrome", "should resolve executable paths")] + [Test, PuppeteerTest("chrome-data.spec", "Chrome", "should resolve executable paths")] public void ShouldResolveExecutablePath() { Assert.That( @@ -116,7 +116,7 @@ public void ShouldResolveExecutablePath() } // This has a custom name - [Test, Retry(2), PuppeteerTest("chrome-data.spec", "Chrome", "should resolve system executable path (windows)")] + [Test, PuppeteerTest("chrome-data.spec", "Chrome", "should resolve system executable path (windows)")] public void ShouldResolveSystemExecutablePathWindows() { Assert.That( @@ -124,7 +124,7 @@ public void ShouldResolveSystemExecutablePathWindows() Is.EqualTo("C:\\Program Files\\Google\\Chrome Dev\\Application\\chrome.exe")); } - [Test, Retry(2), PuppeteerTest("chrome-data.spec", "Chrome", "should resolve system executable path")] + [Test, PuppeteerTest("chrome-data.spec", "Chrome", "should resolve system executable path")] public void ShouldResolveSystemExecutablePath() { Assert.That( diff --git a/lib/PuppeteerSharp.Tests/Browsers/Chrome/CliTests.cs b/lib/PuppeteerSharp.Tests/Browsers/Chrome/CliTests.cs index 8728d4912..78387b661 100644 --- a/lib/PuppeteerSharp.Tests/Browsers/Chrome/CliTests.cs +++ b/lib/PuppeteerSharp.Tests/Browsers/Chrome/CliTests.cs @@ -21,7 +21,7 @@ public void CreateDir() public void DeleteDir() => new Cache(_cacheDir).Clear(); - [Test, Retry(2), PuppeteerTest("CLI.spec", "Chrome CLI", "should download Chrome binaries")] + [Test, PuppeteerTest("CLI.spec", "Chrome CLI", "should download Chrome binaries")] public async Task ShouldDownloadChromeBinaries() { var fetcher = new BrowserFetcher(SupportedBrowser.Chrome) diff --git a/lib/PuppeteerSharp.Tests/Browsers/Chromium/ChromiumDataTests.cs b/lib/PuppeteerSharp.Tests/Browsers/Chromium/ChromiumDataTests.cs index 64045a7ff..7cca1cd6f 100644 --- a/lib/PuppeteerSharp.Tests/Browsers/Chromium/ChromiumDataTests.cs +++ b/lib/PuppeteerSharp.Tests/Browsers/Chromium/ChromiumDataTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.Browsers.Chromium { public class ChromiumDataTests { - [Test, Retry(2), PuppeteerTest("chromium-data.spec", "Chromium", "should resolve download URLs")] + [Test, PuppeteerTest("chromium-data.spec", "Chromium", "should resolve download URLs")] public void ShouldResolveDownloadUrls() { Assert.That( @@ -27,7 +27,7 @@ public void ShouldResolveDownloadUrls() Is.EqualTo("https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1083080/chrome-win.zip")); } - [Test, Retry(2), PuppeteerTest("chromium-data.spec", "Chromium", "should resolve executable paths")] + [Test, PuppeteerTest("chromium-data.spec", "Chromium", "should resolve executable paths")] public void ShouldResolveExecutablePath() { Assert.That( diff --git a/lib/PuppeteerSharp.Tests/Browsers/Firefox/CliTests.cs b/lib/PuppeteerSharp.Tests/Browsers/Firefox/CliTests.cs index 0bd51128f..e34ac5298 100644 --- a/lib/PuppeteerSharp.Tests/Browsers/Firefox/CliTests.cs +++ b/lib/PuppeteerSharp.Tests/Browsers/Firefox/CliTests.cs @@ -21,7 +21,7 @@ public void CreateDir() public void DeleteDir() => new Cache(_cacheDir).Clear(); - [Test, Retry(2), PuppeteerTest("CLI.spec", "Chrome CLI", "should download Chrome binaries")] + [Test, PuppeteerTest("CLI.spec", "Chrome CLI", "should download Chrome binaries")] public async Task ShouldDownloadChromeBinaries() { var fetcher = new BrowserFetcher(SupportedBrowser.Chrome) diff --git a/lib/PuppeteerSharp.Tests/Browsers/Firefox/FirefoxDataTests.cs b/lib/PuppeteerSharp.Tests/Browsers/Firefox/FirefoxDataTests.cs index 482405690..c6ba45256 100644 --- a/lib/PuppeteerSharp.Tests/Browsers/Firefox/FirefoxDataTests.cs +++ b/lib/PuppeteerSharp.Tests/Browsers/Firefox/FirefoxDataTests.cs @@ -6,27 +6,27 @@ namespace PuppeteerSharp.Tests.Browsers.Firefox { public class FirefoxDataTests { - [Test, Retry(2), PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for Nightly")] + [Test, PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for Nightly")] public void ShouldResolveUrlsForNightly() { Assert.That( - BrowserData.Firefox.ResolveDownloadUrl(Platform.Linux, "111.0a1", null), + BrowserData.Firefox.ResolveDownloadUrl(Platform.Linux, "nightly_111.0a1", null), Is.EqualTo("https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-111.0a1.en-US.linux-x86_64.tar.bz2")); Assert.That( - BrowserData.Firefox.ResolveDownloadUrl(Platform.MacOS, "111.0a1", null), + BrowserData.Firefox.ResolveDownloadUrl(Platform.MacOS, "nightly_111.0a1", null), Is.EqualTo("https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-111.0a1.en-US.mac.dmg")); Assert.That( - BrowserData.Firefox.ResolveDownloadUrl(Platform.MacOSArm64, "111.0a1", null), + BrowserData.Firefox.ResolveDownloadUrl(Platform.MacOSArm64, "nightly_111.0a1", null), Is.EqualTo("https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-111.0a1.en-US.mac.dmg")); Assert.That( - BrowserData.Firefox.ResolveDownloadUrl(Platform.Win32, "111.0a1", null), + BrowserData.Firefox.ResolveDownloadUrl(Platform.Win32, "nightly_111.0a1", null), Is.EqualTo("https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-111.0a1.en-US.win32.zip")); Assert.That( - BrowserData.Firefox.ResolveDownloadUrl(Platform.Win64, "111.0a1", null), + BrowserData.Firefox.ResolveDownloadUrl(Platform.Win64, "nightly_111.0a1", null), Is.EqualTo("https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-111.0a1.en-US.win64.zip")); } - [Test, Retry(2), PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for beta")] + [Test, PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for beta")] public void ShouldResolveUrlsForBeta() { Assert.That( @@ -46,7 +46,7 @@ public void ShouldResolveUrlsForBeta() Is.EqualTo("https://archive.mozilla.org/pub/firefox/releases/115.0b8/win64/en-US/Firefox Setup 115.0b8.exe")); } - [Test, Retry(2), PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for stable")] + [Test, PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for stable")] public void ShouldResolveUrlsForStable() { Assert.That( @@ -66,7 +66,7 @@ public void ShouldResolveUrlsForStable() Is.EqualTo("https://archive.mozilla.org/pub/firefox/releases/114.0/win64/en-US/Firefox Setup 114.0.exe")); } - [Test, Retry(2), PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for devedition")] + [Test, PuppeteerTest("firefox-data.spec", "Firefox", "should resolve URLs for devedition")] public void ShouldResolveUrlsForDevedition() { Assert.That( @@ -86,7 +86,7 @@ public void ShouldResolveUrlsForDevedition() Is.EqualTo("https://archive.mozilla.org/pub/devedition/releases/114.0b8/win64/en-US/Firefox Setup 114.0b8.exe")); } - [Test, Retry(2), PuppeteerTest("firefox-data.spec", "Firefox", "should resolve executable paths")] + [Test, PuppeteerTest("firefox-data.spec", "Firefox", "should resolve executable paths")] public void ShouldResolveExecutablePath() { Assert.That( @@ -96,7 +96,7 @@ public void ShouldResolveExecutablePath() Assert.That( BrowserData.Firefox.RelativeExecutablePath(Platform.MacOS, "111.0a1"), Is.EqualTo(Path.Combine( - "Firefox Nightly.app", + "Firefox.app", "Contents", "MacOS", "firefox" @@ -105,7 +105,7 @@ public void ShouldResolveExecutablePath() Assert.That( BrowserData.Firefox.RelativeExecutablePath(Platform.MacOSArm64, "111.0a1"), Is.EqualTo(Path.Combine( - "Firefox Nightly.app", + "Firefox.app", "Contents", "MacOS", "firefox" @@ -122,11 +122,7 @@ public void ShouldResolveExecutablePath() Assert.That( BrowserData.Firefox.RelativeExecutablePath(Platform.Win32, "111.0a1"), - Is.EqualTo(Path.Combine("firefox", "firefox.exe"))); - - Assert.That( - Path.Combine("firefox", "firefox.exe"), - Is.EqualTo(BrowserData.Firefox.RelativeExecutablePath(Platform.Win64, "111.0a1"))); + Is.EqualTo(Path.Combine("core", "firefox.exe"))); } } } diff --git a/lib/PuppeteerSharp.Tests/CDPSessionTests/CreateCDPSessionTests.cs b/lib/PuppeteerSharp.Tests/CDPSessionTests/CreateCDPSessionTests.cs index 3ee9b60dc..3c81f1e61 100644 --- a/lib/PuppeteerSharp.Tests/CDPSessionTests/CreateCDPSessionTests.cs +++ b/lib/PuppeteerSharp.Tests/CDPSessionTests/CreateCDPSessionTests.cs @@ -9,7 +9,7 @@ namespace PuppeteerSharp.Tests.CDPSessionTests { public class CreateCDPSessionTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should work")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should work")] public async Task ShouldWork() { var client = await Page.CreateCDPSessionAsync(); @@ -22,7 +22,7 @@ await Task.WhenAll( Assert.That(foo, Is.EqualTo("bar")); } - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should send events")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should send events")] public async Task ShouldSendEvents() { var client = await Page.CreateCDPSessionAsync(); @@ -41,7 +41,7 @@ public async Task ShouldSendEvents() Assert.That(events, Has.Exactly(1).Items); } - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should enable and disable domains independently")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should enable and disable domains independently")] public async Task ShouldEnableAndDisableDomainsIndependently() { var client = await Page.CreateCDPSessionAsync(); @@ -60,7 +60,7 @@ await Task.WhenAll( Assert.That(eventTask.Result.GetProperty("url")!.GetString(), Is.EqualTo("foo.js")); } - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should be able to detach session")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should be able to detach session")] public async Task ShouldBeAbleToDetachSession() { var client = await Page.CreateCDPSessionAsync(); @@ -82,7 +82,7 @@ public async Task ShouldBeAbleToDetachSession() Assert.That(exception!.Message, Does.Contain("Session closed.")); } - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should not report created targets for custom CDP sessions")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should not report created targets for custom CDP sessions")] public async Task ShouldNotReportCreatedTargetsForCustomCDPSessions() { var called = 0; @@ -101,7 +101,7 @@ async void EventHandler(object sender, TargetChangedArgs e) Page.BrowserContext.TargetCreated -= EventHandler; } - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should throw nice errors")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should throw nice errors")] public async Task ShouldThrowNiceErrors() { var client = await Page.CreateCDPSessionAsync(); @@ -115,7 +115,7 @@ public async Task ShouldThrowNiceErrors() Assert.That(exception.Message, Does.Contain("ThisCommand.DoesNotExist")); } - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should respect custom timeout")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should respect custom timeout")] public async Task ShouldRespectCustomTimeout() { var client = await Page.CreateCDPSessionAsync(); @@ -137,7 +137,7 @@ await client.SendAsync( Assert.That(exception!.Message, Does.Contain("Timeout of 50 ms exceeded")); } - [Test, Retry(2), PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should expose the underlying connection")] + [Test, PuppeteerTest("CDPSession.spec", "Target.createCDPSession", "should expose the underlying connection")] public async Task ShouldExposeTheUnderlyingConnection() => Assert.That(await Page.CreateCDPSessionAsync(), Is.Not.Null); } diff --git a/lib/PuppeteerSharp.Tests/ChromeLauncherTests/GetFeaturesTests.cs b/lib/PuppeteerSharp.Tests/ChromeLauncherTests/GetFeaturesTests.cs index ac94f1801..8ffac6aff 100644 --- a/lib/PuppeteerSharp.Tests/ChromeLauncherTests/GetFeaturesTests.cs +++ b/lib/PuppeteerSharp.Tests/ChromeLauncherTests/GetFeaturesTests.cs @@ -7,35 +7,35 @@ namespace PuppeteerSharp.Tests.ChromeLauncherTests public class GetFeaturesTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "returns an empty array when no options are provided")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "returns an empty array when no options are provided")] public void ReturnsAnEmptyArrayWhenNoOptionsAreProvided() { var result = ChromeLauncher.GetFeatures("--foo", Array.Empty()); Assert.That(result, Is.Empty); } - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "returns an empty array when no options match the flag")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "returns an empty array when no options match the flag")] public void ReturnsAnEmptyArrayWhenNoOptionsMatchTheFlag() { var result = ChromeLauncher.GetFeatures("--foo", new[] { "--bar", "--baz" }); Assert.That(result, Is.Empty); } - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "returns an array of values when options match the flag")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "returns an array of values when options match the flag")] public void ReturnsAnArrayOfValuesWhenOptionsMatchTheFlag() { var result = ChromeLauncher.GetFeatures("--foo", new[] { "--foo=bar", "--foo=baz" }); Assert.That(result, Is.EqualTo(new[] { "bar", "baz" })); } - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "does not handle whitespace")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "does not handle whitespace")] public void DoesNotHandleWhitespace() { var result = ChromeLauncher.GetFeatures("--foo", new[] { "--foo bar", "--foo baz " }); Assert.That(result, Is.Empty); } - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "handles equals sign around the flag and value")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "getFeatures", "handles equals sign around the flag and value")] public void HandlesEqualsSignAroundTheFlagAndValue() { var result = ChromeLauncher.GetFeatures("--foo", new[] { "--foo=bar", "--foo=baz" }); diff --git a/lib/PuppeteerSharp.Tests/ChromeLauncherTests/RemoveMatchingFlagsTests.cs b/lib/PuppeteerSharp.Tests/ChromeLauncherTests/RemoveMatchingFlagsTests.cs index bca19074f..c08bc3889 100644 --- a/lib/PuppeteerSharp.Tests/ChromeLauncherTests/RemoveMatchingFlagsTests.cs +++ b/lib/PuppeteerSharp.Tests/ChromeLauncherTests/RemoveMatchingFlagsTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.ChromeLauncherTests public class RemoveMatchingFlagsTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "empty")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "empty")] public void Empty() { var a = Array.Empty(); @@ -15,7 +15,7 @@ public void Empty() Assert.That(result, Is.Empty); } - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "with one match")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "with one match")] public void WithOneMatch() { var a = new[] { "--foo=1", "--bar=baz" }; @@ -23,7 +23,7 @@ public void WithOneMatch() Assert.That(result, Is.EqualTo(new[] { "--bar=baz" })); } - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "with multiple matches")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "with multiple matches")] public void WithMultipleMatches() { var a = new[] { "--foo=1", "--bar=baz", "--foo=2" }; @@ -31,7 +31,7 @@ public void WithMultipleMatches() Assert.That(result, Is.EqualTo(new[] { "--bar=baz" })); } - [Test, Retry(2), PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "with no matches")] + [Test, PuppeteerTest("ChromeLauncher.test.ts", "removeMatchingFlags", "with no matches")] public void WithNoMatches() { var a = new[] { "--foo=1", "--bar=baz" }; diff --git a/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/BrowserUrlOptionTests.cs b/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/BrowserUrlOptionTests.cs index 97de7d67f..a4fbb26c9 100644 --- a/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/BrowserUrlOptionTests.cs +++ b/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/BrowserUrlOptionTests.cs @@ -10,7 +10,7 @@ public BrowserUrlOptionTests() : base() { } - [Test, Retry(2), PuppeteerTest("chromiumonly.spec", "Puppeteer.launch |browserURL| option", "should be able to connect using browserUrl, with and without trailing slash")] + [Test, PuppeteerTest("chromiumonly.spec", "Puppeteer.launch |browserURL| option", "should be able to connect using browserUrl, with and without trailing slash")] public async Task ShouldBeAbleToConnectUsingBrowserURLWithAndWithoutTrailingSlash() { var options = TestConstants.DefaultBrowserOptions(); @@ -30,7 +30,7 @@ public async Task ShouldBeAbleToConnectUsingBrowserURLWithAndWithoutTrailingSlas await originalBrowser.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("chromiumonly.spec", "Puppeteer.launch |browserURL| option", "should throw when using both browserWSEndpoint and browserURL")] + [Test, PuppeteerTest("chromiumonly.spec", "Puppeteer.launch |browserURL| option", "should throw when using both browserWSEndpoint and browserURL")] public async Task ShouldThrowWhenUsingBothBrowserWSEndpointAndBrowserURL() { var options = TestConstants.DefaultBrowserOptions(); @@ -47,7 +47,7 @@ public async Task ShouldThrowWhenUsingBothBrowserWSEndpointAndBrowserURL() await originalBrowser.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("chromiumonly.spec", "Puppeteer.launch |browserURL| option", "should throw when trying to connect to non-existing browser")] + [Test, PuppeteerTest("chromiumonly.spec", "Puppeteer.launch |browserURL| option", "should throw when trying to connect to non-existing browser")] public async Task ShouldThrowWhenTryingToConnectToNonExistingBrowser() { var options = TestConstants.DefaultBrowserOptions(); diff --git a/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/PageTests.cs b/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/PageTests.cs index 43c28b6c6..49abc5501 100644 --- a/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/PageTests.cs +++ b/lib/PuppeteerSharp.Tests/ChromiumOnlyTests/PageTests.cs @@ -11,7 +11,7 @@ public PageTests() : base() { } - [Test, Retry(2), PuppeteerTest("chromiumonly.spec", "Chromium-Specific Page Tests", "Page.setRequestInterception should work with intervention headers")] + [Test, PuppeteerTest("chromiumonly.spec", "Chromium-Specific Page Tests", "Page.setRequestInterception should work with intervention headers")] public async Task ShouldWorkWithInterventionHeaders() { Server.SetRoute("/intervention", context => context.Response.WriteAsync($@" diff --git a/lib/PuppeteerSharp.Tests/ClickTests/ClickTests.cs b/lib/PuppeteerSharp.Tests/ClickTests/ClickTests.cs index 341867ed6..9ed67b2af 100644 --- a/lib/PuppeteerSharp.Tests/ClickTests/ClickTests.cs +++ b/lib/PuppeteerSharp.Tests/ClickTests/ClickTests.cs @@ -8,7 +8,7 @@ namespace PuppeteerSharp.Tests.ClickTests { public class ClickTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click the button")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click the button")] public async Task ShouldClickTheButton() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -16,7 +16,7 @@ public async Task ShouldClickTheButton() Assert.That(await Page.EvaluateExpressionAsync("result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click svg")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click svg")] public async Task ShouldClickSvg() { await Page.SetContentAsync($@" @@ -28,7 +28,7 @@ await Page.SetContentAsync($@" Assert.That(await Page.EvaluateFunctionAsync("() => window.__CLICKED"), Is.EqualTo(42)); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click the button if window.Node is removed")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click the button if window.Node is removed")] public async Task ShouldClickTheButtonIfWindowNodeIsRemoved() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -37,7 +37,7 @@ public async Task ShouldClickTheButtonIfWindowNodeIsRemoved() Assert.That(await Page.EvaluateExpressionAsync("result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click on a span with an inline element inside")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click on a span with an inline element inside")] [Ignore("See https://github.com/GoogleChrome/puppeteer/issues/4281")] public async Task ShouldClickOnASpanWithAnInlineElementInside() { @@ -56,7 +56,7 @@ await Page.SetContentAsync($@" /// /// This test is called ShouldNotThrowUnhandledPromiseRejectionWhenPageCloses in puppeteer. /// - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should not throw UnhandledPromiseRejection when page closes")] + [Test, PuppeteerTest("click.spec", "Page.click", "should not throw UnhandledPromiseRejection when page closes")] [Ignore("We don't need this test")] public async Task ShouldGracefullyFailWhenPageCloses() { @@ -66,7 +66,7 @@ await Task.WhenAll( newPage.Mouse.ClickAsync(1, 2)); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click the button after navigation")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click the button after navigation")] public async Task ShouldClickTheButtonAfterNavigation() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -76,7 +76,7 @@ public async Task ShouldClickTheButtonAfterNavigation() Assert.That(await Page.EvaluateExpressionAsync("result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click with disabled javascript")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click with disabled javascript")] public async Task ShouldClickWithDisabledJavascript() { await Page.SetJavaScriptEnabledAsync(false); @@ -88,7 +88,7 @@ await Task.WhenAll( Assert.That(Page.Url, Is.EqualTo(TestConstants.ServerUrl + "/wrappedlink.html#clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should scroll and click with disabled javascript")] + [Test, PuppeteerTest("click.spec", "Page.click", "should scroll and click with disabled javascript")] public async Task ShouldScrollAndClickWithDisabledJavascript() { await Page.SetJavaScriptEnabledAsync(false); @@ -102,7 +102,7 @@ await Task.WhenAll( Assert.That(Page.Url, Is.EqualTo(TestConstants.ServerUrl + "/wrappedlink.html#clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click when one of inline box children is outside of viewport")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click when one of inline box children is outside of viewport")] public async Task ShouldClickWhenOneOfInlineBoxChildrenIsOutsideOfViewport() { await Page.SetContentAsync($@" @@ -119,7 +119,7 @@ await Page.SetContentAsync($@" Assert.That(await Page.EvaluateFunctionAsync("() => window.CLICKED"), Is.EqualTo(42)); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should select the text by triple clicking")] + [Test, PuppeteerTest("click.spec", "Page.click", "should select the text by triple clicking")] public async Task ShouldSelectTheTextByTripleClicking() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/textarea.html"); @@ -138,7 +138,7 @@ public async Task ShouldSelectTheTextByTripleClicking() }"), Is.EqualTo(text)); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click offscreen buttons")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click offscreen buttons")] public async Task ShouldClickOffscreenButtons() { await Page.GoToAsync(TestConstants.ServerUrl + "/offscreenbuttons.html"); @@ -171,7 +171,7 @@ public async Task ShouldClickOffscreenButtons() })); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click wrapped links")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click wrapped links")] public async Task ShouldClickWrappedLinks() { await Page.GoToAsync(TestConstants.ServerUrl + "/wrappedlink.html"); @@ -179,7 +179,7 @@ public async Task ShouldClickWrappedLinks() Assert.That(await Page.EvaluateExpressionAsync("window.__clicked"), Is.True); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click on checkbox input and toggle")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click on checkbox input and toggle")] public async Task ShouldClickOnCheckboxInputAndToggle() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/checkbox.html"); @@ -201,7 +201,7 @@ public async Task ShouldClickOnCheckboxInputAndToggle() Assert.That(await Page.EvaluateExpressionAsync("result.check"), Is.False); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click on checkbox label and toggle")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click on checkbox label and toggle")] public async Task ShouldClickOnCheckboxLabelAndToggle() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/checkbox.html"); @@ -218,7 +218,7 @@ public async Task ShouldClickOnCheckboxLabelAndToggle() Assert.That(await Page.EvaluateExpressionAsync("result.check"), Is.False); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should fail to click a missing button")] + [Test, PuppeteerTest("click.spec", "Page.click", "should fail to click a missing button")] public async Task ShouldFailToClickAMissingButton() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -229,7 +229,7 @@ public async Task ShouldFailToClickAMissingButton() } // https://github.com/GoogleChrome/puppeteer/issues/161 - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should not hang with touch-enabled viewports")] + [Test, PuppeteerTest("click.spec", "Page.click", "should not hang with touch-enabled viewports")] public async Task ShouldNotHangWithTouchEnabledViewports() { await Page.SetViewportAsync(TestConstants.IPhone.ViewPort); @@ -238,7 +238,7 @@ public async Task ShouldNotHangWithTouchEnabledViewports() await Page.Mouse.UpAsync(); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should scroll and click the button")] + [Test, PuppeteerTest("click.spec", "Page.click", "should scroll and click the button")] public async Task ShouldScrollAndClickTheButton() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/scrollable.html"); @@ -248,7 +248,7 @@ public async Task ShouldScrollAndClickTheButton() Assert.That(await Page.EvaluateExpressionAsync("document.querySelector(\"#button-80\").textContent"), Is.EqualTo("clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should double click the button")] + [Test, PuppeteerTest("click.spec", "Page.click", "should double click the button")] public async Task ShouldDoubleClickTheButton() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -265,7 +265,7 @@ await Page.EvaluateExpressionAsync(@"{ Assert.That(await Page.EvaluateExpressionAsync("result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click a partially obscured button")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click a partially obscured button")] public async Task ShouldClickAPartiallyObscuredButton() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -279,7 +279,7 @@ await Page.EvaluateExpressionAsync(@"{ Assert.That(await Page.EvaluateExpressionAsync("result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click a rotated button")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click a rotated button")] public async Task ShouldClickARotatedButton() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/rotatedButton.html"); @@ -287,7 +287,7 @@ public async Task ShouldClickARotatedButton() Assert.That(await Page.EvaluateExpressionAsync("result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should fire contextmenu event on right click")] + [Test, PuppeteerTest("click.spec", "Page.click", "should fire contextmenu event on right click")] public async Task ShouldFireContextmenuEventOnRightClick() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/scrollable.html"); @@ -295,7 +295,7 @@ public async Task ShouldFireContextmenuEventOnRightClick() Assert.That(await Page.EvaluateExpressionAsync("document.querySelector('#button-8').textContent"), Is.EqualTo("context menu")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should fire aux event on middle click")] + [Test, PuppeteerTest("click.spec", "Page.click", "should fire aux event on middle click")] public async Task ShouldFireAuxEventOnMiddleClick() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/scrollable.html"); @@ -303,7 +303,7 @@ public async Task ShouldFireAuxEventOnMiddleClick() Assert.That(await Page.EvaluateExpressionAsync("document.querySelector('#button-8').textContent"), Is.EqualTo("aux click")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should fire back click")] + [Test, PuppeteerTest("click.spec", "Page.click", "should fire back click")] public async Task ShouldFireBackClick() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/scrollable.html"); @@ -311,7 +311,7 @@ public async Task ShouldFireBackClick() Assert.That(await Page.EvaluateExpressionAsync("document.querySelector('#button-8').textContent"), Is.EqualTo("back click")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should fire forward click")] + [Test, PuppeteerTest("click.spec", "Page.click", "should fire forward click")] public async Task ShouldFireForwardClick() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/scrollable.html"); @@ -320,7 +320,7 @@ public async Task ShouldFireForwardClick() } // @see https://github.com/GoogleChrome/puppeteer/issues/206 - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click links which cause navigation")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click links which cause navigation")] public async Task ShouldClickLinksWhichCauseNavigation() { await Page.SetContentAsync($"empty.html"); @@ -328,7 +328,7 @@ public async Task ShouldClickLinksWhichCauseNavigation() await Page.ClickAsync("a"); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click the button inside an iframe")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click the button inside an iframe")] public async Task ShouldClickTheButtonInsideAnIframe() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -340,7 +340,7 @@ public async Task ShouldClickTheButtonInsideAnIframe() Assert.That(await frame.EvaluateExpressionAsync("window.result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click the button with fixed position inside an iframe")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click the button with fixed position inside an iframe")] [Ignore("see https://github.com/GoogleChrome/puppeteer/issues/4110")] public async Task ShouldClickTheButtonWithFixedPositionInsideAnIframe() { @@ -358,7 +358,7 @@ await Page.SetViewportAsync(new ViewPortOptions Assert.That(await frame.EvaluateExpressionAsync("window.result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("click.spec", "Page.click", "should click the button with deviceScaleFactor set")] + [Test, PuppeteerTest("click.spec", "Page.click", "should click the button with deviceScaleFactor set")] public async Task ShouldClickTheButtonWithDeviceScaleFactorSet() { await Page.SetViewportAsync(new ViewPortOptions { Width = 400, Height = 400, DeviceScaleFactor = 5 }); diff --git a/lib/PuppeteerSharp.Tests/CookiesTests/CookiesTests.cs b/lib/PuppeteerSharp.Tests/CookiesTests/CookiesTests.cs index 0fafc244f..a16a8a726 100644 --- a/lib/PuppeteerSharp.Tests/CookiesTests/CookiesTests.cs +++ b/lib/PuppeteerSharp.Tests/CookiesTests/CookiesTests.cs @@ -7,14 +7,14 @@ namespace PuppeteerSharp.Tests.CookiesTests { public class CookiesTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should return no cookies in pristine browser context")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should return no cookies in pristine browser context")] public async Task ShouldReturnNoCookiesInPristineBrowserContext() { await Page.GoToAsync(TestConstants.EmptyPage); Assert.That(await Page.GetCookiesAsync(), Is.Empty); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get a cookie")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get a cookie")] public async Task ShouldGetACookie() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -35,7 +35,7 @@ public async Task ShouldGetACookie() Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should properly report httpOnly cookie")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should properly report httpOnly cookie")] public async Task ShouldProperlyReportHttpOnlyCookie() { Server.SetRoute("/empty.html", context => @@ -49,7 +49,7 @@ public async Task ShouldProperlyReportHttpOnlyCookie() Assert.That(cookies[0].HttpOnly, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should properly report \"Strict\" sameSite cookie")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should properly report \"Strict\" sameSite cookie")] public async Task ShouldProperlyReportSStrictSameSiteCookie() { Server.SetRoute("/empty.html", context => @@ -63,7 +63,7 @@ public async Task ShouldProperlyReportSStrictSameSiteCookie() Assert.That(cookies[0].SameSite, Is.EqualTo(SameSite.Strict)); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should properly report \"Lax\" sameSite cookie")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should properly report \"Lax\" sameSite cookie")] public async Task ShouldProperlyReportLaxSameSiteCookie() { Server.SetRoute("/empty.html", context => @@ -77,7 +77,7 @@ public async Task ShouldProperlyReportLaxSameSiteCookie() Assert.That(cookies[0].SameSite, Is.EqualTo(SameSite.Lax)); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get multiple cookies")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get multiple cookies")] public async Task ShouldGetMultipleCookies() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -113,7 +113,7 @@ await Page.EvaluateFunctionAsync(@"() => { Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get cookies from multiple urls")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get cookies from multiple urls")] public async Task ShouldGetCookiesFromMultipleUrls() { await Page.SetCookieAsync( @@ -163,7 +163,7 @@ await Page.SetCookieAsync( Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should not get cookies from subdomain")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should not get cookies from subdomain")] public async Task ShouldNotGetCookiesFromSubdomain() { await Page.SetCookieAsync(new CookieParam @@ -175,7 +175,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(await Page.GetCookiesAsync("https://sub_domain.base_domain.com"), Is.Empty); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get cookies from nested path")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should get cookies from nested path")] public async Task ShouldGetCookiesFromNestedPath() { await Page.SetCookieAsync(new CookieParam @@ -191,7 +191,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookies, Has.Exactly(1).Items); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should not get cookies from not nested path")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.cookies", "should not get cookies from not nested path")] public async Task ShouldNotGetCookiesFromNotNestedPath() { await Page.SetCookieAsync(new CookieParam diff --git a/lib/PuppeteerSharp.Tests/CookiesTests/DeleteCookiesTests.cs b/lib/PuppeteerSharp.Tests/CookiesTests/DeleteCookiesTests.cs index 3f138e452..aea4fcc19 100644 --- a/lib/PuppeteerSharp.Tests/CookiesTests/DeleteCookiesTests.cs +++ b/lib/PuppeteerSharp.Tests/CookiesTests/DeleteCookiesTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.CookiesTests { public class DeleteCookiesTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.deleteCookie", "should delete cookie")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.deleteCookie", "should delete cookie")] public async Task ShouldDeleteCookie() { await Page.GoToAsync(TestConstants.ServerUrl + "/grid.html"); diff --git a/lib/PuppeteerSharp.Tests/CookiesTests/SetCookiesTests.cs b/lib/PuppeteerSharp.Tests/CookiesTests/SetCookiesTests.cs index 0c0df1106..f5d7c398e 100644 --- a/lib/PuppeteerSharp.Tests/CookiesTests/SetCookiesTests.cs +++ b/lib/PuppeteerSharp.Tests/CookiesTests/SetCookiesTests.cs @@ -11,7 +11,7 @@ public SetCookiesTests() : base() { } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should work")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -23,7 +23,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(await Page.EvaluateExpressionAsync("document.cookie"), Is.EqualTo("password=123456")); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should isolate cookies in browser contexts")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should isolate cookies in browser contexts")] public async Task ShouldIsolateCookiesInBrowserContexts() { var anotherContext = await Browser.CreateBrowserContextAsync(); @@ -57,7 +57,7 @@ await anotherPage.SetCookieAsync(new CookieParam await anotherContext.CloseAsync(); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set multiple cookies")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set multiple cookies")] public async Task ShouldSetMultipleCookies() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -87,7 +87,7 @@ await Page.EvaluateFunctionAsync(@"() => { })); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should have |expires| set to |-1| for session cookies")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should have |expires| set to |-1| for session cookies")] public async Task ShouldHaveExpiresSetToMinus1ForSessionCookies() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -104,7 +104,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookies[0].Expires, Is.EqualTo(-1)); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set cookie with reasonable defaults")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set cookie with reasonable defaults")] public async Task ShouldSetCookieWithReasonableDefaults() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -129,7 +129,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set cookie with all available properties")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set cookie with all available properties")] public async Task ShouldSetCookieWithAllAvailableProperties() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -162,7 +162,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookie.SourceScheme, Is.EqualTo(CookieSourceScheme.Unset)); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set a cookie with a path")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set a cookie with a path")] public async Task ShouldSetACookieWithAPath() { await Page.GoToAsync(TestConstants.ServerUrl + "/grid.html"); @@ -186,7 +186,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should not set a cookie on a blank page")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should not set a cookie on a blank page")] public async Task ShouldNotSetACookieOnABlankPage() { await Page.GoToAsync(TestConstants.AboutBlank); @@ -195,7 +195,7 @@ public async Task ShouldNotSetACookieOnABlankPage() Assert.That(exception.Message, Does.Contain("At least one of the url and domain needs to be specified")); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should not set a cookie with blank page URL")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should not set a cookie with blank page URL")] public async Task ShouldNotSetACookieWithBlankPageURL() { await Page.GoToAsync(TestConstants.ServerUrl + "/grid.html"); @@ -213,7 +213,7 @@ public async Task ShouldNotSetACookieWithBlankPageURL() Assert.That(exception.Message, Is.EqualTo("Blank page can not have cookie \"example-cookie-blank\"")); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should not set a cookie on a data URL page")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should not set a cookie on a data URL page")] public async Task ShouldNotSetACookieOnADataURLPage() { await Page.GoToAsync("data:,Hello%2C%20World!"); @@ -222,7 +222,7 @@ public async Task ShouldNotSetACookieOnADataURLPage() Assert.That(exception.Message, Does.Contain("At least one of the url and domain needs to be specified")); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should default to setting secure cookie for HTTPS websites")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should default to setting secure cookie for HTTPS websites")] public async Task ShouldDefaultToSettingSecureCookieForHttpsWebsites() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -241,7 +241,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookie.Secure, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should be able to set insecure cookie for HTTP website")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should be able to set insecure cookie for HTTP website")] public async Task ShouldDefaultToSettingSecureCookieForHttpWebsites() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -260,7 +260,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookie.Secure, Is.False); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should be able to set unsecure cookie for HTTP website")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should be able to set unsecure cookie for HTTP website")] public async Task ShouldBeAbleToSetUnsecureCookieForHttpWebSite() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -278,7 +278,7 @@ await Page.SetCookieAsync(new CookieParam Assert.That(cookie.Secure, Is.False); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set a cookie on a different domain")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set a cookie on a different domain")] public async Task ShouldSetACookieOnADifferentDomain() { await Page.GoToAsync(TestConstants.ServerUrl + "/grid.html"); @@ -299,7 +299,7 @@ public async Task ShouldSetACookieOnADifferentDomain() Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set cookies from a frame")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set cookies from a frame")] public async Task ShouldSetCookiesFromAFrame() { await Page.GoToAsync(TestConstants.ServerUrl + "/grid.html"); @@ -343,7 +343,7 @@ await Page.EvaluateFunctionAsync(@"src => { Assert.That(cookie.Session, Is.True); } - [Test, Retry(2), PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set secure same-site cookies from a frame")] + [Test, PuppeteerTest("cookies.spec", "Cookie specs Page.setCookie", "should set secure same-site cookies from a frame")] public async Task ShouldSetSecureSameSiteCookiesFromAFrame() { var options = TestConstants.DefaultBrowserOptions(); diff --git a/lib/PuppeteerSharp.Tests/CoverageTests/CSSCoverageTests.cs b/lib/PuppeteerSharp.Tests/CoverageTests/CSSCoverageTests.cs index 99df06c25..c895b5af9 100644 --- a/lib/PuppeteerSharp.Tests/CoverageTests/CSSCoverageTests.cs +++ b/lib/PuppeteerSharp.Tests/CoverageTests/CSSCoverageTests.cs @@ -15,7 +15,7 @@ public CSSCoverageTests() : base() { } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work")] public async Task ShouldWork() { await Page.Coverage.StartCSSCoverageAsync(); @@ -35,7 +35,7 @@ public async Task ShouldWork() Assert.That(coverage[0].Text.Substring(range.Start, range.End - range.Start), Is.EqualTo("div { color: green; }")); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should report sourceURLs")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should report sourceURLs")] public async Task ShouldReportSourceUrls() { await Page.Coverage.StartCSSCoverageAsync(); @@ -47,7 +47,7 @@ public async Task ShouldReportSourceUrls() Assert.That(coverage[0].Url, Is.EqualTo("nicename.css")); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should report multiple stylesheets")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should report multiple stylesheets")] public async Task ShouldReportMultipleStylesheets() { await Page.Coverage.StartCSSCoverageAsync(); @@ -59,7 +59,7 @@ public async Task ShouldReportMultipleStylesheets() Assert.That(orderedList.ElementAt(1).Url, Does.Contain("/csscoverage/stylesheet2.css")); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should report stylesheets that have no coverage")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should report stylesheets that have no coverage")] public async Task ShouldReportStylesheetsThatHaveNoCoverage() { await Page.Coverage.StartCSSCoverageAsync(); @@ -71,7 +71,7 @@ public async Task ShouldReportStylesheetsThatHaveNoCoverage() Assert.That(entry.Ranges, Is.Empty); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work with media queries")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work with media queries")] public async Task ShouldWorkWithMediaQueries() { await Page.Coverage.StartCSSCoverageAsync(); @@ -95,7 +95,7 @@ public async Task ShouldWorkWithMediaQueries() })); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work with complicated usecases")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work with complicated usecases")] public async Task ShouldWorkWithComplicatedUsecases() { const string involved = @"[ @@ -133,7 +133,7 @@ public async Task ShouldWorkWithComplicatedUsecases() Is.EqualTo(TestUtils.CompressText(involved))); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should ignore injected stylesheets")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should ignore injected stylesheets")] public async Task ShouldIgnoreInjectedStylesheets() { await Page.Coverage.StartCSSCoverageAsync(); @@ -148,7 +148,7 @@ await Page.AddStyleTagAsync(new AddTagOptions Assert.That(coverage, Is.Empty); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work with a recently loaded stylesheet")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs CSSCoverage", "should work with a recently loaded stylesheet")] public async Task ShouldWorkWithArRecentlyLoadedStylesheet() { await Page.Coverage.StartCSSCoverageAsync(); diff --git a/lib/PuppeteerSharp.Tests/CoverageTests/CSSResetOnNavigationTests.cs b/lib/PuppeteerSharp.Tests/CoverageTests/CSSResetOnNavigationTests.cs index 03223e1c3..f851057c6 100644 --- a/lib/PuppeteerSharp.Tests/CoverageTests/CSSResetOnNavigationTests.cs +++ b/lib/PuppeteerSharp.Tests/CoverageTests/CSSResetOnNavigationTests.cs @@ -11,7 +11,7 @@ public CSSResetOnNavigationTests() : base() { } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should report stylesheets across navigations")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should report stylesheets across navigations")] public async Task ShouldReportStylesheetsAcrossNavigationsWhenDisabled() { await Page.Coverage.StartCSSCoverageAsync(new CoverageStartOptions @@ -24,7 +24,7 @@ await Page.Coverage.StartCSSCoverageAsync(new CoverageStartOptions Assert.That(coverage, Has.Length.EqualTo(2)); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should NOT report scripts across navigations")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should NOT report scripts across navigations")] public async Task ShouldNotReportScriptsAcrossNavigationsWhenEnabled() { await Page.Coverage.StartCSSCoverageAsync(); diff --git a/lib/PuppeteerSharp.Tests/CoverageTests/IncludeRawScriptCoverageTests.cs b/lib/PuppeteerSharp.Tests/CoverageTests/IncludeRawScriptCoverageTests.cs index 82aed971c..3651cd595 100644 --- a/lib/PuppeteerSharp.Tests/CoverageTests/IncludeRawScriptCoverageTests.cs +++ b/lib/PuppeteerSharp.Tests/CoverageTests/IncludeRawScriptCoverageTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.CoverageTests { public class IncludeRawScriptCoverageTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage includeRawScriptCoverage", "should not include rawScriptCoverage field when disabled")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage includeRawScriptCoverage", "should not include rawScriptCoverage field when disabled")] public async Task ShouldNotIncludeRawScriptCoverageFieldWhenDisabled() { await Page.Coverage.StartJSCoverageAsync(); @@ -17,7 +17,7 @@ public async Task ShouldNotIncludeRawScriptCoverageFieldWhenDisabled() Assert.That(coverage[0].RawScriptCoverage, Is.Null); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage includeRawScriptCoverage", "should include rawScriptCoverage field when enabled")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage includeRawScriptCoverage", "should include rawScriptCoverage field when enabled")] public async Task ShouldIncludeRawScriptCoverageFieldWhenEnabled() { await Page.Coverage.StartJSCoverageAsync(new CoverageStartOptions diff --git a/lib/PuppeteerSharp.Tests/CoverageTests/JSCoverageTests.cs b/lib/PuppeteerSharp.Tests/CoverageTests/JSCoverageTests.cs index 8ab0bb8eb..cff9f6c24 100644 --- a/lib/PuppeteerSharp.Tests/CoverageTests/JSCoverageTests.cs +++ b/lib/PuppeteerSharp.Tests/CoverageTests/JSCoverageTests.cs @@ -11,7 +11,7 @@ namespace PuppeteerSharp.Tests.CoverageTests { public class JSCoverageTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should work")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should work")] public async Task ShouldWork() { await Page.Coverage.StartJSCoverageAsync(); @@ -34,7 +34,7 @@ public async Task ShouldWork() })); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report sourceURLs")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report sourceURLs")] public async Task ShouldReportSourceUrls() { await Page.Coverage.StartJSCoverageAsync(); @@ -46,7 +46,7 @@ public async Task ShouldReportSourceUrls() Assert.That(coverage[0].Url, Is.EqualTo("nicename.js")); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should ignore eval() scripts by default")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should ignore eval() scripts by default")] public async Task ShouldIgnoreEvalScriptsByDefault() { await Page.Coverage.StartJSCoverageAsync(); @@ -57,7 +57,7 @@ public async Task ShouldIgnoreEvalScriptsByDefault() Assert.That(coverage, Has.Exactly(1).Items); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should not ignore eval() scripts if reportAnonymousScripts is true")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should not ignore eval() scripts if reportAnonymousScripts is true")] public async Task ShouldNotIgnoreEvalScriptsIfReportAnonymousScriptsIsTrue() { await Page.Coverage.StartJSCoverageAsync(new CoverageStartOptions @@ -72,7 +72,7 @@ await Page.Coverage.StartJSCoverageAsync(new CoverageStartOptions Assert.That(filtered.Count(), Is.EqualTo(1)); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should ignore pptr internal scripts if reportAnonymousScripts is true")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should ignore pptr internal scripts if reportAnonymousScripts is true")] public async Task ShouldIgnorePptrInternalScriptsIfReportAnonymousScriptsIsTrue() { await Page.Coverage.StartJSCoverageAsync(new CoverageStartOptions @@ -86,7 +86,7 @@ await Page.Coverage.StartJSCoverageAsync(new CoverageStartOptions Assert.That(coverage, Is.Empty); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report multiple scripts")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report multiple scripts")] public async Task ShouldReportMultipleScripts() { await Page.Coverage.StartJSCoverageAsync(); @@ -100,7 +100,7 @@ public async Task ShouldReportMultipleScripts() Assert.That(orderedList[1].Url, Does.Contain("/jscoverage/script2.js")); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report right ranges")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report right ranges")] public async Task ShouldReportRightRanges() { await Page.Coverage.StartJSCoverageAsync(); @@ -110,12 +110,34 @@ public async Task ShouldReportRightRanges() var coverage = await Page.Coverage.StopJSCoverageAsync(); Assert.That(coverage, Has.Exactly(1).Items); var entry = coverage[0]; - Assert.That(entry.Ranges, Has.Exactly(1).Items); - var range = entry.Ranges[0]; - Assert.That(entry.Text.Substring(range.Start, range.End - range.Start), Is.EqualTo("console.log('used!');")); + Assert.That(entry.Ranges, Has.Exactly(2).Items); + var range1 = entry.Ranges[0]; + Assert.That(entry.Text.Substring(range1.Start, range1.End - range1.Start), Is.EqualTo("\n")); + var range2 = entry.Ranges[1]; + Assert.That(entry.Text.Substring(range2.Start, range2.End - range2.Start), Is.EqualTo("console.log('used!');if(true===false)")); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report scripts that have no coverage")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report right ranges for \"per function\" scope")] + public async Task ShouldReportRightRangesForPerFunctionScope() + { + var coverageOptions = new CoverageStartOptions + { + UseBlockCoverage = false, + }; + + await Page.Coverage.StartJSCoverageAsync(coverageOptions); + await Page.GoToAsync(TestConstants.ServerUrl + "/jscoverage/ranges.html"); + var coverage = await Page.Coverage.StopJSCoverageAsync(); + Assert.That(coverage, Has.Exactly(1).Items); + var entry = coverage[0]; + Assert.That(entry.Ranges, Has.Exactly(2).Items); + var range1 = entry.Ranges[0]; + Assert.That(entry.Text.Substring(range1.Start, range1.End - range1.Start), Is.EqualTo("\n")); + var range2 = entry.Ranges[1]; + Assert.That(entry.Text.Substring(range2.Start, range2.End - range2.Start), Is.EqualTo("console.log('used!');if(true===false)console.log('unused!');")); + } + + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should report scripts that have no coverage")] public async Task ShouldReportScriptsThatHaveNoCoverage() { await Page.Coverage.StartJSCoverageAsync(); @@ -129,7 +151,7 @@ public async Task ShouldReportScriptsThatHaveNoCoverage() Assert.That(entry.Ranges, Is.Empty); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should work with conditionals")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should work with conditionals")] public async Task ShouldWorkWithConditionals() { const string involved = @"[ @@ -177,7 +199,7 @@ public async Task ShouldWorkWithConditionals() Is.EqualTo(TestUtils.CompressText(involved))); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should not hang when there is a debugger statement")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs JSCoverage", "should not hang when there is a debugger statement")] [Ignore("Skipped in puppeteer")] public async Task ShouldNotHangWhenThereIsADebuggerStatement() { diff --git a/lib/PuppeteerSharp.Tests/CoverageTests/JSResetOnNavigationTests.cs b/lib/PuppeteerSharp.Tests/CoverageTests/JSResetOnNavigationTests.cs index 20098a960..ea092f3ec 100644 --- a/lib/PuppeteerSharp.Tests/CoverageTests/JSResetOnNavigationTests.cs +++ b/lib/PuppeteerSharp.Tests/CoverageTests/JSResetOnNavigationTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.CoverageTests { public class JSResetOnNavigationTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should report scripts across navigations when disabled")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should report scripts across navigations when disabled")] public async Task ShouldReportScriptsAcrossNavigationsWhenDisabled() { await Page.Coverage.StartJSCoverageAsync(new CoverageStartOptions @@ -20,7 +20,7 @@ await Page.Coverage.StartJSCoverageAsync(new CoverageStartOptions Assert.That(coverage, Has.Length.EqualTo(2)); } - [Test, Retry(2), PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should NOT report scripts across navigations when enabled")] + [Test, PuppeteerTest("coverage.spec", "Coverage specs resetOnNavigation", "should NOT report scripts across navigations when enabled")] public async Task ShouldNotReportScriptsAcrossNavigationsWhenEnabled() { await Page.Coverage.StartJSCoverageAsync(); diff --git a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptCancelTests.cs b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptCancelTests.cs index 3cb44a371..52d6f38fe 100644 --- a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptCancelTests.cs +++ b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptCancelTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.DeviceRequestPromptTests; public class DeviceRequestPromptCancelTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.cancel", "should succeed on first call")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.cancel", "should succeed on first call")] public async Task ShouldSucceedOnFirstCall() { var client = new MockCDPSession(); @@ -20,7 +20,7 @@ public async Task ShouldSucceedOnFirstCall() await prompt.CancelAsync(); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.cancel", "should fail when canceling prompt twice")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.cancel", "should fail when canceling prompt twice")] public async Task ShouldFailWhenCancelingPromptTwice() { var client = new MockCDPSession(); diff --git a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptDevicesTests.cs b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptDevicesTests.cs index 5d395467e..e9831ee76 100644 --- a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptDevicesTests.cs +++ b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptDevicesTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.DeviceRequestPromptTests; public class DeviceRequestPromptDevicesTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.devices", "lists devices as they arrive")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.devices", "lists devices as they arrive")] public void ShouldListDevicesAsTheyArrive() { var client = new MockCDPSession(); @@ -65,7 +65,7 @@ public void ShouldListDevicesAsTheyArrive() Assert.That(prompt.Devices, Has.Count.EqualTo(2)); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.devices", "does not list devices from events of another prompt")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.devices", "does not list devices from events of another prompt")] public void ShouldNotListDevicesFromEventsOfAnotherPrompt() { var client = new MockCDPSession(); diff --git a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptSelectTests.cs b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptSelectTests.cs index 47cd84d83..184364e9f 100644 --- a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptSelectTests.cs +++ b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptSelectTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.DeviceRequestPromptTests; public class DeviceRequestPromptSelectTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.select", "should succeed with listed device")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.select", "should succeed with listed device")] public async Task ShouldSucceedWithListedDevice() { var client = new MockCDPSession(); @@ -41,7 +41,7 @@ public async Task ShouldSucceedWithListedDevice() await prompt.SelectAsync(device); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.select", "should error for device not listed in devices")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.select", "should error for device not listed in devices")] public void ShouldErrorForDeviceNotListedInDevices() { var client = new MockCDPSession(); @@ -57,7 +57,7 @@ public void ShouldErrorForDeviceNotListedInDevices() Assert.That(exception!.Message, Is.EqualTo("Cannot select unknown device!")); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.select", "should fail when selecting prompt twice")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.select", "should fail when selecting prompt twice")] public async Task ShouldFailWhenSelectingPromptTwice() { var client = new MockCDPSession(); diff --git a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptWaitForDeviceTests.cs b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptWaitForDeviceTests.cs index bc9cd1cac..be5752142 100644 --- a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptWaitForDeviceTests.cs +++ b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptWaitForDeviceTests.cs @@ -8,7 +8,7 @@ namespace PuppeteerSharp.Tests.DeviceRequestPromptTests; public class DeviceRequestPromptWaitForDeviceTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should return first matching device")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should return first matching device")] public async Task ShouldReturnFirstMatchingDevice() { var client = new MockCDPSession(); @@ -66,7 +66,7 @@ public async Task ShouldReturnFirstMatchingDevice() Assert.That(device.Name, Is.EqualTo("My Device 1")); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should return first matching device from already known devices")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should return first matching device from already known devices")] public async Task ShouldReturnFirstMatchingDeviceFromAlreadyKnownDevices() { var client = new MockCDPSession(); @@ -86,7 +86,7 @@ public async Task ShouldReturnFirstMatchingDeviceFromAlreadyKnownDevices() await prompt.WaitForDeviceAsync(device => device.Name == "My Device 1"); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should return device in the devices list")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should return device in the devices list")] public async Task ShouldReturnDeviceInTheDevicesList() { var client = new MockCDPSession(); @@ -127,7 +127,7 @@ public async Task ShouldReturnDeviceInTheDevicesList() Assert.That(prompt.Devices.ToArray(), Does.Contain(device)); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should respect timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should respect timeout")] public void ShouldRespectTimeout() { var client = new MockCDPSession(); @@ -142,7 +142,7 @@ public void ShouldRespectTimeout() Assert.ThrowsAsync(() => prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitForOptions(1))); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should respect default timeout when there is no custom timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should respect default timeout when there is no custom timeout")] public void ShouldRespectDefaultTimeoutWhenThereIsNoCustomTimeout() { var client = new MockCDPSession(); @@ -158,7 +158,7 @@ public void ShouldRespectDefaultTimeoutWhenThereIsNoCustomTimeout() Assert.ThrowsAsync(() => prompt.WaitForDeviceAsync(device => device.Name == "My Device 1")); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should prioritize exact timeout over default timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should prioritize exact timeout over default timeout")] public void ShouldPrioritizeExactTimeoutOverDefaultTimeout() { var client = new MockCDPSession(); @@ -174,7 +174,7 @@ public void ShouldPrioritizeExactTimeoutOverDefaultTimeout() Assert.ThrowsAsync(() => prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitForOptions(1))); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should work with no timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should work with no timeout")] public async Task ShouldWorkWithNoTimeout() { var client = new MockCDPSession(); diff --git a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/WaitForDevicePromptTests.cs b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/WaitForDevicePromptTests.cs index 59267e2e8..f034e60c5 100644 --- a/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/WaitForDevicePromptTests.cs +++ b/lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/WaitForDevicePromptTests.cs @@ -54,7 +54,7 @@ await devicePrompt.WaitForDeviceAsync(device => device.Name.Contains("My Device" #endregion } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should return prompt")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should return prompt")] public async Task ShouldReturnPrompt() { var client = new MockCDPSession(); @@ -75,7 +75,7 @@ public async Task ShouldReturnPrompt() await promptTask; } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should respect timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should respect timeout")] public void ShouldRespectTimeout() { var client = new MockCDPSession(); @@ -84,7 +84,7 @@ public void ShouldRespectTimeout() Assert.ThrowsAsync(() => manager.WaitForDevicePromptAsync(new WaitForOptions(1))); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should respect default timeout when there is no custom timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should respect default timeout when there is no custom timeout")] public void ShouldRespectDefaultTimeoutWhenThereIsNoCustomTimeout() { var client = new MockCDPSession(); @@ -94,7 +94,7 @@ public void ShouldRespectDefaultTimeoutWhenThereIsNoCustomTimeout() Assert.ThrowsAsync(() => manager.WaitForDevicePromptAsync()); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should prioritize exact timeout over default timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should prioritize exact timeout over default timeout")] public void ShouldPrioritizeExactTimeoutOverDefaultTimeout() { var client = new MockCDPSession(); @@ -104,7 +104,7 @@ public void ShouldPrioritizeExactTimeoutOverDefaultTimeout() Assert.ThrowsAsync(() => manager.WaitForDevicePromptAsync(new WaitForOptions(1))); } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should work with no timeout")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should work with no timeout")] public async Task ShouldWorkWithNoTimeout() { var client = new MockCDPSession(); @@ -125,7 +125,7 @@ public async Task ShouldWorkWithNoTimeout() await promptTask; } - [Test, Retry(2), PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should return the same prompt when there are many watchdogs simultaneously")] + [Test, PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should return the same prompt when there are many watchdogs simultaneously")] public async Task ShouldReturnTheSamePromptWhenThereAreManyWatchdogsSimultaneously() { var client = new MockCDPSession(); diff --git a/lib/PuppeteerSharp.Tests/DevtoolsTests/DevtoolsTests.cs b/lib/PuppeteerSharp.Tests/DevtoolsTests/DevtoolsTests.cs index 292b2a5da..608e45853 100644 --- a/lib/PuppeteerSharp.Tests/DevtoolsTests/DevtoolsTests.cs +++ b/lib/PuppeteerSharp.Tests/DevtoolsTests/DevtoolsTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.DevtoolsTests { public class DevtoolsTests : PuppeteerBaseTest { - [Test, Retry(2), PuppeteerTest("devtools.spec", "DevTools", "should open devtools when \"devtools: true\" option is given")] + [Test, PuppeteerTest("devtools.spec", "DevTools", "should open devtools when \"devtools: true\" option is given")] public async Task ShouldOpenDevtoolsWhenDevtoolsTrueOptionIsGiven() { var headfulOptions = TestConstants.DefaultBrowserOptions(); @@ -19,7 +19,7 @@ await Task.WhenAll( browser.WaitForTargetAsync(target => target.Url.Contains("devtools://"))); } - [Test, Retry(2), PuppeteerTest("devtools.spec", "DevTools", "should expose DevTools as a page")] + [Test, PuppeteerTest("devtools.spec", "DevTools", "should expose DevTools as a page")] public async Task ShouldExposeDevToolsAsAPage() { var headfulOptions = TestConstants.DefaultBrowserOptions(); @@ -61,7 +61,7 @@ public async Task TargetPageShouldReturnADevToolsPageIfCustomIsPageTargetIsProvi Assert.That(pages, Does.Contain(page)); } - [Test, Retry(2), PuppeteerTest("devtools.spec", "DevTools", "target.page() should return Page when calling asPage on DevTools target")] + [Test, PuppeteerTest("devtools.spec", "DevTools", "target.page() should return Page when calling asPage on DevTools target")] public async Task TargetPageShouldReturnADevToolsPageIfAsPageIsUsed() { var headfulOptions = TestConstants.DefaultBrowserOptions(); diff --git a/lib/PuppeteerSharp.Tests/DialogTests/DialogTests.cs b/lib/PuppeteerSharp.Tests/DialogTests/DialogTests.cs index 859643271..8c1c9a2b9 100644 --- a/lib/PuppeteerSharp.Tests/DialogTests/DialogTests.cs +++ b/lib/PuppeteerSharp.Tests/DialogTests/DialogTests.cs @@ -10,7 +10,7 @@ public DialogTests() : base() { } - [Test, Retry(2), PuppeteerTest("dialog.spec", "Page.Events.Dialog", "should fire")] + [Test, PuppeteerTest("dialog.spec", "Page.Events.Dialog", "should fire")] public async Task ShouldFire() { Page.Dialog += async (_, e) => @@ -25,7 +25,7 @@ public async Task ShouldFire() await Page.EvaluateExpressionAsync("alert('yo');"); } - [Test, Retry(2), PuppeteerTest("dialog.spec", "Page.Events.Dialog", "should allow accepting prompts")] + [Test, PuppeteerTest("dialog.spec", "Page.Events.Dialog", "should allow accepting prompts")] public async Task ShouldAllowAcceptingPrompts() { Page.Dialog += async (_, e) => @@ -41,7 +41,7 @@ public async Task ShouldAllowAcceptingPrompts() Assert.That(result, Is.EqualTo("answer!")); } - [Test, Retry(2), PuppeteerTest("dialog.spec", "Page.Events.Dialog", "should dismiss the prompt")] + [Test, PuppeteerTest("dialog.spec", "Page.Events.Dialog", "should dismiss the prompt")] public async Task ShouldDismissThePrompt() { Page.Dialog += async (_, e) => diff --git a/lib/PuppeteerSharp.Tests/DragAndDropTests/DragAndDropTests.cs b/lib/PuppeteerSharp.Tests/DragAndDropTests/DragAndDropTests.cs index cddf6f754..825dbd8bb 100644 --- a/lib/PuppeteerSharp.Tests/DragAndDropTests/DragAndDropTests.cs +++ b/lib/PuppeteerSharp.Tests/DragAndDropTests/DragAndDropTests.cs @@ -10,7 +10,7 @@ public DragAndDropTests() : base() { } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Drag n' Drop", "should drop")] + [Test, PuppeteerTest("drag-and-drop.spec", "Drag n' Drop", "should drop")] public async Task ShouldDrop() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); @@ -22,7 +22,7 @@ public async Task ShouldDrop() Assert.That(await GetDragStateAsync(), Is.EqualTo(1234)); } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Drag n' Drop", "should drop using mouse")] + [Test, PuppeteerTest("drag-and-drop.spec", "Drag n' Drop", "should drop using mouse")] public async Task ShouldDropUsingMouse() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); @@ -41,7 +41,7 @@ public async Task ShouldDropUsingMouse() Assert.That(await GetDragStateAsync(), Is.EqualTo(1234)); } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Drag n' Drop", "should drag and drop")] + [Test, PuppeteerTest("drag-and-drop.spec", "Drag n' Drop", "should drag and drop")] public async Task ShouldDragAndDrop() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); diff --git a/lib/PuppeteerSharp.Tests/DragAndDropTests/LegacyDragAndDropTests.cs b/lib/PuppeteerSharp.Tests/DragAndDropTests/LegacyDragAndDropTests.cs index 7b8633010..eb747a8b6 100644 --- a/lib/PuppeteerSharp.Tests/DragAndDropTests/LegacyDragAndDropTests.cs +++ b/lib/PuppeteerSharp.Tests/DragAndDropTests/LegacyDragAndDropTests.cs @@ -11,7 +11,7 @@ public LegacyDragAndDropTests() : base() { } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "should emit a dragIntercepted event when dragged")] + [Test, PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "should emit a dragIntercepted event when dragged")] public async Task ShouldEmitADragInterceptedEventWhenDragged() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); @@ -25,7 +25,7 @@ public async Task ShouldEmitADragInterceptedEventWhenDragged() Assert.That(await GetDragStateAsync(), Is.EqualTo(1)); } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "should emit a dragEnter")] + [Test, PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "should emit a dragEnter")] public async Task ShouldEmitADragEnter() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); @@ -40,7 +40,7 @@ public async Task ShouldEmitADragEnter() Assert.That(await GetDragStateAsync(), Is.EqualTo(12)); } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "should emit a dragOver event")] + [Test, PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "should emit a dragOver event")] public async Task ShouldEmitADragOver() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); @@ -56,7 +56,7 @@ public async Task ShouldEmitADragOver() Assert.That(await GetDragStateAsync(), Is.EqualTo(123)); } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "can be dropped")] + [Test, PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "can be dropped")] public async Task CanBeDropped() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); @@ -73,7 +73,7 @@ public async Task CanBeDropped() Assert.That(await GetDragStateAsync(), Is.EqualTo(12334)); } - [Test, Retry(2), PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "can be dragged and dropped with a single function")] + [Test, PuppeteerTest("drag-and-drop.spec", "Legacy Drag n' Drop", "can be dragged and dropped with a single function")] public async Task CanBeDraggedAndDroppedWithASingleFunction() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/drag-and-drop.html"); diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/BoundingBoxTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/BoundingBoxTests.cs index dd7cbca95..a17def50e 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/BoundingBoxTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/BoundingBoxTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.ElementHandleTests { public class BoundingBoxTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should work")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should work")] public async Task ShouldWork() { await Page.SetViewportAsync(new ViewPortOptions @@ -21,7 +21,7 @@ await Page.SetViewportAsync(new ViewPortOptions Assert.That(box, Is.EqualTo(new BoundingBox(100, 50, 50, 50))); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should handle nested frames")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should handle nested frames")] public async Task ShouldHandleNestedFrames() { await Page.SetViewportAsync(new ViewPortOptions @@ -45,7 +45,7 @@ await Page.SetViewportAsync(new ViewPortOptions } } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should return null for invisible elements")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should return null for invisible elements")] public async Task ShouldReturnNullForInvisibleElements() { await Page.SetContentAsync("
hi
"); @@ -53,7 +53,7 @@ public async Task ShouldReturnNullForInvisibleElements() Assert.That(await elementHandle.BoundingBoxAsync(), Is.Null); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should force a layout")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should force a layout")] public async Task ShouldForceALayout() { await Page.SetViewportAsync(new ViewPortOptions { Width = 500, Height = 500 }); @@ -64,7 +64,7 @@ public async Task ShouldForceALayout() Assert.That(box, Is.EqualTo(new BoundingBox(8, 8, 100, 200))); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should work with SVG nodes")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boundingBox", "should work with SVG nodes")] public async Task ShouldWorkWithSVGNodes() { await Page.SetContentAsync(@" diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/BoxModelTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/BoxModelTests.cs index 2bc276ef4..e1e5146fb 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/BoxModelTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/BoxModelTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.ElementHandleTests { public class BoxModelTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boxModel", "should work")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boxModel", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.ServerUrl + "/resetcss.html"); @@ -66,7 +66,7 @@ await Page.EvaluateExpressionAsync(@" })); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boxModel", "should return null for invisible elements")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.boxModel", "should return null for invisible elements")] public async Task ShouldReturnNullForInvisibleElements() { await Page.SetContentAsync("
hi
"); diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/ClickTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/ClickTests.cs index 1d2af4552..b930abc80 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/ClickTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/ClickTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.ElementHandleTests { public class ClickTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should work")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -16,7 +16,7 @@ public async Task ShouldWork() Assert.That(await Page.EvaluateExpressionAsync("result"), Is.EqualTo("Clicked")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should work for Shadow DOM v1")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should work for Shadow DOM v1")] public async Task ShouldWorkForShadowDomV1() { await Page.GoToAsync(TestConstants.ServerUrl + "/shadow.html"); @@ -25,7 +25,7 @@ public async Task ShouldWorkForShadowDomV1() Assert.That(await Page.EvaluateExpressionAsync("clicked"), Is.True); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should not work for TextNodes")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should not work for TextNodes")] public async Task ShouldNotWorkForTextNodes() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -36,7 +36,7 @@ public async Task ShouldNotWorkForTextNodes() Assert.That(exception.Message, Does.Contain("is not of type HTMLElement")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for detached nodes")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for detached nodes")] public async Task ShouldThrowForDetachedNodes() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -46,7 +46,7 @@ public async Task ShouldThrowForDetachedNodes() Assert.That(exception.Message, Is.EqualTo("Node is detached from document")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for hidden nodes")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for hidden nodes")] public async Task ShouldThrowForHiddenNodes() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -56,7 +56,7 @@ public async Task ShouldThrowForHiddenNodes() Assert.That(exception.Message, Is.EqualTo("Node is either not clickable or not an Element")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for recursively hidden nodes")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for recursively hidden nodes")] public async Task ShouldThrowForRecursivelyHiddenNodes() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/button.html"); @@ -66,7 +66,7 @@ public async Task ShouldThrowForRecursivelyHiddenNodes() Assert.That(exception.Message, Is.EqualTo("Node is either not clickable or not an Element")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for
elements")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should throw for
elements")] public async Task ShouldThrowForBrElements() { await Page.SetContentAsync("hello
goodbye"); @@ -75,7 +75,7 @@ public async Task ShouldThrowForBrElements() Assert.That(exception.Message, Is.EqualTo("Node is either not clickable or not an Element")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should return Point data")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.click", "should return Point data")] public async Task ShouldReturnPointData() { var clicks = new List(); diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/ContentFrameTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/ContentFrameTests.cs index 9fc36a2c6..daae9e09c 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/ContentFrameTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/ContentFrameTests.cs @@ -14,7 +14,7 @@ public ContentFrameTests() : base() _headfulOptions.Headless = false; } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.contentFrame", "should work")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.contentFrame", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.EmptyPage); diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/CustomQueriesTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/CustomQueriesTests.cs index 45b75ccfa..64711e56c 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/CustomQueriesTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/CustomQueriesTests.cs @@ -18,7 +18,7 @@ public void ClearCustomQueryHandlers() Browser.ClearCustomQueryHandlers(); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should register and unregister")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should register and unregister")] public async Task ShouldRegisterAndUnregister() { await Page.SetContentAsync("
"); @@ -52,7 +52,7 @@ public async Task ShouldRegisterAndUnregister() Assert.That(handlerNamesAfterUnregistering, Does.Not.Contain("getById")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should throw with invalid query names")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should throw with invalid query names")] public void ShouldThrowWithInvalidQueryNames() { var ex = Assert.Throws(() => Browser.RegisterCustomQueryHandler("1/2/3", new CustomQueryHandler @@ -63,7 +63,7 @@ public void ShouldThrowWithInvalidQueryNames() Assert.That(ex.Message, Is.EqualTo("Custom query handler names may only contain [a-zA-Z]")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should work for multiple elements")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should work for multiple elements")] public async Task ShouldWorkForMultipleElements() { await Page.SetContentAsync("
Foo2
"); @@ -81,7 +81,7 @@ public async Task ShouldWorkForMultipleElements() Assert.That(classNames.ToArray(), Is.EqualTo(new[] { "foo", "foo baz" })); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should eval correctly")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should eval correctly")] public async Task ShouldEvalCorrectly() { await Page.SetContentAsync("
Foo2
"); @@ -97,7 +97,7 @@ public async Task ShouldEvalCorrectly() Assert.That(elements, Is.EqualTo(2)); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should wait correctly with waitForSelector")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should wait correctly with waitForSelector")] public async Task ShouldWaitCorrectlyWithWaitForSelector() { Browser.RegisterCustomQueryHandler("getByClass", new CustomQueryHandler @@ -114,7 +114,7 @@ public async Task ShouldWaitCorrectlyWithWaitForSelector() Assert.That(element, Is.Not.Null); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should wait correctly with waitForSelector on an element")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should wait correctly with waitForSelector on an element")] public async Task ShouldWaitCorrectlyWithWaitForSelectorOnAnElement() { Browser.RegisterCustomQueryHandler("getByClass", new CustomQueryHandler @@ -138,7 +138,7 @@ public async Task ShouldWaitCorrectlyWithWaitForSelectorOnAnElement() Assert.That(await element.EvaluateFunctionAsync("(el) => el.innerText"), Is.EqualTo("bar1")); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should work when both queryOne and queryAll are registered")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should work when both queryOne and queryAll are registered")] public async Task ShouldWorkWhenBothQueryOneAndQueryAllAreRegistered() { await Page.SetContentAsync("
Foo2
"); @@ -155,7 +155,7 @@ public async Task ShouldWorkWhenBothQueryOneAndQueryAllAreRegistered() Assert.That(elements, Has.Length.EqualTo(3)); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should eval when both queryOne and queryAll are registered")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs Custom queries", "should eval when both queryOne and queryAll are registered")] public async Task ShouldEvalWhenBothQueryOneAndQueryAllAreRegistered() { await Page.SetContentAsync("
text
content
"); diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/HoverTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/HoverTests.cs index 5a373feae..50d7eafef 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/HoverTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/HoverTests.cs @@ -10,7 +10,7 @@ public HoverTests() : base() { } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.hover", "should work")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.hover", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.ServerUrl + "/input/scrollable.html"); diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/IsIntersectingViewportTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/IsIntersectingViewportTests.cs index c10724f7d..cea2f2341 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/IsIntersectingViewportTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/IsIntersectingViewportTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.ElementHandleTests { public class IsIntersectingViewportTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.ServerUrl + "/offscreenbuttons.html"); @@ -19,7 +19,7 @@ public async Task ShouldWork() } } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work with threshold")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work with threshold")] public async Task ShouldWorkWithThreshold() { await Page.GoToAsync(TestConstants.ServerUrl + "/offscreenbuttons.html"); @@ -27,7 +27,7 @@ public async Task ShouldWorkWithThreshold() Assert.That(await button.IsIntersectingViewportAsync(0.001m), Is.False); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work with threshold of 1")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work with threshold of 1")] public async Task ShouldWorkWithThresholdOf1() { await Page.GoToAsync(TestConstants.ServerUrl + "/offscreenbuttons.html"); @@ -35,7 +35,7 @@ public async Task ShouldWorkWithThresholdOf1() Assert.That(await button.IsIntersectingViewportAsync(1), Is.True); } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work with svg elements")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isIntersectingViewport", "should work with svg elements")] public async Task ShouldWorkWithSvgElements() { await Page.GoToAsync(TestConstants.ServerUrl + "/inline-svg.html"); diff --git a/lib/PuppeteerSharp.Tests/ElementHandleTests/IsVisibleIsHiddenTests.cs b/lib/PuppeteerSharp.Tests/ElementHandleTests/IsVisibleIsHiddenTests.cs index a61ca3669..c6b730bdc 100644 --- a/lib/PuppeteerSharp.Tests/ElementHandleTests/IsVisibleIsHiddenTests.cs +++ b/lib/PuppeteerSharp.Tests/ElementHandleTests/IsVisibleIsHiddenTests.cs @@ -10,7 +10,7 @@ public IsVisibleIsHiddenTests() : base() { } - [Test, Retry(2), PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isVisible and ElementHandle.isHidden", "should work")] + [Test, PuppeteerTest("elementhandle.spec", "ElementHandle specs ElementHandle.isVisible and ElementHandle.isHidden", "should work")] public async Task ShouldWork() { await Page.SetContentAsync("
text
"); diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaFeaturesTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaFeaturesTests.cs index d7adf3722..0b39afd25 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaFeaturesTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaFeaturesTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.EmulationTests { public class EmulateMediaFeaturesAsyncTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulateMediaFeatures", "should work")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulateMediaFeatures", "should work")] public async Task ShouldWork() { await Page.EmulateMediaFeaturesAsync(new MediaFeatureValue[] { diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaTypeTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaTypeTests.cs index 577aa281c..56c59fd32 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaTypeTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateMediaTypeTests.cs @@ -11,7 +11,7 @@ public EmulateMediaTypeTests() : base() { } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulateMediaType", "should work")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulateMediaType", "should work")] public async Task ShouldWork() { Assert.That(await Page.EvaluateExpressionAsync("matchMedia('screen').matches"), Is.True); diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTests.cs index 6e3938b99..7fcd2bd46 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.EmulationTests { public class EmulateTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulate", "should work")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulate", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.ServerUrl + "/mobile.html"); @@ -16,7 +16,7 @@ public async Task ShouldWork() Assert.That(await Page.EvaluateExpressionAsync("navigator.userAgent"), Does.Contain("iPhone")); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulate", "should support clicking")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulate", "should support clicking")] public async Task ShouldSupportClicking() { await Page.EmulateAsync(TestConstants.IPhone); diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTimezoneTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTimezoneTests.cs index d3bbca14a..5abc1922e 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTimezoneTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/EmulateTimezoneTests.cs @@ -10,7 +10,7 @@ public EmulateTimezoneTests() : base() { } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulateTimezone", "should work")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulateTimezone", "should work")] public async Task ShouldWork() { await Page.EvaluateExpressionAsync("globalThis.date = new Date(1479579154987);"); @@ -31,7 +31,7 @@ public async Task ShouldWork() await Page.EvaluateExpressionAsync("date.toString()"), Is.EqualTo("Sat Nov 19 2016 19:12:34 GMT+0100 (Central European Standard Time)")); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulateTimezone", "should throw for invalid timezone IDs")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulateTimezone", "should throw for invalid timezone IDs")] public void ShouldThrowForInvalidTimezoneId() { var exception = Assert.ThrowsAsync( diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateCPUThrottlingTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateCPUThrottlingTests.cs index ffb372337..c5eee56ad 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateCPUThrottlingTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateCPUThrottlingTests.cs @@ -10,7 +10,7 @@ public PageEmulateCPUThrottlingTests() : base() { } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulateCPUThrottling", "should change the CPU throttling rate successfully")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulateCPUThrottling", "should change the CPU throttling rate successfully")] public async Task ShouldChangeTheCPUThrottlingRateSuccessfully() { await Page.EmulateCPUThrottlingAsync(100); diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateNetworkConditionsTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateNetworkConditionsTests.cs index 6cf7bb1ef..378676121 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateNetworkConditionsTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateNetworkConditionsTests.cs @@ -10,7 +10,7 @@ public PageEmulateNetworkConditionsTests() : base() { } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulateNetworkConditions", "should change navigator.connection.effectiveType")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulateNetworkConditions", "should change navigator.connection.effectiveType")] public async Task ShouldChangeNavigatorConnectionEffectiveType() { var fast4G = Puppeteer.NetworkConditions[NetworkConditions.Fast4G]; diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateVisionDeficiencyTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateVisionDeficiencyTests.cs index 824e07a6b..904e7fc4b 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateVisionDeficiencyTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/PageEmulateVisionDeficiencyTests.cs @@ -10,7 +10,7 @@ public PageEmulateVisionDeficiencyTests() : base() { } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.emulateVisionDeficiency", "should work")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.emulateVisionDeficiency", "should work")] public async Task ShouldWork() { await Page.SetViewportAsync(new ViewPortOptions { Width = 500, Height = 500 }); diff --git a/lib/PuppeteerSharp.Tests/EmulationTests/PageViewPortTests.cs b/lib/PuppeteerSharp.Tests/EmulationTests/PageViewPortTests.cs index e66835569..e2dfc59df 100644 --- a/lib/PuppeteerSharp.Tests/EmulationTests/PageViewPortTests.cs +++ b/lib/PuppeteerSharp.Tests/EmulationTests/PageViewPortTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.EmulationTests { public class PageViewPortTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should get the proper viewport size")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should get the proper viewport size")] public async Task ShouldGetTheProperViewPortSize() { Assert.That(Page.Viewport.Width, Is.EqualTo(800)); @@ -18,7 +18,7 @@ public async Task ShouldGetTheProperViewPortSize() Assert.That(Page.Viewport.Height, Is.EqualTo(456)); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should support mobile emulation")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should support mobile emulation")] public async Task ShouldSupportMobileEmulation() { await Page.GoToAsync(TestConstants.ServerUrl + "/mobile.html"); @@ -30,7 +30,7 @@ public async Task ShouldSupportMobileEmulation() Assert.That(await Page.EvaluateExpressionAsync("window.innerWidth"), Is.EqualTo(400)); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should support touch emulation")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should support touch emulation")] public async Task ShouldSupportTouchEmulation() { const string dispatchTouch = @" @@ -58,7 +58,7 @@ function dispatchTouch() { Assert.That(await Page.EvaluateExpressionAsync("'ontouchstart' in window"), Is.False); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should be detectable by Modernizr")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should be detectable by Modernizr")] public async Task ShouldBeDetectableByModernizr() { await Page.GoToAsync(TestConstants.ServerUrl + "/detect-touch.html"); @@ -68,7 +68,7 @@ public async Task ShouldBeDetectableByModernizr() Assert.That(await Page.EvaluateExpressionAsync("document.body.textContent.trim()"), Is.EqualTo("YES")); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should detect touch when applying viewport with touches")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should detect touch when applying viewport with touches")] public async Task ShouldDetectTouchWhenApplyingViewportWithTouches() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -85,7 +85,7 @@ await Page.AddScriptTagAsync(new AddTagOptions Assert.That(await Page.EvaluateFunctionAsync("() => globalThis.Modernizr.touchevents"), Is.True); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should support landscape emulation")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should support landscape emulation")] public async Task ShouldSupportLandscapeEmulation() { await Page.GoToAsync(TestConstants.ServerUrl + "/mobile.html"); @@ -96,7 +96,7 @@ public async Task ShouldSupportLandscapeEmulation() Assert.That(await Page.EvaluateExpressionAsync("screen.orientation.type"), Is.EqualTo("portrait-primary")); } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should update media queries when resoltion changes")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should update media queries when resoltion changes")] public async Task ShouldUpdateMediaQueriesWhenResolutionChanges() { foreach (var dpr in new[] { 1, 2, 3 }) @@ -110,7 +110,7 @@ public async Task ShouldUpdateMediaQueriesWhenResolutionChanges() } } - [Test, Retry(2), PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should load correct pictures when emulation dpr")] + [Test, PuppeteerTest("emulation.spec", "Emulation Page.viewport", "should load correct pictures when emulation dpr")] public async Task ShouldLoadCorrectPicturesWhenEmulationDpr() { foreach (var dpr in new[] { 1, 2, 3 }) diff --git a/lib/PuppeteerSharp.Tests/EvaluationTests/FrameEvaluateTests.cs b/lib/PuppeteerSharp.Tests/EvaluationTests/FrameEvaluateTests.cs index 66515fe79..a9a793103 100644 --- a/lib/PuppeteerSharp.Tests/EvaluationTests/FrameEvaluateTests.cs +++ b/lib/PuppeteerSharp.Tests/EvaluationTests/FrameEvaluateTests.cs @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.EvaluationTests { public class FrameEvaluateTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Frame.evaluate", "should have different execution contexts")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Frame.evaluate", "should have different execution contexts")] public async Task ShouldHaveDifferentExecutionContexts() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -24,7 +24,7 @@ public async Task ShouldHaveDifferentExecutionContexts() Assert.That(await frame2.EvaluateExpressionAsync("window.FOO"), Is.EqualTo("bar")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Frame.evaluate", "should have correct execution contexts")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Frame.evaluate", "should have correct execution contexts")] public async Task ShouldHaveCorrectExecutionContexts() { await Page.GoToAsync(TestConstants.ServerUrl + "/frames/one-frame.html"); @@ -37,7 +37,7 @@ public async Task ShouldHaveCorrectExecutionContexts() Assert.That(await frame2.EvaluateExpressionAsync("document.body.textContent.trim()"), Is.EqualTo("Hi, I'm frame")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Frame.evaluate", "should execute after cross-site navigation")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Frame.evaluate", "should execute after cross-site navigation")] public async Task ShouldExecuteAfterCrossSiteNavigation() { await Page.GoToAsync(TestConstants.EmptyPage); diff --git a/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateOnNewDocumentTests.cs b/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateOnNewDocumentTests.cs index b264372d5..f4ecb3253 100644 --- a/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateOnNewDocumentTests.cs +++ b/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateOnNewDocumentTests.cs @@ -10,7 +10,7 @@ public PageEvaluateOnNewDocumentTests() : base() { } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluateOnNewDocument", "should evaluate before anything else on the page")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluateOnNewDocument", "should evaluate before anything else on the page")] public async Task ShouldEvaluateBeforeAnythingElseOnThePage() { await Page.EvaluateFunctionOnNewDocumentAsync(@"function(){ @@ -20,7 +20,7 @@ await Page.EvaluateFunctionOnNewDocumentAsync(@"function(){ Assert.That(await Page.EvaluateExpressionAsync("window.result"), Is.EqualTo(123)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluateOnNewDocument", "should work with CSP")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluateOnNewDocument", "should work with CSP")] public async Task ShouldWorkWithCSP() { Server.SetCSP("/empty.html", "script-src " + TestConstants.ServerUrl); diff --git a/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateTests.cs b/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateTests.cs index cde74e8d7..a00848908 100644 --- a/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateTests.cs +++ b/lib/PuppeteerSharp.Tests/EvaluationTests/PageEvaluateTests.cs @@ -26,7 +26,7 @@ public async Task BasicIntFunctionEvaluationTest(string script, object expected) Assert.That(result, Is.EqualTo(expected)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer BigInt")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer BigInt")] public async Task ShouldTransferBigInt() { var result = await Page.EvaluateFunctionAsync("a => a", new BigInteger(42)); @@ -49,43 +49,43 @@ public async Task BasicTransferTest(object transferObject) Assert.That(result, Is.EqualTo(transferObject)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer arrays")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer arrays")] public async Task ShouldTransferArrays() { var result = await Page.EvaluateFunctionAsync("a => a", new int[] { 1, 2, 3 }); Assert.That(result, Is.EqualTo(new int[] { 1, 2, 3 })); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer arrays as arrays, not objects")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer arrays as arrays, not objects")] public async Task ShouldTransferArraysAsArraysNotObjects() { var result = await Page.EvaluateFunctionAsync("a => Array.isArray(a)", new int[] { 1, 2, 3 }); Assert.That(result, Is.True); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should modify global environment")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should modify global environment")] public async Task ShouldModifyGlobalEnvironment() { await Page.EvaluateFunctionAsync("() => window.globalVar = 123"); Assert.That(await Page.EvaluateFunctionAsync("() => window.globalVar"), Is.EqualTo(123)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should evaluate in the page context")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should evaluate in the page context")] public async Task ShouldEvaluateInThePageContext() { await Page.GoToAsync(TestConstants.ServerUrl + "/global-var.html"); Assert.That(await Page.EvaluateFunctionAsync("() => window.globalVar"), Is.EqualTo(123)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return undefined for objects with symbols")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return undefined for objects with symbols")] public async Task ShouldReturnUndefinedForObjectsWithSymbols() => Assert.That(await Page.EvaluateFunctionAsync("() => [Symbol('foo4')]"), Is.Null); - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should work with unicode chars")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should work with unicode chars")] public async Task ShouldWorkWithUnicodeChars() => Assert.That(await Page.EvaluateFunctionAsync("a => a['中文字符']", new Dictionary { ["中文字符"] = 42 }), Is.EqualTo(42)); - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw when evaluation triggers reload")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw when evaluation triggers reload")] public void ShouldThrowWhenEvaluationTriggersReload() { var exception = Assert.ThrowsAsync(() => @@ -99,7 +99,7 @@ public void ShouldThrowWhenEvaluationTriggersReload() Assert.That(exception.Message, Does.Contain("Protocol error")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should work right after framenavigated")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should work right after framenavigated")] public async Task ShouldWorkRightAfterFrameNavigated() { Task frameEvaluation = null; @@ -113,7 +113,7 @@ public async Task ShouldWorkRightAfterFrameNavigated() Assert.That(await frameEvaluation, Is.EqualTo(42)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should work from-inside an exposed function")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should work from-inside an exposed function")] public async Task ShouldWorkFromInsideAnExposedFunction() { await Page.ExposeFunctionAsync("callController", async (int a, int b) => @@ -126,7 +126,7 @@ await Page.ExposeFunctionAsync("callController", async (int a, int b) => Assert.That(result, Is.EqualTo(27)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should reject promise with exception")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should reject promise with exception")] public void ShouldRejectPromiseWithExeption() { var exception = Assert.ThrowsAsync(() => @@ -137,7 +137,7 @@ public void ShouldRejectPromiseWithExeption() Assert.That(exception.Message, Does.Contain("not_existing_object")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should support thrown strings as error messages")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should support thrown strings as error messages")] public void ShouldSupportThrownStringsAsErrorMessages() { var exception = Assert.ThrowsAsync( @@ -145,7 +145,7 @@ public void ShouldSupportThrownStringsAsErrorMessages() Assert.That(exception.Message, Does.Contain("qwerty")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should support thrown numbers as error messages")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should support thrown numbers as error messages")] public void ShouldSupportThrownNumbersAsErrorMessages() { var exception = Assert.ThrowsAsync( @@ -153,7 +153,7 @@ public void ShouldSupportThrownNumbersAsErrorMessages() Assert.That(exception.Message, Does.Contain("100500")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return complex objects")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return complex objects")] public async Task ShouldReturnComplexObjects() { dynamic obj = new @@ -164,7 +164,7 @@ public async Task ShouldReturnComplexObjects() Assert.That("bar!", Is.EqualTo(result.GetProperty("foo").GetString())); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return BigInt")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return BigInt")] public async Task ShouldReturnBigInt() { var result = await Page.EvaluateFunctionAsync("() => BigInt(42)"); @@ -187,7 +187,7 @@ public async Task BasicEvaluationTest(string script, object expected) Assert.That(result, Is.EqualTo(expected)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should accept \"undefined\" as one of multiple parameters")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should accept \"undefined\" as one of multiple parameters")] public async Task ShouldAcceptNullAsOneOfMultipleParameters() { var result = await Page.EvaluateFunctionAsync( @@ -197,11 +197,11 @@ public async Task ShouldAcceptNullAsOneOfMultipleParameters() Assert.That(result, Is.True); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return undefined for non-serializable objects")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should return undefined for non-serializable objects")] public async Task ShouldReturnNullForNonSerializableObjects() => Assert.That(await Page.EvaluateFunctionAsync("() => window"), Is.Null); - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should fail for circular object")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should fail for circular object")] public async Task ShouldFailForCircularObject() { var result = await Page.EvaluateFunctionAsync(@"() => { @@ -214,7 +214,7 @@ public async Task ShouldFailForCircularObject() Assert.That(result, Is.Null); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should be able to throw a tricky error")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should be able to throw a tricky error")] public async Task ShouldBeAbleToThrowATrickyError() { var windowHandle = await Page.EvaluateFunctionHandleAsync("() => window"); @@ -242,7 +242,7 @@ public async Task BasicIntExressionEvaluationTest(string script, object expected Assert.That(result, Is.EqualTo(expected)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should accept element handle as an argument")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should accept element handle as an argument")] public async Task ShouldAcceptElementHandleAsAnArgument() { await Page.SetContentAsync("
42
"); @@ -251,7 +251,7 @@ public async Task ShouldAcceptElementHandleAsAnArgument() Assert.That(text, Is.EqualTo("42")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw if underlying element was disposed")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw if underlying element was disposed")] public async Task ShouldThrowIfUnderlyingElementWasDisposed() { await Page.SetContentAsync("
39
"); @@ -263,7 +263,7 @@ public async Task ShouldThrowIfUnderlyingElementWasDisposed() Assert.That(exception.Message, Does.Contain("JSHandle is disposed")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw if elementHandles are from other frames")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw if elementHandles are from other frames")] public async Task ShouldThrowIfElementHandlesAreFromOtherFrames() { await FrameUtils.AttachFrameAsync(Page, "frame1", TestConstants.EmptyPage); @@ -273,7 +273,7 @@ public async Task ShouldThrowIfElementHandlesAreFromOtherFrames() Assert.That(exception.Message, Does.Contain("JSHandles can be evaluated only in the context they were created")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should simulate a user gesture")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should simulate a user gesture")] public async Task ShouldSimulateAUserGesture() => Assert.That(await Page.EvaluateFunctionAsync(@"() => { document.body.appendChild(document.createTextNode('test')); @@ -281,7 +281,7 @@ public async Task ShouldSimulateAUserGesture() return document.execCommand('copy'); }"), Is.True); - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should not throw an error when evaluation does a navigation")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should not throw an error when evaluation does a navigation")] public async Task ShouldNotThrowAnErrorWhenEvaluationDoesANavigation() { await Page.GoToAsync(TestConstants.ServerUrl + "/one-style.html"); @@ -293,14 +293,14 @@ public async Task ShouldNotThrowAnErrorWhenEvaluationDoesANavigation() Assert.That(result, Is.EqualTo(new[] { 42 })); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer 100Mb of data from page to node.js")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should transfer 100Mb of data from page to node.js")] public async Task ShouldTransfer100MbOfDataFromPage() { var a = await Page.EvaluateFunctionAsync("() => Array(100 * 1024 * 1024 + 1).join('a')"); Assert.That(a, Has.Length.EqualTo(100 * 1024 * 1024)); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw error with detailed information on exception inside promise ")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should throw error with detailed information on exception inside promise ")] public void ShouldThrowErrorWithDetailedInformationOnExceptionInsidePromise() { var exception = Assert.ThrowsAsync(() => @@ -311,7 +311,7 @@ public void ShouldThrowErrorWithDetailedInformationOnExceptionInsidePromise() Assert.That(exception.Message, Does.Contain("Error in promise")); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should properly serialize null fields")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should properly serialize null fields")] public async Task ShouldProperlySerializeNullFields() { var result = await Page.EvaluateFunctionAsync>("() => ({a: null})"); @@ -319,7 +319,7 @@ public async Task ShouldProperlySerializeNullFields() Assert.That(result["a"], Is.Null); } - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should accept element handle as an argument")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.evaluate", "should accept element handle as an argument")] public async Task ShouldAcceptObjectHandleAsAnArgument() { await Page.SetContentAsync("
42
"); diff --git a/lib/PuppeteerSharp.Tests/EvaluationTests/RemoveScriptToEvaluateOnNewDocumentTests.cs b/lib/PuppeteerSharp.Tests/EvaluationTests/RemoveScriptToEvaluateOnNewDocumentTests.cs index e4b71a7e2..9072fc411 100644 --- a/lib/PuppeteerSharp.Tests/EvaluationTests/RemoveScriptToEvaluateOnNewDocumentTests.cs +++ b/lib/PuppeteerSharp.Tests/EvaluationTests/RemoveScriptToEvaluateOnNewDocumentTests.cs @@ -6,7 +6,7 @@ namespace PuppeteerSharp.Tests.EvaluationTests { public class RemoveScriptToEvaluateOnNewDocumentTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("evaluation.spec", "Evaluation specs Page.removeScriptToEvaluateOnNewDocument", "should remove new document script")] + [Test, PuppeteerTest("evaluation.spec", "Evaluation specs Page.removeScriptToEvaluateOnNewDocument", "should remove new document script")] public async Task ShouldRemoveNewDocumentScript() { var id = await Page.EvaluateFunctionOnNewDocumentAsync("() => globalThis.injected = 123"); diff --git a/lib/PuppeteerSharp.Tests/ExtensionsTests/ExtensionsTests.cs b/lib/PuppeteerSharp.Tests/ExtensionsTests/ExtensionsTests.cs index 0d47a7e9f..543c95615 100644 --- a/lib/PuppeteerSharp.Tests/ExtensionsTests/ExtensionsTests.cs +++ b/lib/PuppeteerSharp.Tests/ExtensionsTests/ExtensionsTests.cs @@ -10,7 +10,6 @@ namespace PuppeteerSharp.Tests.ExtensionsTests public class ExtensionsTests : PuppeteerBaseTest { private static readonly string _extensionPath = Path.Combine(AppContext.BaseDirectory, "Assets", "simple-extension"); - private static readonly string _serviceWorkerExtensionPath = Path.Combine(AppContext.BaseDirectory, "Assets", "service-worker-extension"); private static LaunchOptions BrowserWithExtensionOptions() => new() { @@ -22,51 +21,25 @@ public class ExtensionsTests : PuppeteerBaseTest } }; - private static LaunchOptions BrowserWithServiceWorkerExtensionOptions() => new() - { - Headless = false, - Args = new[] - { - $"--disable-extensions-except={_serviceWorkerExtensionPath.Quote()}", - $"--load-extension={_serviceWorkerExtensionPath.Quote()}" - } - }; - - [Test, Retry(2), PuppeteerTest("extensions.spec", "extensions", "background_page target type should be available")] - public async Task BackgroundPageTargetTypeShouldBeAvailable() - { - await using var browserWithExtension = await Puppeteer.LaunchAsync( - BrowserWithExtensionOptions(), - TestConstants.LoggerFactory); - await using (await browserWithExtension.NewPageAsync()) - { - var backgroundPageTarget = await browserWithExtension.WaitForTargetAsync(t => t.Type == TargetType.BackgroundPage); - Assert.That(backgroundPageTarget, Is.Not.Null); - } - } - - [Test, Retry(2), PuppeteerTest("extensions.spec", "extensions", "service_worker target type should be available")] + [Test, PuppeteerTest("extensions.spec", "extensions", "service_worker target type should be available")] public async Task ServiceWorkerTargetTypeShouldBeAvailable() { await using var browserWithExtension = await Puppeteer.LaunchAsync( - BrowserWithServiceWorkerExtensionOptions(), + BrowserWithExtensionOptions(), TestConstants.LoggerFactory); var serviceWorkTarget = await browserWithExtension.WaitForTargetAsync(t => t.Type == TargetType.ServiceWorker); - await using var page = await browserWithExtension.NewPageAsync(); Assert.That(serviceWorkTarget, Is.Not.Null); - } - [Test, Retry(2), PuppeteerTest("extensions.spec", "extensions", "target.page() should return a background_page")] - public async Task TargetPageShouldReturnABackgroundPage() + [Test, PuppeteerTest("extensions.spec", "extensions", "can evaluate in the service worker")] + public async Task CanEvaluateInTheServiceWorker() { await using var browserWithExtension = await Puppeteer.LaunchAsync( BrowserWithExtensionOptions(), TestConstants.LoggerFactory); - var backgroundPageTarget = await browserWithExtension.WaitForTargetAsync(t => t.Type == TargetType.BackgroundPage); - await using var page = await backgroundPageTarget.PageAsync(); - Assert.That(await page.EvaluateFunctionAsync("() => 2 * 3"), Is.EqualTo(6)); - Assert.That(await page.EvaluateFunctionAsync("() => window.MAGIC"), Is.EqualTo(42)); + var serviceWorkerTarget = await browserWithExtension.WaitForTargetAsync(t => t.Type == TargetType.ServiceWorker); + var worker = await serviceWorkerTarget.WorkerAsync(); + Assert.That(await worker.EvaluateFunctionAsync("() => globalThis.MAGIC"), Is.EqualTo(42)); } } } diff --git a/lib/PuppeteerSharp.Tests/FixturesTests/FixturesTests.cs b/lib/PuppeteerSharp.Tests/FixturesTests/FixturesTests.cs index cbd515fff..b09ba799f 100644 --- a/lib/PuppeteerSharp.Tests/FixturesTests/FixturesTests.cs +++ b/lib/PuppeteerSharp.Tests/FixturesTests/FixturesTests.cs @@ -10,7 +10,7 @@ namespace PuppeteerSharp.Tests.FixturesTests { public class FixturesTests : PuppeteerBaseTest { - [Test, Retry(2), PuppeteerTest("fixtures.spec", "Fixtures", "should dump browser process stderr")] + [Test, PuppeteerTest("fixtures.spec", "Fixtures", "should dump browser process stderr")] public void ShouldDumpBrowserProcessStderr() { var success = false; @@ -58,7 +58,7 @@ public async Task ShouldCloseTheBrowserWhenTheConnectedProcessCloses() Assert.That(browser.IsClosed, Is.True); } - [Test, Retry(2), PuppeteerTest("fixtures.spec", "Fixtures", "should close the browser when the node process closes")] + [Test, PuppeteerTest("fixtures.spec", "Fixtures", "should close the browser when the node process closes")] public async Task ShouldCloseTheBrowserWhenTheLaunchedProcessCloses() { var browserClosedTaskWrapper = new TaskCompletionSource(); diff --git a/lib/PuppeteerSharp.Tests/FrameTests/EvaluateHandleTests.cs b/lib/PuppeteerSharp.Tests/FrameTests/EvaluateHandleTests.cs index f537e5ac4..31fb749ef 100644 --- a/lib/PuppeteerSharp.Tests/FrameTests/EvaluateHandleTests.cs +++ b/lib/PuppeteerSharp.Tests/FrameTests/EvaluateHandleTests.cs @@ -10,7 +10,7 @@ public EvaluateHandleTests() : base() { } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame.evaluateHandle", "should work")] + [Test, PuppeteerTest("frame.spec", "Frame.evaluateHandle", "should work")] public async Task ShouldWork() { await Page.GoToAsync(TestConstants.EmptyPage); diff --git a/lib/PuppeteerSharp.Tests/FrameTests/FrameEvaluateTests.cs b/lib/PuppeteerSharp.Tests/FrameTests/FrameEvaluateTests.cs index 429801d91..b088b0794 100644 --- a/lib/PuppeteerSharp.Tests/FrameTests/FrameEvaluateTests.cs +++ b/lib/PuppeteerSharp.Tests/FrameTests/FrameEvaluateTests.cs @@ -10,7 +10,7 @@ public FrameEvaluateTests() : base() { } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame.evaluate", "should throw for detached frames")] + [Test, PuppeteerTest("frame.spec", "Frame.evaluate", "should throw for detached frames")] public async Task ShouldThrowForDetachedFrames() { await FrameUtils.AttachFrameAsync(Page, "frame1", TestConstants.EmptyPage); diff --git a/lib/PuppeteerSharp.Tests/FrameTests/FrameManagementTests.cs b/lib/PuppeteerSharp.Tests/FrameTests/FrameManagementTests.cs index c6a5452c0..f515fa48a 100644 --- a/lib/PuppeteerSharp.Tests/FrameTests/FrameManagementTests.cs +++ b/lib/PuppeteerSharp.Tests/FrameTests/FrameManagementTests.cs @@ -8,7 +8,7 @@ namespace PuppeteerSharp.Tests.FrameTests { public class FrameManagementTests : PuppeteerPageBaseTest { - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame specs Frame Management", "should handle nested frames")] + [Test, PuppeteerTest("frame.spec", "Frame specs Frame Management", "should handle nested frames")] public async Task ShouldHandleNestedFrames() { await Page.GoToAsync(TestConstants.ServerUrl + "/frames/nested-frames.html"); @@ -16,7 +16,7 @@ public async Task ShouldHandleNestedFrames() Is.EqualTo(TestConstants.NestedFramesDumpResult)); } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame specs Frame Management", "should send events when frames are manipulated dynamically")] + [Test, PuppeteerTest("frame.spec", "Frame specs Frame Management", "should send events when frames are manipulated dynamically")] public async Task ShouldSendEventsWhenFramesAreManipulatedDynamically() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -47,7 +47,7 @@ public async Task ShouldSendEventsWhenFramesAreManipulatedDynamically() Assert.That(detachedFrames[0].Detached, Is.True); } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame specs Frame Management", "should send \"framenavigated\" when navigating on anchor URLs")] + [Test, PuppeteerTest("frame.spec", "Frame specs Frame Management", "should send \"framenavigated\" when navigating on anchor URLs")] public async Task ShouldSendFrameNavigatedWhenNavigatingOnAnchorURLs() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -60,7 +60,7 @@ await Task.WhenAll( Assert.That(Page.Url, Is.EqualTo(TestConstants.EmptyPage + "#foo")); } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame specs Frame Management", "should support url fragment")] + [Test, PuppeteerTest("frame.spec", "Frame specs Frame Management", "should support url fragment")] public async Task ShouldReturnUrlFragmentAsPartOfUrl() { await Page.GoToAsync(TestConstants.ServerUrl + "/frames/one-frame-url-fragment.html"); @@ -68,7 +68,7 @@ public async Task ShouldReturnUrlFragmentAsPartOfUrl() Assert.That(Page.FirstChildFrame().Url, Is.EqualTo(TestConstants.ServerUrl + "/frames/frame.html?param=value#fragment")); } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame specs Frame Management", "should persist mainFrame on cross-process navigation")] + [Test, PuppeteerTest("frame.spec", "Frame specs Frame Management", "should persist mainFrame on cross-process navigation")] public async Task ShouldPersistMainFrameOnCrossProcessNavigation() { await Page.GoToAsync(TestConstants.EmptyPage); @@ -77,7 +77,7 @@ public async Task ShouldPersistMainFrameOnCrossProcessNavigation() Assert.That(Page.MainFrame, Is.EqualTo(mainFrame)); } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame specs Frame Management", "should not send attach/detach events for main frame")] + [Test, PuppeteerTest("frame.spec", "Frame specs Frame Management", "should not send attach/detach events for main frame")] public async Task ShouldNotSendAttachDetachEventsForMainFrame() { var hasEvents = false; @@ -88,7 +88,7 @@ public async Task ShouldNotSendAttachDetachEventsForMainFrame() Assert.That(hasEvents, Is.False); } - [Test, Retry(2), PuppeteerTest("frame.spec", "Frame specs Frame Management", "should detach child frames on navigation")] + [Test, PuppeteerTest("frame.spec", "Frame specs Frame Management", "should detach child frames on navigation")] public async Task ShouldDetachChildFramesOnNavigation() { var attachedFrames = new List