Skip to content
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

update the sample code in playwrighttesting #47135

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Create a file `PlaywrightServiceSetup.cs` in the root directory with the below c
```C# Snippet:Sample2_SetDefaultAuthenticationMechanism
using Azure.Developer.MicrosoftPlaywrightTesting.NUnit;

namespace PlaywrightTests; // Remember to change this as per your project namespace
namespace PlaywrightTests.Sample2; // Remember to change this as per your project namespace

[SetUpFixture]
public class PlaywrightServiceSetup : PlaywrightServiceNUnit {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dotnet test --settings .runsettings

This issue only impacts the reporting feature. Currently, the service provides minimal support for the following [Azure Credential types.](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes)

Along with this, we also support passing a Managed Identity ClientId to be used along with `DefaultAzureCredential` and `ManagedIdentityCredential`.
Along with this, we also support passing a Managed Identity ClientId to be used along with `DefaultAzureCredential` and `ManagedIdentityCredential`.

If you only want to use cloud-hosted browsers along with your tests, you can disable the reporting feature by removing the logger from the runsettings file and then modify the `PlaywrightServiceSetup.cs` file as per the following.

Expand All @@ -51,7 +51,7 @@ using Azure.Core;
using Azure.Developer.MicrosoftPlaywrightTesting.NUnit;
using Azure.Identity;

namespace PlaywrightTests;
namespace PlaywrightTests.Sample1; // Remember to change this as per your project namespace

[SetUpFixture]
public class PlaywrightServiceSetup : PlaywrightServiceNUnit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide will walk you through the steps to integrate your Playwright project
```C# Snippet:Sample2_SetDefaultAuthenticationMechanism
using Azure.Developer.MicrosoftPlaywrightTesting.NUnit;

namespace PlaywrightTests; // Remember to change this as per your project namespace
namespace PlaywrightTests.Sample2; // Remember to change this as per your project namespace

[SetUpFixture]
public class PlaywrightServiceSetup : PlaywrightServiceNUnit {};
Expand Down Expand Up @@ -54,4 +54,4 @@ Run Playwright tests against browsers managed by the service using the configura

```dotnetcli
dotnet test --settings .runsettings
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Azure.Developer.MicrosoftPlaywrightTesting.NUnit;
using Azure.Identity;

namespace PlaywrightTests;
namespace PlaywrightTests.Sample1; // Remember to change this as per your project namespace

[SetUpFixture]
#if SNIPPET
Expand All @@ -23,4 +23,4 @@ public PlaywrightServiceSetup() : base(managedIdentityCredential) {}
public Sample1ServiceSetup() : base(managedIdentityCredential) {}
#endif
}
#endregion
#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#region Snippet:Sample2_SetDefaultAuthenticationMechanism
using Azure.Developer.MicrosoftPlaywrightTesting.NUnit;

namespace PlaywrightTests; // Remember to change this as per your project namespace
namespace PlaywrightTests.Sample2; // Remember to change this as per your project namespace

[SetUpFixture]
#if SNIPPET
public class PlaywrightServiceSetup : PlaywrightServiceNUnit {};
#else
public class Sample2ServiceSetup : PlaywrightServiceNUnit { };
#endif
#endregion
#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ skip-csproj: true
modelerfour:
flatten-payloads: false
use-model-reader-writer: true
use-write-core: true

#mgmt-debug:
# show-serialized-names: true
Expand Down