Skip to content

Commit e70bd2c

Browse files
committed
Update playwright to 191.1
1 parent c3625dc commit e70bd2c

File tree

8 files changed

+29
-11
lines changed

8 files changed

+29
-11
lines changed

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
<NewtonsoftJsonBsonVersion>1.0.2</NewtonsoftJsonBsonVersion>
245245
<NewtonsoftJsonVersion>12.0.2</NewtonsoftJsonVersion>
246246
<NSwagApiDescriptionClientVersion>13.0.4</NSwagApiDescriptionClientVersion>
247-
<PlaywrightSharpVersion>0.180.0</PlaywrightSharpVersion>
247+
<PlaywrightSharpVersion>0.191.1</PlaywrightSharpVersion>
248248
<PollyExtensionsHttpVersion>3.0.0</PollyExtensionsHttpVersion>
249249
<PollyVersion>7.1.0</PollyVersion>
250250
<SeleniumSupportVersion>4.0.0-beta1</SeleniumSupportVersion>

eng/helix/content/RunTests/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ static async Task Main(string[] args)
3232
{
3333
keepGoing = await runner.InstallPlaywrightAsync();
3434
}
35+
#else
36+
Console.WriteLine("Playwright install skipped.");
3537
#endif
3638

3739
runner.DisplayContents();

eng/helix/content/RunTests/RunTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
<ItemGroup>
1010
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20158.1" />
11-
<PackageReference Condition=" '$(InstallPlaywright)' == 'true' " Include="PlaywrightSharp" Version="0.180.0" />
11+
<PackageReference Condition=" '$(InstallPlaywright)' == 'true' " Include="PlaywrightSharp" Version="0.191.1" />
1212
</ItemGroup>
1313
</Project>

eng/helix/content/RunTests/TestRunner.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ public bool SetupEnvironment()
4848
var playwrightBrowsers = Path.Combine(helixDir, "ms-playwright");
4949
Console.WriteLine($"Setting PLAYWRIGHT_BROWSERS_PATH: {playwrightBrowsers}");
5050
EnvironmentVariables.Add("PLAYWRIGHT_BROWSERS_PATH", playwrightBrowsers);
51+
#else
52+
Console.WriteLine($"Skipping setting PLAYWRIGHT_BROWSERS_PATH");
5153
#endif
52-
54+
5355
Console.WriteLine($"Creating nuget restore directory: {nugetRestore}");
5456
Directory.CreateDirectory(nugetRestore);
5557

@@ -95,8 +97,9 @@ public async Task<bool> InstallPlaywrightAsync()
9597
{
9698
try
9799
{
98-
Console.WriteLine($"Installing Playwright to {EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]}");
99-
await Playwright.InstallAsync(EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]);
100+
Console.WriteLine($"Installing Playwright to Browsers: {EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]} Driver: {EnvironmentVariables["PLAYWRIGHT_DRIVER_PATH"]}");
101+
await Playwright.InstallAsync(EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"], EnvironmentVariables["PLAYWRIGHT_DRIVER_PATH"]);
102+
DisplayContents(EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]);
100103
return true;
101104
}
102105
catch (Exception e)
@@ -106,7 +109,7 @@ public async Task<bool> InstallPlaywrightAsync()
106109
}
107110
}
108111
#endif
109-
112+
110113
public async Task<bool> InstallAspNetAppIfNeededAsync()
111114
{
112115
try
@@ -170,7 +173,7 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
170173
errorDataReceived: Console.Error.WriteLine,
171174
throwOnError: false,
172175
cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token);
173-
176+
174177
// ';' is the path separator on Windows, and ':' on Unix
175178
Options.Path += OperatingSystem.IsWindows() ? ";" : ":";
176179
Options.Path += $"{Environment.GetEnvironmentVariable("DOTNET_CLI_HOME")}/.dotnet/tools";

eng/helix/content/runtests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ param(
1515
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
1616
$env:DOTNET_MULTILEVEL_LOOKUP = 0
1717
$env:PLAYWRIGHT_BROWSERS_PATH = "$currentDirectory\ms-playwright"
18-
$env:InstallPlaywright = "$InstallPlaywright"
18+
$env:PLAYWRIGHT_DRIVER_PATH = "$currentDirectory\.playwright\win-x64\native\playwright.cmd"
1919

2020
$currentDirectory = Get-Location
2121
$envPath = "$env:PATH;$env:HELIX_CORRELATION_PAYLOAD\node\bin"

eng/helix/content/runtests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
dotnet_sdk_version="$2"
44
dotnet_runtime_version="$3"
5+
installPlaywright="${10}"
56

67
RESET="\033[0m"
78
RED="\033[0;31m"
@@ -25,8 +26,10 @@ export DOTNET_CLI_HOME="$DIR/.home$RANDOM"
2526

2627
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
2728

28-
# Set playwright browser path
29+
# Set playwright stuff
2930
export PLAYWRIGHT_BROWSERS_PATH="$DIR/ms-playwright"
31+
export PLAYWRIGHT_BROWSERS_PATH="$DIR/.playwright\unix\native\playwright.sh"
32+
export InstallPlaywright="$installPlaywright"
3033

3134
RESET="\033[0m"
3235
RED="\033[0;31m"

eng/targets/Helix.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<HelixPreCommand Include="call RunPowershell.cmd mssql\InstallSqlServerLocalDB.ps1 || exit /b 1" />
99
</ItemGroup>
1010

11-
<PropertyGroup Condition="'$(TestDependsOnPlaywright)' == 'true' AND '$(IsWindowsHelixQueue)' == 'true'">
11+
<PropertyGroup Condition="'$(TestDependsOnPlaywright)' == 'true'">
1212
<SkipHelixQueues>Windows.7.Amd64.Open;Windows.81.Amd64.Open</SkipHelixQueues>
1313
</PropertyGroup>
1414

src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''">true</RunTemplateTests>
88
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
9-
<IsWindowsOnlyTest>true</IsWindowsOnlyTest>
109
<SkipHelixArm>true</SkipHelixArm>
1110
<BaseOutputPath />
1211
<OutputPath />
@@ -45,6 +44,8 @@
4544
<Reference Include="Microsoft.Extensions.Configuration" />
4645
<Reference Include="Microsoft.Extensions.Configuration.Json" />
4746
<Reference Include="Anglesharp" />
47+
<Reference Include="PlaywrightSharp" Condition="'$(TargetOsName)' != 'linux-musl'" />
48+
<Reference Include="PlaywrightSharp" ExcludeAssets="build" Condition="'$(TargetOsName)' == 'linux-musl'" />
4849
<ProjectReference Include="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj">
4950
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
5051
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
@@ -57,4 +58,13 @@
5758

5859
<!-- Shared testing infrastructure for running E2E template tests -->
5960
<Import Project="..\TestInfrastructure\PrepareForTest.targets" />
61+
62+
<Target Name="PublishAssets" AfterTargets="Publish">
63+
<ItemGroup>
64+
<_PublishFiles Include="$(OutputPath).playwright\**\*.*" />
65+
</ItemGroup>
66+
<Copy SourceFiles="@(_PublishFiles)" DestinationFolder="$(PublishDir)\.playwright\%(_PublishFiles.RecursiveDir)\" />
67+
</Target>
68+
69+
6070
</Project>

0 commit comments

Comments
 (0)