Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Console.WriteLine of 2nd and onwards test is not shown #4728

@mxschmitt

Description

@mxschmitt

Reproduction:

  1. https://github.com/mxschmitt/nunit-repro-2nd-console-write-not-working
  2. dotnet build
  3. pwsh bin/Debug/net8.0/playwright.ps1 install chromium
  4. dotnet test

Expected:

Listener() - Test: TC1 with URL: https://example.com/
Expected: 1 - Actual: 1

Listener() - Test: TC2 with URL: https://example.com/
Expected: 2 - Actual: 2


Passed!  - Failed:     0, Passed:     2, Skipped:     0, Total:     2, Duration: 2 s - PlaywrightTestsNUnit.dll (net8.0)

Actual:

(second Listener() line is missing)

Listener() - Test: TC1 with URL: https://example.com/
Expected: 1 - Actual: 1

Expected: 2 - Actual: 2
Why is the 2nd Listener() call not printed to the Console?


Passed!  - Failed:     0, Passed:     2, Skipped:     0, Total:     2, Duration: 2 s - PlaywrightTestsNUnit.dll (net8.0)

Note:

Console.WriteLine is not working for the second test, if I change it to Console.Error.WriteLine it works.

I was trying to get a reproduction without Playwright so far, bug I failed so far (we dispatch events, so not sure what we would do different there).

Downstream bug:

microsoft/playwright-dotnet#2945

Metadata

Metadata

Assignees

No one assigned

    Labels

    InvestigateWe will look into this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions