From 783a36be29023b12695b679864fed9b7c8fea7ad Mon Sep 17 00:00:00 2001 From: v-raghulraja <165115074+v-raghulraja@users.noreply.github.com> Date: Fri, 24 Oct 2025 10:17:37 +0530 Subject: [PATCH 1/2] Updated the playwright version to 55 --- .../Microsoft.PowerApps.TestEngine.csproj | 2 +- .../PowerAppsTestEngineWrapper.csproj | 2 +- src/testengine.common.user/testengine.common.user.csproj | 2 +- src/testengine.module.mda/testengine.module.mda.csproj | 2 +- src/testengine.module.pause/testengine.module.pause.csproj | 2 +- .../testengine.module.powerapps.portal.csproj | 2 +- .../testengine.module.simulation.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) 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/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 @@ - + From 5d4561d9299efeee5854deecf465222e68c15fdb Mon Sep 17 00:00:00 2001 From: v-raghulraja <165115074+v-raghulraja@users.noreply.github.com> Date: Fri, 24 Oct 2025 13:30:34 +0530 Subject: [PATCH 2/2] fixing unit tests --- .../TestInfra/PlaywrightTestInfraFunctions.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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()); }