Skip to content

Commit 4b17cd2

Browse files
Sid200026Copilotjsquire
authored
chore(loadtestservice): Onboard Azure.Developer.Playwright SDKs under loadtestservice (Azure#50157)
* chore(loadtestservice): Onboard Azure.Developer.Playwright SDKs under loadtestservice * Update sdk/loadtestservice/Azure.Developer.Playwright.MSTest/samples/README.md Co-authored-by: Copilot <[email protected]> * refactor(loadtestservice): remove extra public constants * chore(): update dependencies for Azure.Developer.Playwright.MSTest * chore(): update CODEOWNERS * refactor(): rename testContext ctor param to context * chore(): remove dac fallback in azure credentials * docs(): update basic setup * Update eng/Packages.Data.props * Update eng/Packages.Data.props --------- Co-authored-by: Siddharth Singha Roy <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Jesse Squire <[email protected]>
1 parent ce503c0 commit 4b17cd2

File tree

60 files changed

+4916
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4916
-3
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,10 @@
592592
# ServiceOwners: @Tanmayeekamath
593593

594594
# PRLabel: %Load Test Service
595-
/sdk/loadtestservice/ @prativen @mitsha-microsoft @ninallam
595+
/sdk/loadtestservice/ @azure/testing-services
596596

597597
# ServiceLabel: %Load Test Service
598-
# ServiceOwners: @prativen @mitsha-microsoft @ninallam
598+
# ServiceOwners: @azure/testing-services
599599

600600
# ServiceLabel: %Logic App
601601
# ServiceOwners: @Azure/azure-logicapps-team

eng/Packages.Data.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@
191191
<PackageReference Update="OpenAI" Version="2.2.0-beta.4" />
192192
</ItemGroup>
193193

194-
<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.Developer.MicrosoftPlaywrightTesting'))">
194+
<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.Developer.MicrosoftPlaywrightTesting')) or $(MSBuildProjectName.StartsWith('Azure.Developer.Playwright'))">
195195
<PackageReference Update="Microsoft.TestPlatform.ObjectModel" Version="17.10.0" />
196+
<PackageReference Update="MSTest.TestFramework" Version="1.3.2" />
196197
<PackageReference Update="NUnit" Version="3.13.2" />
197198
</ItemGroup>
198199

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.Playwright.MSTest", "src\Azure.Developer.Playwright.MSTest.csproj", "{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.Playwright.MSTest.Tests", "tests\Azure.Developer.Playwright.MSTest.Tests.csproj", "{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
14+
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Debug|x64.ActiveCfg = Debug|Any CPU
23+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Debug|x64.Build.0 = Debug|Any CPU
24+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Debug|x86.ActiveCfg = Debug|Any CPU
25+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Debug|x86.Build.0 = Debug|Any CPU
26+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Release|x64.ActiveCfg = Release|Any CPU
29+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Release|x64.Build.0 = Release|Any CPU
30+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Release|x86.ActiveCfg = Release|Any CPU
31+
{7FDC84E1-939E-4DAF-8D28-F0E58180FB7B}.Release|x86.Build.0 = Release|Any CPU
32+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Debug|x64.ActiveCfg = Debug|Any CPU
35+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Debug|x64.Build.0 = Debug|Any CPU
36+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Debug|x86.ActiveCfg = Debug|Any CPU
37+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Debug|x86.Build.0 = Debug|Any CPU
38+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Release|x64.ActiveCfg = Release|Any CPU
41+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Release|x64.Build.0 = Release|Any CPU
42+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Release|x86.ActiveCfg = Release|Any CPU
43+
{FC34A47E-54B1-4DCF-8E16-B2D6EEF85C28}.Release|x86.Build.0 = Release|Any CPU
44+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Debug|x64.ActiveCfg = Debug|Any CPU
47+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Debug|x64.Build.0 = Debug|Any CPU
48+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Debug|x86.ActiveCfg = Debug|Any CPU
49+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Debug|x86.Build.0 = Debug|Any CPU
50+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Release|Any CPU.Build.0 = Release|Any CPU
52+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Release|x64.ActiveCfg = Release|Any CPU
53+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Release|x64.Build.0 = Release|Any CPU
54+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Release|x86.ActiveCfg = Release|Any CPU
55+
{DB6DBF0F-4F53-8A3B-9D40-FEF1E1DF5D73}.Release|x86.Build.0 = Release|Any CPU
56+
EndGlobalSection
57+
GlobalSection(SolutionProperties) = preSolution
58+
HideSolutionNode = FALSE
59+
EndGlobalSection
60+
EndGlobal
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
- Added authentication using Microsoft Entra ID for the service.
8+
- Added support for MSTest runner.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Azure Playwright MSTest client library for .NET
2+
3+
Azure Playwright is a fully managed service that uses the cloud to enable you to run Playwright tests with much higher parallelization across different operating system-browser combinations simultaneously. This means faster test runs with broader scenario coverage, which helps speed up delivery of features without sacrificing quality. The service also enables you to publish test results and related artifacts to the service and view them in the service portal enabling faster and easier troubleshooting. With Azure Playwright, you can release features faster and more confidently.
4+
5+
Ready to get started? Jump into our [quickstart guide]<!--(https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/loadtestservice/Azure.Developer.Playwright.MSTest/README.md#getting-started)-->!
6+
7+
## Useful links
8+
9+
- [Quickstart: Run end-to-end tests at scale](https://aka.ms/mpt/quickstart)
10+
- [View Azure Playwright service demo](https://youtu.be/GenC1jAeTZE)
11+
- [Documentation](https://aka.ms/mpt/docs)
12+
- [Pricing](https://aka.ms/mpt/pricing)
13+
- [Share feedback](https://aka.ms/mpt/feedback)
14+
15+
## Getting started
16+
17+
### Install the package
18+
19+
Install the client library for .NET with [NuGet](https://www.nuget.org/):
20+
21+
```dotnetcli
22+
dotnet add package Azure.Developer.Playwright.MSTest --prerelease
23+
```
24+
25+
### Prerequisites
26+
27+
- An [Azure subscription](https://azure.microsoft.com/free/dotnet/)
28+
- Your Azure account must be assigned the [Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#owner), [Contributor](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#contributor), or one of the [classic administrator roles](https://learn.microsoft.com/azure/role-based-access-control/rbac-and-directory-admin-roles#classic-subscription-administrator-roles).
29+
30+
### Authenticate the client
31+
32+
To learn more about options for Microsoft Entra Id authentication, refer to [Azure.Identity credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#credentials).
33+
34+
#### Create a Workspace
35+
36+
1. Sign in to the [Playwright portal](https://aka.ms/mpt/portal) with your Azure account.
37+
38+
2. Create the Workspace
39+
40+
![Create new workspace](https://github.com/microsoft/playwright-testing-service/assets/12104064/d571e86b-9d43-48ac-a2b7-63afb9bb86a8)
41+
42+
| Field | Description |
43+
| ---------------------- | ----------------------------------------------------------------------------------------------------- |
44+
| **Workspace Name** | A unique name to identify your workspace.<BR>The name can't contain special characters or whitespace. |
45+
| **Azure Subscription** | Select an Azure subscription where you want to create the workspace. |
46+
| **Region** | This is where test run data will be stored for your workspace. |
47+
48+
> [!NOTE]
49+
> If you don't see this screen, select an existing workspace and go to the next section.
50+
51+
```
52+
53+
### Set up Azure Playwright
54+
55+
Create a file `PlaywrightServiceSetup.cs` in the root directory with the below content
56+
57+
```C# Snippet:MSTest_Sample1_SimpleSetup
58+
using System.Threading.Tasks;
59+
using Azure.Developer.Playwright.MSTest;
60+
using Azure.Identity;
61+
using Microsoft.VisualStudio.TestTools.UnitTesting;
62+
63+
namespace PlaywrightService.SampleTests; // Remember to change this as per your project namespace
64+
65+
public class PlaywrightServiceMSTestSetup
66+
{
67+
private static PlaywrightServiceBrowserMSTest playwrightClient = null!;
68+
69+
[AssemblyInitialize]
70+
public static async Task AssemblyInitialize(TestContext testContext)
71+
{
72+
playwrightClient = new PlaywrightServiceBrowserMSTest(context: testContext, credential: new DefaultAzureCredential());
73+
await playwrightClient.InitializeAsync();
74+
}
75+
76+
[AssemblyCleanup]
77+
public static async Task AssemblyCleanup()
78+
{
79+
await playwrightClient.DisposeAsync();
80+
}
81+
}
82+
```
83+
84+
> [!NOTE]
85+
> Make sure your project uses `Microsoft.Playwright.MSTest` version 1.37 or above.
86+
87+
### Obtain region endpoint
88+
89+
1. In the [Playwright portal](https://aka.ms/mpt/portal), copy the command under **Add region endpoint in your set up**.
90+
91+
![Set workspace endpoint](https://github.com/microsoft/playwright-testing-service/assets/12104064/d81ca629-2b23-4d34-8b70-67b6f7061a83)
92+
93+
The endpoint URL corresponds to the workspace region. You might see a different endpoint URL in the Playwright portal, depending on the region you selected when creating the workspace.
94+
95+
### Set up environment
96+
97+
Ensure that the `PLAYWRIGHT_SERVICE_URL` that you obtained in previous step is available in your environment.
98+
99+
### Run the tests
100+
101+
Run Playwright tests against browsers managed by the service using the configuration you created above.
102+
103+
```dotnetcli
104+
dotnet test
105+
```
106+
107+
## Key concepts
108+
109+
Key concepts of the Azure Playwright MSTest SDK for .NET can be found [here](https://aka.ms/mpt/what-is-mpt)
110+
111+
## Examples
112+
113+
Code samples for using this SDK can be found in the following locations
114+
115+
- [.NET Azure Playwright MSTest Library Code Samples](https://aka.ms/mpt/sample)
116+
117+
## Troubleshooting
118+
119+
- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues).
120+
- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags.
121+
122+
## Next steps
123+
124+
- Run tests in a [CI/CD pipeline.](https://aka.ms/mpt/configure-pipeline)
125+
126+
- Learn how to [manage access](https://aka.ms/mpt/manage-access) to the created workspace.
127+
128+
- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/mpt/parallelism).
129+
130+
## Contributing
131+
132+
This project welcomes contributions and suggestions. Most contributions require
133+
you to agree to a Contributor License Agreement (CLA) declaring that you have
134+
the right to, and actually do, grant us the rights to use your contribution. For
135+
details, visit [cla.microsoft.com][cla].
136+
137+
This project has adopted the [Microsoft Open Source Code of Conduct][coc].
138+
For more information see the [Code of Conduct FAQ][coc_faq] or contact
139+
[[email protected]][coc_contact] with any additional questions or comments.
140+
141+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/loadtestservice/Azure.Developer.Playwright.MSTest/README.png)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Azure.Developer.Playwright.MSTest
2+
{
3+
public partial class PlaywrightServiceBrowserMSTest : Azure.Developer.Playwright.PlaywrightServiceBrowserClient
4+
{
5+
public PlaywrightServiceBrowserMSTest() { }
6+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential) { }
7+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential, Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
8+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential, Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context) { }
9+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential, Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context, Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
10+
public PlaywrightServiceBrowserMSTest(Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
11+
public PlaywrightServiceBrowserMSTest(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context) { }
12+
public PlaywrightServiceBrowserMSTest(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context, Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
13+
public override System.Threading.Tasks.Task DisposeAsync() { throw null; }
14+
public override System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Azure.Developer.Playwright.MSTest
2+
{
3+
public partial class PlaywrightServiceBrowserMSTest : Azure.Developer.Playwright.PlaywrightServiceBrowserClient
4+
{
5+
public PlaywrightServiceBrowserMSTest() { }
6+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential) { }
7+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential, Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
8+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential, Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context) { }
9+
public PlaywrightServiceBrowserMSTest(Azure.Core.TokenCredential credential, Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context, Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
10+
public PlaywrightServiceBrowserMSTest(Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
11+
public PlaywrightServiceBrowserMSTest(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context) { }
12+
public PlaywrightServiceBrowserMSTest(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context, Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions options) { }
13+
public override System.Threading.Tasks.Task DisposeAsync() { throw null; }
14+
public override System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
15+
}
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- csharp
5+
products:
6+
- azure
7+
name: Azure.Developer.Playwright.MSTest samples for .NET
8+
description: Samples for the Azure.Developer.Playwright.MSTest client library
9+
---
10+
11+
# Azure.Developer.Playwright.MSTest samples for .NET
12+
13+
- [Getting started with Azure Playwright MSTest]<!--(https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/loadtestservice/Azure.Developer.Playwright.MSTest/samples/Sample1_SimpleSetup.md)-->
14+
- [Customising service parameters]<!--(https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/loadtestservice/Azure.Developer.Playwright.MSTest/samples/Sample2_CustomisingServiceParameters.md)-->
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Getting started with Azure Playwright MSTest SDK
2+
3+
Follow the steps listed in this [README]<!--(https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/loadtestservice/Azure.Developer.Playwright.MSTest/README.md)--> to integrate your existing Playwright test suite with Azure Playwright service.
4+
This guide explains how to quickly get started with the Azure Playwright MSTest SDK.
5+
6+
### Minimal configuration
7+
8+
The below snippet demonstrates the minimal configuration required to setup Azure Playwright with an existing MSTest codebase.
9+
10+
```C# Snippet:MSTest_Sample1_SimpleSetup
11+
using System.Threading.Tasks;
12+
using Azure.Developer.Playwright.MSTest;
13+
using Azure.Identity;
14+
using Microsoft.VisualStudio.TestTools.UnitTesting;
15+
16+
namespace PlaywrightService.SampleTests; // Remember to change this as per your project namespace
17+
18+
public class PlaywrightServiceMSTestSetup
19+
{
20+
private static PlaywrightServiceBrowserMSTest playwrightClient = null!;
21+
22+
[AssemblyInitialize]
23+
public static async Task AssemblyInitialize(TestContext testContext)
24+
{
25+
playwrightClient = new PlaywrightServiceBrowserMSTest(context: testContext, credential: new DefaultAzureCredential());
26+
await playwrightClient.InitializeAsync();
27+
}
28+
29+
[AssemblyCleanup]
30+
public static async Task AssemblyCleanup()
31+
{
32+
await playwrightClient.DisposeAsync();
33+
}
34+
}
35+
```
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Learn about different available service parameters and how to use them
2+
3+
Follow the steps listed in this [README]<!--(https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/loadtestservice/Azure.Developer.Playwright.MSTest/README.md)--> to integrate your existing Playwright test suite with Azure Playwright service.
4+
This guide explains the different options available to you in the Azure.Developer.Playwright.MSTest package and how to use them.
5+
6+
### Customising remote browser parameters
7+
8+
The snippet below shows how to customize remote browser parameters like OS, expose network settings, run ids and azure credential type.
9+
10+
```C# Snippet:MSTest_Sample2_CustomisingServiceParameters
11+
using System;
12+
using System.Runtime.InteropServices;
13+
using System.Threading.Tasks;
14+
using Azure.Developer.Playwright.MSTest;
15+
using Azure.Identity;
16+
using Microsoft.VisualStudio.TestTools.UnitTesting;
17+
18+
namespace PlaywrightService.SampleTests; // Remember to change this as per your project namespace
19+
20+
[TestClass]
21+
public class PlaywrightServiceMSTestSetup
22+
{
23+
private static PlaywrightServiceBrowserMSTest playwrightClient = null!;
24+
25+
[AssemblyInitialize]
26+
public static async Task AssemblyInitialize(TestContext testContext)
27+
{
28+
playwrightClient = new PlaywrightServiceBrowserMSTest(credential: new ManagedIdentityCredential(), options: new Azure.Developer.Playwright.PlaywrightServiceBrowserClientOptions()
29+
{
30+
UseCloudHostedBrowsers = true,
31+
OS = OSPlatform.Linux,
32+
ExposeNetwork = "<loopback>",
33+
RunId = Guid.NewGuid().ToString(),
34+
}, context: testContext);
35+
await playwrightClient.InitializeAsync();
36+
}
37+
38+
[AssemblyCleanup]
39+
public static async Task AssemblyCleanup()
40+
{
41+
await playwrightClient.DisposeAsync();
42+
}
43+
}
44+
```

0 commit comments

Comments
 (0)