diff --git a/src/Microsoft.PowerApps.TestEngine/Microsoft.PowerApps.TestEngine.csproj b/src/Microsoft.PowerApps.TestEngine/Microsoft.PowerApps.TestEngine.csproj index 5eee6f55e..983557c56 100644 --- a/src/Microsoft.PowerApps.TestEngine/Microsoft.PowerApps.TestEngine.csproj +++ b/src/Microsoft.PowerApps.TestEngine/Microsoft.PowerApps.TestEngine.csproj @@ -45,7 +45,7 @@ - + diff --git a/src/Microsoft.PowerApps.TestEngine/TestInfra/PlaywrightTestInfraFunctions.cs b/src/Microsoft.PowerApps.TestEngine/TestInfra/PlaywrightTestInfraFunctions.cs index 5ada989e8..32cedf7ca 100644 --- a/src/Microsoft.PowerApps.TestEngine/TestInfra/PlaywrightTestInfraFunctions.cs +++ b/src/Microsoft.PowerApps.TestEngine/TestInfra/PlaywrightTestInfraFunctions.cs @@ -115,10 +115,22 @@ public async Task SetupAsync(IUserManager userManager) staticContext.Args = (staticContext.Args ?? Array.Empty()).Concat(headlessArgs).ToArray(); } - var browser = PlaywrightObject[browserConfig.Browser]; + // Use indexer for valid browser (tests assert this), translate null or ArgumentException to UserInputException + IBrowserType browser = null; + try + { + browser = PlaywrightObject[browserConfig.Browser]; + } + catch (ArgumentException) + { + // Ensure we map any Playwright internal invalid browser exceptions to UserInputException + _singleTestInstanceState.GetLogger().LogError(BrowserNotSupportedErrorMessage); + throw new UserInputException(UserInputException.ErrorMapping.UserInputExceptionInvalidTestSettings.ToString()); + } + if (browser == null) { - _singleTestInstanceState.GetLogger().LogError("Browser not supported by Playwright, for more details check https://playwright.dev/dotnet/docs/browsers"); + _singleTestInstanceState.GetLogger().LogError(BrowserNotSupportedErrorMessage); throw new UserInputException(UserInputException.ErrorMapping.UserInputExceptionInvalidTestSettings.ToString()); } diff --git a/src/PowerAppsTestEngineWrapper/PowerAppsTestEngineWrapper.csproj b/src/PowerAppsTestEngineWrapper/PowerAppsTestEngineWrapper.csproj index 85ecae257..97a9e9da3 100644 --- a/src/PowerAppsTestEngineWrapper/PowerAppsTestEngineWrapper.csproj +++ b/src/PowerAppsTestEngineWrapper/PowerAppsTestEngineWrapper.csproj @@ -28,7 +28,7 @@ - + diff --git a/src/testengine.common.user/testengine.common.user.csproj b/src/testengine.common.user/testengine.common.user.csproj index 494c607cb..e5b0e1143 100644 --- a/src/testengine.common.user/testengine.common.user.csproj +++ b/src/testengine.common.user/testengine.common.user.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/testengine.module.mda/testengine.module.mda.csproj b/src/testengine.module.mda/testengine.module.mda.csproj index ba4a95322..d52f68c9f 100644 --- a/src/testengine.module.mda/testengine.module.mda.csproj +++ b/src/testengine.module.mda/testengine.module.mda.csproj @@ -42,7 +42,7 @@ - + diff --git a/src/testengine.module.pause/testengine.module.pause.csproj b/src/testengine.module.pause/testengine.module.pause.csproj index cdc844dee..bef24444f 100644 --- a/src/testengine.module.pause/testengine.module.pause.csproj +++ b/src/testengine.module.pause/testengine.module.pause.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/testengine.module.powerapps.portal/testengine.module.powerapps.portal.csproj b/src/testengine.module.powerapps.portal/testengine.module.powerapps.portal.csproj index 1bcc0a5d4..d5e6346c4 100644 --- a/src/testengine.module.powerapps.portal/testengine.module.powerapps.portal.csproj +++ b/src/testengine.module.powerapps.portal/testengine.module.powerapps.portal.csproj @@ -49,7 +49,7 @@ - + diff --git a/src/testengine.module.simulation/testengine.module.simulation.csproj b/src/testengine.module.simulation/testengine.module.simulation.csproj index a88286f8a..6f9858979 100644 --- a/src/testengine.module.simulation/testengine.module.simulation.csproj +++ b/src/testengine.module.simulation/testengine.module.simulation.csproj @@ -23,7 +23,7 @@ - +