Skip to content

Commit a1b09f1

Browse files
kashish2508guptakashishCopilot
authored
docs(loadtestservice): updated old links (Azure#51679)
* docs(loadtestservice): updated old links * update * doc update * update * update * Update sdk/loadtestservice/Azure.Developer.Playwright/src/Constants.cs Co-authored-by: Copilot <[email protected]> * removed old link * update * update * update --------- Co-authored-by: guptakashish <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 2f8473f commit a1b09f1

File tree

7 files changed

+147
-62
lines changed

7 files changed

+147
-62
lines changed

sdk/loadtestservice/Azure.Developer.Playwright.MSTest/README.md

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ Ready to get started? Jump into our [quickstart guide](https://github.com/Azure/
66

77
## Useful links
88

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)
9+
- [Quickstart: Run end-to-end tests at scale](https://aka.ms/pww/docs/quickstart)
10+
- [Documentation](https://aka.ms/pww/docs)
11+
- [Pricing](https://aka.ms/pww/docs/pricing)
12+
- [Share feedback](https://aka.ms/pww/docs/feedback)
1413

1514
## Getting started
1615

@@ -33,20 +32,42 @@ To learn more about options for Microsoft Entra Id authentication, refer to [Azu
3332

3433
#### Create a Workspace
3534

36-
1. Sign in to the [Playwright portal](https://aka.ms/mpt/portal) with your Azure account.
35+
1. Sign in to the [Azure portal](https://portal.azure.com/) with your Azure account.
3736

38-
2. Create the Workspace
37+
1. Create the Workspace.
3938

40-
![Create new workspace](https://github.com/microsoft/playwright-testing-service/assets/12104064/d571e86b-9d43-48ac-a2b7-63afb9bb86a8)
39+
- Select the menu button in the upper-left corner of the portal, and then select Create a resource.
4140

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. |
41+
![Create a resource in Azure portal](https://aka.ms/pww/docs/createurlsnapshot)
42+
43+
- Enter **Playwright Workspaces** in the search box.
44+
45+
- Select the **Playwright Workspaces** card, and then select **Create**.
46+
47+
![Search for Playwright Workspaces in Azure Marketplace](https://aka.ms/pww/docs/searchurlsnapshot)
48+
49+
- Provide the following information to configure a new Playwright workspace:
50+
51+
| Field | Description |
52+
|-------|-------------|
53+
| **Subscription** | Select the Azure subscription that you want to use for this Playwright workspace. |
54+
| **Resource group** | Select an existing resource group. Or select **Create new**, and then enter a unique name for the new resource group. |
55+
| **Name** | Enter a unique name to identify your workspace.<br/>The name can only consist of alphanumerical characters, and have a length between 3 and 64 characters. |
56+
| **Location** | Select a geographic location to host your workspace.<br/>This location also determines where the test execution results are stored. |
57+
58+
> [!NOTE]
59+
> Optionally, you can configure more details on the **Tags** tab. Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups.
60+
61+
- After you're finished configuring the resource, select **Review + Create**.
62+
63+
- Review all the configuration settings and select **Create** to start the deployment of the Playwright workspace.
64+
65+
- When the process has finished, a deployment success message appears.
66+
67+
- To view the new workspace, select **Go to resource**.
68+
69+
![Deployment complete - Go to resource](https://aka.ms/pww/docs/deploymenturlsnapshot)
4770

48-
> [!NOTE]
49-
> If you don't see this screen, select an existing workspace and go to the next section.
5071

5172
```
5273
@@ -86,9 +107,9 @@ public class PlaywrightServiceMSTestSetup
86107
87108
### Obtain region endpoint
88109

89-
1. In the [Playwright portal](https://aka.ms/mpt/portal), copy the command under **Add region endpoint in your set up**.
110+
1. In the [Playwright portal](https://portal.azure.com/), copy the command under **Add region endpoint in your set up**.
90111

91-
![Set workspace endpoint](https://github.com/microsoft/playwright-testing-service/assets/12104064/d81ca629-2b23-4d34-8b70-67b6f7061a83)
112+
![Set workspace endpoint](https://aka.ms/pww/docs/copyurlsnapshot)
92113

93114
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.
94115

@@ -112,7 +133,7 @@ Key concepts of the Azure Playwright MSTest SDK for .NET can be found [here](htt
112133

113134
Code samples for using this SDK can be found in the following locations
114135

115-
- [.NET Azure Playwright MSTest Library Code Samples](https://aka.ms/mpt/sample)
136+
- [.NET Azure Playwright MSTest Library Code Samples](https://aka.ms/pww/samples)
116137

117138
## Troubleshooting
118139

@@ -121,11 +142,11 @@ Code samples for using this SDK can be found in the following locations
121142

122143
## Next steps
123144

124-
- Run tests in a [CI/CD pipeline.](https://aka.ms/mpt/configure-pipeline)
145+
- Run tests in a [CI/CD pipeline.](https://aka.ms/pww/docs/configure-pipeline)
125146

126-
- Learn how to [manage access](https://aka.ms/mpt/manage-access) to the created workspace.
147+
- Learn how to [manage access](https://aka.ms/pww/docs/manage-access) to the created workspace.
127148

128-
- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/mpt/parallelism).
149+
- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/pww/docs/parallelism).
129150

130151
## Contributing
131152

sdk/loadtestservice/Azure.Developer.Playwright.NUnit/README.md

Lines changed: 75 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ Ready to get started? Jump into our [quickstart guide](https://github.com/Azure/
66

77
## Useful links
88

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)
9+
- [Quickstart: Run end-to-end tests at scale](https://aka.ms/pww/docs/quickstart)
10+
- [Documentation](https://aka.ms/pww/docs)
11+
- [Pricing](https://aka.ms/pww/docs/pricing)
12+
- [Share feedback](https://aka.ms/pww/docs/feedback)
1413

1514
## Getting started
1615

@@ -33,17 +32,42 @@ To learn more about options for Microsoft Entra Id authentication, refer to [Azu
3332

3433
#### Create a Workspace
3534

36-
1. Sign in to the [Playwright portal](https://aka.ms/mpt/portal) with your Azure account.
35+
1. Sign in to the [Azure portal](https://portal.azure.com/) with your Azure account.
3736

38-
2. Create the Workspace
37+
1. Create the Workspace.
3938

40-
![Create new workspace](https://github.com/microsoft/playwright-testing-service/assets/12104064/d571e86b-9d43-48ac-a2b7-63afb9bb86a8)
39+
- Select the menu button in the upper-left corner of the portal, and then select Create a resource.
4140

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. |
41+
![Create a resource in Azure portal](https://aka.ms/pww/docs/createurlsnapshot)
42+
43+
- Enter **Playwright Workspaces** in the search box.
44+
45+
- Select the **Playwright Workspaces** card, and then select **Create**.
46+
47+
![Search for Playwright Workspaces in Azure Marketplace](https://aka.ms/pww/docs/searchurlsnapshot)
48+
49+
- Provide the following information to configure a new Playwright workspace:
50+
51+
| Field | Description |
52+
|-------|-------------|
53+
| **Subscription** | Select the Azure subscription that you want to use for this Playwright workspace. |
54+
| **Resource group** | Select an existing resource group. Or select **Create new**, and then enter a unique name for the new resource group. |
55+
| **Name** | Enter a unique name to identify your workspace.<br/>The name can only consist of alphanumerical characters, and have a length between 3 and 64 characters. |
56+
| **Location** | Select a geographic location to host your workspace.<br/>This location also determines where the test execution results are stored. |
57+
58+
> [!NOTE]
59+
> Optionally, you can configure more details on the **Tags** tab. Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups.
60+
61+
- After you're finished configuring the resource, select **Review + Create**.
62+
63+
- Review all the configuration settings and select **Create** to start the deployment of the Playwright workspace.
64+
65+
- When the process has finished, a deployment success message appears.
66+
67+
- To view the new workspace, select **Go to resource**.
68+
69+
![Deployment complete - Go to resource](https://aka.ms/pww/docs/deploymenturlsnapshot)
70+
|
4771

4872
> [!NOTE]
4973
> If you don't see this screen, select an existing workspace and go to the next section.
@@ -61,17 +85,46 @@ using Azure.Identity;
6185
namespace PlaywrightService.SampleTests; // Remember to change this as per your project namespace
6286
6387
[SetUpFixture]
64-
public class PlaywrightServiceNUnitSetup : PlaywrightServiceBrowserNUnit { }
88+
public class PlaywrightServiceNUnitSetup : PlaywrightServiceBrowserNUnit
89+
{
90+
public PlaywrightServiceNUnitSetup() : base(
91+
credential: new DefaultAzureCredential()
92+
)
93+
{ }
94+
}
95+
```
96+
97+
### Setup Azure Playwright cloud browser connection
98+
99+
Override builtin PageTest fixture with Azure Playwright cloud browser connection and use ServicePageTest in all test classes.
100+
101+
```csharp
102+
using Microsoft.Playwright.NUnit;
103+
using Azure.Developer.Playwright;
104+
using Azure.Identity;
105+
using Microsoft.Playwright;
106+
107+
namespace PlaywrightService.SampleTests;
108+
109+
public class ServicePageTest : PageTest
110+
{
111+
public override async Task<(string, BrowserTypeConnectOptions?)?> ConnectOptionsAsync()
112+
{
113+
PlaywrightServiceBrowserClient client = new PlaywrightServiceBrowserClient(credential: new DefaultAzureCredential());
114+
var connectOptions = await client.GetConnectOptionsAsync<BrowserTypeConnectOptions>();
115+
return (connectOptions.WsEndpoint, connectOptions.Options);
116+
}
117+
}
65118
```
66119

67120
> [!NOTE]
68-
> Make sure your project uses `Microsoft.Playwright.NUnit` version 1.37 or above.
121+
> Make sure your project uses `Microsoft.Playwright.NUnit` version 1.50.0 or above.
69122
70123
### Obtain region endpoint
71124

72-
1. In the [Playwright portal](https://aka.ms/mpt/portal), copy the command under **Add region endpoint in your set up**.
125+
1. In the [Playwright portal](https://portal.azure.com/), copy the command under **Add region endpoint in your set up**.
73126

74-
![Set workspace endpoint](https://github.com/microsoft/playwright-testing-service/assets/12104064/d81ca629-2b23-4d34-8b70-67b6f7061a83)
127+
![Set workspace endpoint](https://aka.ms/pww/docs/copyurlsnapshot)
75128

76129
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.
77130

@@ -89,13 +142,13 @@ dotnet test
89142

90143
## Key concepts
91144

92-
Key concepts of the Azure Playwright NUnit SDK for .NET can be found [here](https://aka.ms/mpt/what-is-mpt)
145+
Key concepts of the Azure Playwright NUnit SDK for .NET can be found [here](https://aka.ms/pww/docs/overview)
93146

94147
## Examples
95148

96149
Code samples for using this SDK can be found in the following locations
97150

98-
- [.NET Azure Playwright NUnit Library Code Samples](https://aka.ms/mpt/sample)
151+
- [.NET Azure Playwright NUnit Library Code Samples](https://aka.ms/pww/samples)
99152

100153
## Troubleshooting
101154

@@ -104,11 +157,11 @@ Code samples for using this SDK can be found in the following locations
104157

105158
## Next steps
106159

107-
- Run tests in a [CI/CD pipeline.](https://aka.ms/mpt/configure-pipeline)
160+
- Run tests in a [CI/CD pipeline.](https://aka.ms/pww/docs/configure-pipeline)
108161

109-
- Learn how to [manage access](https://aka.ms/mpt/manage-access) to the created workspace.
162+
- Learn how to [manage access](https://aka.ms/pww/docs/manage-access) to the created workspace.
110163

111-
- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/mpt/parallelism).
164+
- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/pww/docs/parallelism).
112165

113166
## Contributing
114167

sdk/loadtestservice/Azure.Developer.Playwright.NUnit/samples/Sample1_SimpleSetup.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@ using Azure.Identity;
1414
namespace PlaywrightService.SampleTests; // Remember to change this as per your project namespace
1515
1616
[SetUpFixture]
17-
public class PlaywrightServiceNUnitSetup : PlaywrightServiceBrowserNUnit { }
17+
public class PlaywrightServiceNUnitSetup : PlaywrightServiceBrowserNUnit
18+
{
19+
public PlaywrightServiceNUnitSetup() : base(
20+
credential: new DefaultAzureCredential()
21+
)
22+
{ }
23+
}
1824
```

sdk/loadtestservice/Azure.Developer.Playwright.NUnit/tests/samples/Sample1_SimpleSetup.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ namespace PlaywrightTests.Sample1; // Remember to change this as per your projec
1313

1414
[SetUpFixture]
1515
#if SNIPPET
16-
public class PlaywrightServiceNUnitSetup : PlaywrightServiceBrowserNUnit { }
16+
public class PlaywrightServiceNUnitSetup : PlaywrightServiceBrowserNUnit
17+
{
18+
public PlaywrightServiceNUnitSetup() : base(
19+
credential: new DefaultAzureCredential()
20+
)
21+
{ }
22+
}
1723
#else
1824
public class Sample1ServiceSetup : PlaywrightServiceBrowserNUnit
1925
{

sdk/loadtestservice/Azure.Developer.Playwright/README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,21 @@ To learn more about options for Microsoft Entra Id authentication, refer to [Azu
2222
- 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).
2323

2424
## Useful links
25-
- [Quickstart: Run end-to-end tests at scale](https://aka.ms/mpt/quickstart)
26-
- [Quickstart: Set up continuous end-to-end testing across different browsers and operating systems](https://aka.ms/mpt/ci)
27-
- [Explore features and benefits](https://aka.ms/mpt/about)
28-
- [View Azure Playwright service demo](https://youtu.be/GenC1jAeTZE)
29-
- [Documentation](https://aka.ms/mpt/docs)
30-
- [Pricing](https://aka.ms/mpt/pricing)
31-
- [Share feedback](https://aka.ms/mpt/feedback)
25+
- [Quickstart: Run end-to-end tests at scale](https://aka.ms/pww/docs/quickstart)
26+
- [Quickstart: Set up continuous end-to-end testing across different browsers and operating systems](https://aka.ms/pww/docs/ci)
27+
- [Explore features and benefits](https://aka.ms/pww/docs/about)
28+
- [Documentation](https://aka.ms/pww/docs)
29+
- [Pricing](https://aka.ms/pww/docs/pricing)
30+
- [Share feedback](https://aka.ms/pww/docs/feedback)
3231

3332
## Key concepts
3433

35-
Key concepts of the Azure Playwright NUnit SDK for .NET can be found [here](https://aka.ms/mpt/what-is-mpt)
34+
Key concepts of the Azure Playwright NUnit SDK for .NET can be found [here](https://aka.ms/pww/docs/overview)
3635

3736
## Examples
3837

3938
Code samples for using this SDK can be found in the following locations
40-
- [.NET Azure Playwright NUnit Library Code Samples](https://aka.ms/mpt/sample)
39+
- [.NET Azure Playwright NUnit Library Code Samples](https://aka.ms/pww/samples)
4140

4241
## Troubleshooting
4342

@@ -46,11 +45,11 @@ Code samples for using this SDK can be found in the following locations
4645

4746
## Next steps
4847

49-
- Run tests in a [CI/CD pipeline.](https://aka.ms/mpt/configure-pipeline)
48+
- Run tests in a [CI/CD pipeline.](https://aka.ms/pww/docs/configure-pipeline)
5049

51-
- Learn how to [manage access](https://aka.ms/mpt/manage-access) to the created workspace.
50+
- Learn how to [manage access](https://aka.ms/pww/docs/manage-access) to the created workspace.
5251

53-
- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/mpt/parallelism).
52+
- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/pww/docs/parallelism).
5453

5554
## Contributing
5655

sdk/loadtestservice/Azure.Developer.Playwright/src/Constants.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ internal class Constants
144144
// Error messages
145145
internal static readonly string s_no_service_endpoint_error_message = "Please set PLAYWRIGHT_SERVICE_URL in your environment variables.";
146146
internal static readonly string s_service_endpoint_removed_since_scalable_execution_disabled_error_message = "GetConnectOptions method cannot be used when UseCloudHostedBrowsers is set to false in the setup file.";
147-
internal static readonly string s_no_auth_error = "Could not authenticate with the service. Please refer to https://aka.ms/mpt/authentication for more information.";
148-
internal static readonly string s_entra_no_cred_error = "Azure credentials not found when using Entra ID authentication. Please refer to https://aka.ms/mpt/authentication for more information.";
147+
internal static readonly string s_no_auth_error = "Could not authenticate with the service. Please refer to https://aka.ms/pww/docs/authentication for more information.";
148+
internal static readonly string s_entra_no_cred_error = "Azure credentials not found when using Entra ID authentication. Please refer to https://aka.ms/pww/docs/authentication for more information.";
149149
internal static readonly string s_invalid_mpt_pat_error = "The Access Token provided in the environment variable is invalid.";
150150
internal static readonly string s_expired_mpt_pat_error = "The Access Token you are using is expired. Create a new token.";
151151
internal static readonly string s_invalid_os_error = "Invalid operating system, supported values are 'linux' and 'windows'.";
@@ -154,8 +154,8 @@ internal class Constants
154154
internal static readonly string s_playwright_service_runId_not_guid_error_message = "Error: The Run ID must be a valid GUID format. Please provide a valid GUID for the Run ID.";
155155
internal static readonly string s_playwright_service_runName_truncated_warning = "WARNING: Run name exceeds the maximum limit of 200 characters and will be truncated.";
156156
internal static readonly string s_playwright_Version_not_supported_error_message = "The Playwright version you are using does not support playwright workspaces. Please update to Playwright version 1.50.0 or higher.";
157-
internal static readonly string s_playwright_Invalid_version = "The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/mpt/supported-versions.";
158-
internal static readonly string s_playwright_service_create_test_run_error = "Failed to create the test run in the Playwright service.";
157+
internal static readonly string s_playwright_Invalid_version = "The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.";
158+
internal static readonly string s_playwright_service_create_test_run_error = "Failed to create the test run in the Playwright service. Please refer to https://aka.ms/pww/docs/troubleshooting for more information.";
159159

160160
// Internal environment variables
161161
internal static readonly string s_playwright_service_use_cloud_hosted_browsers_environment_variable = "_MPT_USE_CLOUD_HOSTED_BROWSERS";

sdk/loadtestservice/Azure.Developer.Playwright/src/PlaywrightServiceBrowserClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private async Task CreateTestRunPatchCallAsync(string? authToken, CancellationTo
386386
}
387387
catch (RequestFailedException ex)
388388
{
389-
_logger?.LogError($"Failed to create the test run in the Playwright service: {ex.Message}");
389+
_logger?.LogError($"Failed to create the test run in the Playwright service: {ex.Message}. Please refer to https://aka.ms/pww/docs/troubleshooting for more information.");
390390
throw new Exception(Constants.s_playwright_service_create_test_run_error, ex);
391391
}
392392
}

0 commit comments

Comments
 (0)