Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5941683
Infra: Rename to PlaywrightSharp, add CI/CD, migrate to NUnit
kblok Mar 20, 2026
6fdc4e2
Fix CI: Windows cert, formatting, remove old workflows
kblok Mar 20, 2026
fced984
Fix CI: use whitespace+style format checks instead of full format
kblok Mar 20, 2026
c850050
Remove puppeteer references from test code
kblok Mar 20, 2026
8fd260e
Fix CI: remove Category filter so tests actually run
kblok Mar 20, 2026
6ce1b96
Fix SetUpFixture namespace so test setup actually runs
kblok Mar 20, 2026
8d16990
Fix CI: add driver download step and fix driver path
kblok Mar 20, 2026
97f5f9a
Fix CI: skip stale MSBuild browser install, use npx instead
kblok Mar 21, 2026
1d1634f
Fix CI: remove --with-deps flag unavailable in playwright 1.10.0
kblok Mar 21, 2026
f7411ad
Fix CI: add --no-build to test commands to prevent rebuild
kblok Mar 21, 2026
f67a57d
Fix CI: symlink browser dirs for -next driver revision placeholder
kblok Mar 21, 2026
e85611e
Fix CI: use latest playwright for browser install (old CDN broken)
kblok Mar 21, 2026
1223530
Fix CI: download exact browser builds from CDN directly
kblok Mar 21, 2026
6157b1e
Fix CI: patch driver browsers.json with release revisions
kblok Mar 22, 2026
a93b089
Fix CI: install system deps and handle parallel browser install
kblok Mar 22, 2026
094b72d
Fix CI: install libdbus-glib, suppress MSBuild error parsing
kblok Mar 22, 2026
842fd31
Fix CI: skip Firefox-on-Linux, allow pre-existing test failures
kblok Mar 23, 2026
1d39aa0
Add TestExpectation system to skip known-failing tests and remove con…
kblok Mar 23, 2026
dbd5e93
Merge origin/main into infra-combined, resolve conflicts keeping our …
kblok Mar 24, 2026
4f59e2e
Fix NUnit expectation formatting
kblok Mar 24, 2026
d40a0f9
Fix NUnit style violations
kblok Mar 24, 2026
60cc7b4
Add headless/headful parameter support and missing test expectations
kblok Mar 25, 2026
5559ba0
Fix remaining test expectations: headful and firefox failures
kblok Mar 25, 2026
fe5e890
Fix 43 test-expectation issues: remove prematurely-added expectations…
kblok Mar 27, 2026
f30c531
Revert SimpleServer HTTPS cert change back to .cer format
kblok Mar 27, 2026
b7e6748
Merge origin/main, resolve conflicts keeping our reduced expectations
kblok Mar 27, 2026
c75a8d4
Fix selectors-register script format: use expression not arrow function
kblok Mar 27, 2026
2f0d3d9
Fix BrowserTypeNameShouldWork: CI sets PRODUCT in lowercase
kblok Mar 27, 2026
d175d87
Re-add selectors-register expected failure: implementation bug
kblok Mar 27, 2026
790fd8e
Re-add headful wildcard expected failures
kblok Mar 27, 2026
1185cdb
Fix case-sensitivity issues with PRODUCT env var and other CI failures
kblok Mar 27, 2026
2046ab7
Restore expectations for tests that genuinely fail on CI
kblok Mar 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,79 +42,13 @@
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-wait-for-request.spec.ts] *",
"testIdPattern": "[page-goto.spec.ts] should work when navigating to 404",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-wait-for-load-state.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-wait-for-response.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-goto.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[beforeunload.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[browsertype-basic.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-accessibility.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-basic.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-event-network.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-network-request.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-wait-for-selector-2.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[tap.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[proxy.spec.ts] should exclude patterns",
"testIdPattern": "[page-event-network.spec.ts] Page.Events.RequestFailed",
"platforms": ["darwin", "linux", "win32"],
"parameters": [],
"expectations": ["FAIL"]
Expand Down Expand Up @@ -167,6 +101,18 @@
"parameters": ["firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-autowaiting-basic.spec.ts] should work with noWaitAfter: true",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[beforeunload.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["headful"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[browsercontext-credentials.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
Expand Down Expand Up @@ -305,12 +251,6 @@
"parameters": ["headful"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-autowaiting-basic.spec.ts] should work with noWaitAfter: true",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-add-init-script.spec.ts] should work after a cross origin navigation",
"platforms": ["darwin", "linux", "win32"],
Expand Down
9 changes: 1 addition & 8 deletions src/PlaywrightSharp.Tests/BrowserTypeBasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ public class BrowserTypeBasicTests : PlaywrightSharpBaseTest
[PlaywrightTest("browsertype-basic.spec.ts", "browserType.name should work")]
[Test, Timeout(TestConstants.DefaultTestTimeout)]
public void BrowserTypeNameShouldWork()
=> Assert.That(BrowserType.Name, Is.EqualTo(
TestConstants.Product switch
{
TestConstants.WebkitProduct => "webkit",
TestConstants.FirefoxProduct => "firefox",
TestConstants.ChromiumProduct => "chromium",
_ => null
}));
=> Assert.That(BrowserType.Name, Is.EqualTo(TestConstants.Product.ToLowerInvariant()));
}
}
3 changes: 1 addition & 2 deletions src/PlaywrightSharp.Tests/PageAutoWaitingBasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@ await TaskUtils.WhenAll(
[Test, Timeout(TestConstants.DefaultTestTimeout)]
public async Task ShouldWorkWithNoWaitAfterTrue()
{
var messages = new List<string>();
Server.SetRoute("/empty.html", _ => Task.CompletedTask);

await Page.SetContentAsync($@"<a href=""{TestConstants.EmptyPage}"" target=target>empty.html</a>");
await Page.SetContentAsync($@"<a id=""anchor"" href=""{TestConstants.EmptyPage}"">empty.html</a>");
await Page.ClickAsync("a", noWaitAfter: true);
}

Expand Down
2 changes: 1 addition & 1 deletion src/PlaywrightSharp.Tests/PageBasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public async Task ShouldRejectAllPromisesWhenPageIsClosed()
newPage.CloseAsync()
));
Assert.That(exception, Is.InstanceOf<TargetClosedException>());
Assert.That(exception.Message, Does.Contain("Protocol error"));
Assert.That(exception.Message, Does.Contain("Target closed"));
}

[PlaywrightTest("page-basic.spec.ts", "async stacks should work")]
Expand Down
2 changes: 1 addition & 1 deletion src/PlaywrightSharp.Tests/PageNetworkRequestTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task ShouldReturnHeaders()
{
var response = await Page.GoToAsync(TestConstants.EmptyPage);

string expected = TestConstants.Product switch
string expected = TestConstants.Product.ToUpperInvariant() switch
{
TestConstants.ChromiumProduct => "Chrome",
TestConstants.FirefoxProduct => "Firefox",
Expand Down
44 changes: 37 additions & 7 deletions src/PlaywrightSharp.Tests/ProxyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,54 @@ public async Task ShouldAuthenticate()
[Test, Timeout(TestConstants.DefaultTestTimeout)]
public async Task ShouldExcludePatterns()
{
// FYI: using long and weird domain names to avoid ATT DNS hijacking
// that resolves everything to some weird search results page.
//
// @see https://gist.github.com/CollinChaffin/24f6c9652efb3d6d5ef2f5502720ef00
Server.SetRoute("/target.html", ctx => ctx.Response.WriteAsync("<html><title>Served by the proxy</title></html>"));

var proxy = new Proxy
{
Server = $"localhost:{TestConstants.Port}",
Bypass = "non-existent1.com, .non-existent2.com, .zone",
Bypass = "1.non.existent.domain.for.the.test, 2.non.existent.domain.for.the.test, .another.test",
};

await using var browser = await BrowserType.LaunchAsync(proxy: proxy);

var page = await browser.NewPageAsync();
await page.GoToAsync("http://non-existent.com/target.html");
{
var page = await browser.NewPageAsync();
await page.GoToAsync("http://0.non.existent.domain.for.the.test/target.html");
Assert.That(await page.TitleAsync(), Is.EqualTo("Served by the proxy"));
await page.CloseAsync();
}

Assert.That(await page.TitleAsync(), Is.EqualTo("Served by the proxy"));
{
var page = await browser.NewPageAsync();
var error = Assert.CatchAsync<PlaywrightSharpException>(() => page.GoToAsync("http://1.non.existent.domain.for.the.test/target.html"));
Assert.That(error.Message, Is.Not.Empty);
await page.CloseAsync();
}

Assert.CatchAsync<PlaywrightSharpException>(() => page.GoToAsync("http://non-existent1.com/target.html"));
Assert.CatchAsync<PlaywrightSharpException>(() => page.GoToAsync("http://sub.non-existent2.com/target.html"));
Assert.CatchAsync<PlaywrightSharpException>(() => page.GoToAsync("http://foo.zone/target.html"));
{
var page = await browser.NewPageAsync();
var error = Assert.CatchAsync<PlaywrightSharpException>(() => page.GoToAsync("http://2.non.existent.domain.for.the.test/target.html"));
Assert.That(error.Message, Is.Not.Empty);
await page.CloseAsync();
}

{
var page = await browser.NewPageAsync();
var error = Assert.CatchAsync<PlaywrightSharpException>(() => page.GoToAsync("http://foo.is.the.another.test/target.html"));
Assert.That(error.Message, Is.Not.Empty);
await page.CloseAsync();
}

{
var page = await browser.NewPageAsync();
await page.GoToAsync("http://3.non.existent.domain.for.the.test/target.html");
Assert.That(await page.TitleAsync(), Is.EqualTo("Served by the proxy"));
await page.CloseAsync();
}
}
}
}
3 changes: 0 additions & 3 deletions src/PlaywrightSharp.Tests/SelectorsRegisterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ public async Task ShouldHandleErrors()
Assert.That(exception.Message, Does.Contain("Unknown engine \"neverregister\" while parsing selector neverregister=ignored"));

const string createDummySelector = @"({
create(root, target) {
return target.nodeName;
},
query(root, selector) {
return root.querySelector('dummy');
},
Expand Down
4 changes: 3 additions & 1 deletion src/PlaywrightSharp.Tests/TapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ namespace PlaywrightSharp.Tests
public sealed class TapTests : PlaywrightSharpBrowserContextBaseTest
{
[SetUp]
public async Task TapSetUp()
public new async Task ContextSetUp()
{
Context = await Browser.NewContextAsync(new BrowserContextOptions { HasTouch = true }).ConfigureAwait(false);
Context.DefaultTimeout = TestConstants.DefaultContextTimeout;
Page = await Context.NewPageAsync().ConfigureAwait(false);
}

Expand Down
6 changes: 3 additions & 3 deletions src/PlaywrightSharp.Tests/TestConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ internal static Task<IBrowser> LaunchDefaultHeadful(
public static string FileToUpload => TestUtils.GetWebServerFile("file-to-upload.txt");

internal static ILoggerFactory LoggerFactory { get; set; } = LoggerFactory = new LoggerFactory();
internal static readonly bool IsWebKit = Product.Equals(WebkitProduct);
internal static readonly bool IsFirefox = Product.Equals(FirefoxProduct);
internal static readonly bool IsChromium = Product.Equals(ChromiumProduct);
internal static readonly bool IsWebKit = Product.Equals(WebkitProduct, StringComparison.OrdinalIgnoreCase);
internal static readonly bool IsFirefox = Product.Equals(FirefoxProduct, StringComparison.OrdinalIgnoreCase);
internal static readonly bool IsChromium = Product.Equals(ChromiumProduct, StringComparison.OrdinalIgnoreCase);
internal static readonly bool IsMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
internal static readonly bool IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

Expand Down
Loading