microsoft / playwright-dotnet

.NET version of the Playwright testing and automation library.
https://playwright.dev/dotnet/
MIT License
2.47k stars 235 forks source link

[BUG] browser.closeAsync not working for remote connect #1784

Closed Archish27 closed 2 years ago

Archish27 commented 3 years ago

Context:

Code Snippet Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:

using System;
using System.Threading.Tasks;
using Microsoft.Playwright;

class Program
{
    public static async Task Main(string[] args)
    {
        using var playwright = await Playwright.CreateAsync();
        await using var browser = await playwright.Chromium.ConnectAsync("ws://127.0.0.1:9222/<url>");
        var page = await browser.NewPageAsync();
        await page.GotoAsync("https://playwright.dev/dotnet");
        await browser.CloseAsync();
    }
}

Describe the bug

browser doesn't close when closeAsync is called therefore test hangs. Works for LaunchAsync but not for ConnectAsyc

mxschmitt commented 2 years ago

Closing since there is no ConnectAsync in Playwright .NET.