Skip to content

chore: prepare for v0.180.0 #1106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
env:
PRODUCT: ${{ matrix.product }}
run: |
dotnet build ./src/PlaywrightSharp/PlaywrightSharp.csproj -c Debug -f net5.0
dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj -c Debug -f net5.0 --logger "trx;LogFileName=TestResults.xml"
- name: Run tests (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down Expand Up @@ -111,6 +112,7 @@ jobs:
env:
PRODUCT: CHROMIUM
run: |
dotnet build ./src/PlaywrightSharp/PlaywrightSharp.csproj -c Debug -f netcoreapp3.1
dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj -c Debug -f netcoreapp3.1 --logger "trx;LogFileName=TestResults.xml"
- name: Run tests (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ PlaywrightSharp is a .Net library to automate [Chromium](https://www.chromium.or

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->89.0.4344.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->90.0.4392.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit 14.0 | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->84.0b9<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->85.0b5<!-- GEN:stop --> | ✅ | ✅ | ✅ |

Headless execution is supported for all browsers on all platforms.

Expand Down
4 changes: 2 additions & 2 deletions docfx_project/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ PlaywrightSharp is a .Net library to automate [Chromium](https://www.chromium.or

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->89.0.4344.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->90.0.4392.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit 14.0 | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->84.0b9<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->85.0b5<!-- GEN:stop --> | ✅ | ✅ | ✅ |

Headless execution is supported for all browsers on all platforms.

Expand Down
6 changes: 3 additions & 3 deletions src/Common/PackageInfo.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project>
<PropertyGroup>
<AssemblyVersion>0.170.2</AssemblyVersion>
<AssemblyVersion>0.180.0</AssemblyVersion>
<PackageVersion>$(AssemblyVersion)</PackageVersion>
<DriverVersion>1.8.0-next-1610341252000</DriverVersion>
<DriverVersion>1.8.0</DriverVersion>
<ReleaseVersion>$(AssemblyVersion)</ReleaseVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<Authors>Darío Kondratiuk</Authors>
Expand All @@ -14,4 +14,4 @@
<PackageReleaseNotes><![CDATA[
]]></PackageReleaseNotes>
</PropertyGroup>
</Project>
</Project>
5 changes: 3 additions & 2 deletions src/PlaywrightSharp.Tests/Page/PageSelectOptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public async Task ShouldSelectSingleOptionByMultipleAttributes()
public async Task ShouldNotSelectSingleOptionWhenSomeAttributesDoNotMatch()
{
await Page.GoToAsync(TestConstants.ServerUrl + "/input/select.html");
await Page.SelectOptionAsync("select", new SelectOption { Value = "green", Label = "Brown" });
await Page.EvalOnSelectorAsync("select", "s => s.value = undefined");
await Assert.ThrowsAsync<TimeoutException>(() => Page.SelectOptionAsync("select", new SelectOption { Value = "green", Label = "Brown" }));
Assert.Empty(await Page.EvaluateAsync<string>("() => document.querySelector('select').value"));
}

Expand Down Expand Up @@ -157,7 +158,7 @@ public async Task ShouldThrowWhenElementIsNotASelect()
public async Task ShouldReturnEmptyArrayOnNoMatchedValues()
{
await Page.GoToAsync(TestConstants.ServerUrl + "/input/select.html");
string[] result = await Page.SelectOptionAsync("select", "42", "abc");
string[] result = await Page.SelectOptionAsync("select", Array.Empty<string>());
Assert.Empty(result);
}

Expand Down
2 changes: 1 addition & 1 deletion src/PlaywrightSharp.Tests/PageNetworkIdleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ await Page.SetContentAsync(@"
Page.WaitForEventAsync(PageEvent.Popup),
Page.ClickAsync("#box" + i));

await popup.Page.WaitForLoadStateAsync(LifecycleEvent.DOMContentLoaded);
await popup.Page.WaitForLoadStateAsync(LifecycleEvent.Networkidle);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/PlaywrightSharp.Tests/QuerySelector/TextSelectorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public TextSelectorTests(ITestOutputHelper output) : base(output)
}

[PlaywrightTest("queryselector.spec.js", "text selector", "query")]
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
[Fact(Skip = "We need to update this test", Timeout = TestConstants.DefaultTestTimeout)]
public async Task Query()
{
await Page.SetContentAsync("<div>yo</div><div>ya</div><div>\nye </div>");
Expand All @@ -28,7 +28,7 @@ public async Task Query()
Assert.Equal("<div>\nye </div>", await Page.EvalOnSelectorAsync<string>("text=ye", "e => e.outerHTML"));

await Page.SetContentAsync("<div> ye </div><div>ye</div>");
Assert.Equal("<div>ye</div>", await Page.EvalOnSelectorAsync<string>("text=\"ye\"", "e => e.outerHTML"));
Assert.Equal("<div> ye </div>", await Page.EvalOnSelectorAsync<string>("text=\"ye\"", "e => e.outerHTML"));

await Page.SetContentAsync("<div>yo</div><div>\"ya</div><div> hello world! </div>");
Assert.Equal("<div>\"ya</div>", await Page.EvalOnSelectorAsync<string>("text=\"\\\"ya\"", "e => e.outerHTML"));
Expand Down
2 changes: 1 addition & 1 deletion src/PlaywrightSharp/BrowserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public int DefaultNavigationTimeout

internal List<Worker> ServiceWorkersList { get; } = new List<Worker>();

internal string BrowserName => _initializer.BrowserName;
internal bool IsChromium => _initializer.IsChromium;

internal BrowserContextOptions Options { get; set; }

Expand Down
5 changes: 5 additions & 0 deletions src/PlaywrightSharp/ElementState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,10 @@ public enum ElementState
/// Element not <see cref="Enabled"/>.
/// </summary>
Disabled,

/// <summary>
/// Wait until the element is editable.
/// </summary>
Editable,
}
}
6 changes: 3 additions & 3 deletions src/PlaywrightSharp/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ internal Page(IChannelOwner parent, string guid, PageInitializer initializer) :
ViewportSize = initializer.ViewportSize;
IsClosed = initializer.IsClosed;
Accessibility = new Accesibility(_channel);
Coverage = Context.BrowserName == BrowserType.Chromium ? new ChromiumCoverage(_channel) : null;
Coverage = Context.IsChromium ? new ChromiumCoverage(_channel) : null;
Keyboard = new Keyboard(_channel);
Touchscreen = new Touchscreen(_channel);
Mouse = new Mouse(_channel);
Expand Down Expand Up @@ -790,9 +790,9 @@ public async Task<byte[]> GetPdfAsync(
Margin margin = null,
bool preferCSSPageSize = false)
{
if (Context.BrowserName != BrowserType.Chromium)
if (!Context.IsChromium)
{
throw new NotSupportedException($"{Context.BrowserName} doesn't support this action.");
throw new NotSupportedException($"This browser doesn't support this action.");
}

byte[] result = Convert.FromBase64String(await _channel.GetPdfAsync(
Expand Down
2 changes: 1 addition & 1 deletion src/PlaywrightSharp/Transport/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ private void CreateRemoteObject(string parentGuid, ChannelOwnerType type, string
case ChannelOwnerType.BrowserContext:
var browserContextInitializer = initializer?.ToObject<BrowserContextInitializer>(GetDefaultJsonSerializerOptions());

if (browserContextInitializer.BrowserName == BrowserType.Chromium)
if (browserContextInitializer.IsChromium)
{
result = new ChromiumBrowserContext(parent, guid, browserContextInitializer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ internal class BrowserContextInitializer

public IEnumerable<ChannelBase> CrServiceWorkers { get; set; }

public string BrowserName { get; set; }
public bool IsChromium { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/tools/ApiChecker/IdentifyMissingTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* MIT License
*
*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avodovnik can we remove the trailing space from the doc template? 🤓

* Copyright (c) Microsoft Corporation.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
Expand Down
4 changes: 2 additions & 2 deletions src/tools/ApiChecker/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* MIT License
*
*
* Copyright (c) Microsoft Corporation.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
Expand Down
4 changes: 2 additions & 2 deletions src/tools/ApiChecker/ScaffoldTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* MIT License
*
*
* Copyright (c) Microsoft Corporation.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
Expand Down
2 changes: 1 addition & 1 deletion src/tools/PlaywrightSharp.BuildTasks/DriverDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private static async Task UpdateBrowserVersionsAsync(string basePath, string dri
{
string readmePath = Path.Combine(basePath, "README.md");
string readmeInDocsPath = Path.Combine(basePath, "docfx_project", "documentation", "index.md");
string playwrightVersion = string.Join(".", driverVersion.Split('.')[1].ToCharArray());
string playwrightVersion = driverVersion;
var regex = new Regex("<!-- GEN:(.*?) -->(.*?)<!-- GEN:stop -->", RegexOptions.Compiled);

string readme = await GetUpstreamReadmeAsync(playwrightVersion);
Expand Down