Version
1.58.0
Steps to reproduce
-
Clone my repo at https://github.com/saalmi098/PlaywrightSlowMoRepro
-
Test via command line (SlowMo works):
Expected: Browser opens with visible 2-second delays between each action
Result: SlowMo works correctly
-
Test via Visual Studio (SlowMo doesn't work):
- Open
PlaywrightSlowMoRepro.sln in Visual Studio
- Open Test Explorer View
- Run the existing test
Expected: Browser opens with visible 2-second delays between each action
Result: SlowMo is ignored - actions execute at normal speed
Expected behavior
The LaunchOptions (including SlowMo, Headless etc.) configured in the .runsettings file should be applied when running tests through Visual Studio Test Explorer, the same way they are applied when running via dotnet test.
Actual behavior
- The
.runsettings file is detected and loaded by Visual Studio
- Environment variables from
<RunConfiguration>/<EnvironmentVariables> in .runsettings work correctly in both VS Test Explorer and dotnet test
- Playwright-specific settings from the
<Playwright> section (like LaunchOptions) are completely ignored when running via VS Test Explorer --> no SlowMo delay between browser actions
- The same
.runsettings file works perfectly with dotnet test --> SlowMo delay works fine
Visual Studio Test Output confirms the runsettings are loaded:
Using runsettings file C:\Workspaces\Git\PlaywrightSlowMoRepro\tests.runsettings
Tests run settings for TestAssembly.dll:
<RunSettings>
<Playwright>
<BrowserName>chromium</BrowserName>
<LaunchOptions>
<SlowMo>1000</SlowMo>
<Headless>false</Headless>
</LaunchOptions>
</Playwright>
</RunSettings>
Despite the settings being present in the processed runsettings, the browser launches at normal speed in VS Test Explorer.
Additional context
Looking at the PlaywrightSettingsProvider implementation, it implements ISettingsProvider and registers itself with:
[ExtensionUri("settings://playwright")]
[SettingsName("Playwright")]
public class PlaywrightSettingsProvider : ISettingsProvider
{
public static void LoadViaEnvIfNeeded()
{
if (_settings == null)
{
var settings = Environment.GetEnvironmentVariable("PW_INTERNAL_ADAPTER_SETTINGS");
if (!string.IsNullOrEmpty(settings))
{
_settings = JsonSerializer.Deserialize<PlaywrightSettingsXml>(settings);
}
else
{
_settings = new PlaywrightSettingsXml();
}
}
}
public void Load(XmlReader reader)
{
_settings = new PlaywrightSettingsXml(reader);
Environment.SetEnvironmentVariable("PW_INTERNAL_ADAPTER_SETTINGS", JsonSerializer.Serialize(_settings));
}
}
The Load(XmlReader reader) method appears not to be invoked when running through Visual Studio's test platform, while it works correctly in the dotnet test execution path. This suggests the settings provider registration may not be properly recognized by Visual Studio's test adapter infrastructure.
Is there a specific registration step required for ISettingsProvider implementations to work with Visual Studio Test Explorer, or is this a known limitation with the xUnit v3 adapter integration?
Environment
- Operating System: Windows 11
- CPU: x64
- Browser: Chromium
- .NET Version (TFM): net10.0
- Visual Studio Professional 2026: v18.4.0
- Packages
- Microsoft.Playwright: v1.58.0
- Microsoft.Playwright.Xunit.v3: v1.58.0
- xunit.v3: v3.2.2
Version
1.58.0
Steps to reproduce
Clone my repo at https://github.com/saalmi098/PlaywrightSlowMoRepro
Test via command line (SlowMo works):
Expected: Browser opens with visible 2-second delays between each action
Result: SlowMo works correctly
Test via Visual Studio (SlowMo doesn't work):
PlaywrightSlowMoRepro.slnin Visual StudioExpected: Browser opens with visible 2-second delays between each action
Result: SlowMo is ignored - actions execute at normal speed
Expected behavior
The
LaunchOptions(includingSlowMo,Headlessetc.) configured in the.runsettingsfile should be applied when running tests through Visual Studio Test Explorer, the same way they are applied when running viadotnet test.Actual behavior
.runsettingsfile is detected and loaded by Visual Studio<RunConfiguration>/<EnvironmentVariables>in.runsettingswork correctly in both VS Test Explorer anddotnet test<Playwright>section (likeLaunchOptions) are completely ignored when running via VS Test Explorer --> no SlowMo delay between browser actions.runsettingsfile works perfectly withdotnet test--> SlowMo delay works fineVisual Studio Test Output confirms the runsettings are loaded:
Despite the settings being present in the processed runsettings, the browser launches at normal speed in VS Test Explorer.
Additional context
Looking at the
PlaywrightSettingsProviderimplementation, it implementsISettingsProviderand registers itself with:The
Load(XmlReader reader)method appears not to be invoked when running through Visual Studio's test platform, while it works correctly in thedotnet testexecution path. This suggests the settings provider registration may not be properly recognized by Visual Studio's test adapter infrastructure.Is there a specific registration step required for
ISettingsProviderimplementations to work with Visual Studio Test Explorer, or is this a known limitation with the xUnit v3 adapter integration?Environment