microsoft / playwright-dotnet

.NET version of the Playwright testing and automation library.

Home Page:https://playwright.dev/dotnet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: 'The parameter is incorrect' at System.ConsolePal.SetConsoleInputEncoding(Encoding enc)

adamwoods1vitalitycouk opened this issue · comments

Version

1.42.0

Steps to reproduce

Install Rider version 2022.3.0
Install Rider version 2023.3.4
Within any project, Debug (Not run) a test with the following line of code
var playwright = await Playwright.CreateAsync();

Expected behavior

Playwright to initialise in both versions when run in debug mode.

Actual behavior

Playwright raises an exception but only in Rider 2023.3.4 when in debug mode,

Additional context

Exception thrown

System.IO.IOException: The parameter is incorrect.
   at System.ConsolePal.SetConsoleInputEncoding(Encoding enc)
   at System.Console.set_InputEncoding(Encoding value)
   at Microsoft.Playwright.Transport.StdIOTransport.StartProcessWithUTF8IOEncoding(Process process) in /_/src/Playwright/Transport/StdIOTransport.cs:line 175
   at Microsoft.Playwright.Transport.StdIOTransport..ctor() in /_/src/Playwright/Transport/StdIOTransport.cs:line 47
   at Microsoft.Playwright.Playwright.CreateAsync() in /_/src/Playwright/Playwright.cs:line 43
   at SalesforceServicingOrg.Foundation.Hooks.CommonHooks.BeforeScenario() in D:\Users\adam.woods\RiderProjects\salesforceservicingorg.ui.tests\SalesforceServicingOrg.Foundation\Hooks\CommonHooks.cs:line 31

Additional
We are unable to start any tests with a parameter is incorrect in StdIOTransport.cs:line 175. The issue seems to be encoding from the console. Although despite all Windows and Rider settings pointing to encoding that matches UTF-8 - we still seem to hit this. We can execute tests in run mode, but not in debug mode. There appears to be no obvious settings that have changed between Rider versions - but it is unclear where Playwright gets the encoding setting from. Out of 6 team members, only 1 can run in the latest Rider version.

Environment

System:
    OS: Windows 10 10.0.17763
    CPU: (4) x64 Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
    Memory: 7.24 GB / 16.00 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.26.1 - C:\Program Files\Microsoft VS Code\bin\code.CMD


Rider 2022.3.0
Rider 2023.3.4

Any guidance greatly appreciated.

Can you share a repro where it fails? @mxschmitt could it be related to the recent changes in the encoding?

Thanks @yury-s ,two files attached.

ExampleProject.zip
Sample project which is failing. NUnit 3 is targeted but the same happens for NUnit 4, so considered out of scope.

https://github.com/microsoft/playwright-dotnet/assets/137996986/45020233-266b-4bf2-9d61-e08d0064e9b8
A recording showing me debug a test in newer and older versions of Rider at the same time. Might be helpful.

Cheers