Skip to content

[BUG] - Electron hangs closing the context #13874

Closed

Description

Context:

  • Playwright Version: 1.20
  • Operating System: Windows 11
  • Node.js version: v16.13.0
  • Browser: ELECTRON

I use playwright to test both browser and electron.
application is created with vue, vite and electron 18.2.0, and i cannot share sources in a repo for this issue.
test is the same on browser and on electron,
on browser,
browser is opened with this


const browserContext = await webBrowser.newContext({
            locale: language,
            recordVideo: {
                dir: 'browser-videos/',
                size: { width: 640, height: 480 },
            },
            recordHar:{
                path:"browser-network.har"
            }
        })

application = await browserContext.newPage()      

on electron , electron is opened with this


const electronApp = await electron.launch({
recordVideo: {
        dir:"./electron-test-run-videos",
        size:{
            width:1280,
            height:720
        }
    },
    recordHar:{
        path:"electron-network.har"
    }
})
application = electronApp.firstWindow
 

due i want to store the har, has documented, i need to close the context.
So at the end of the test, i do

await application.context().close
await application.close

Describe the bug

  • with browser, it works: i close the context and the har file is generated.
  • with electron, if i don't close the contest, test pass but har file is not generated.

image

  • with electron, test hangs waiting until general timeout closing the context without trhow any exception, and at the end, the har file is generated.

image

Activity

  1. dgozman commented on May 3, 2022

    @dgozman
    Collaborator

    Andrea Bisello (@andreabisello) Unfortunately, it is hard to help without a repro. Try disabling videos - does that help? Perhaps try using a different electron version if possible, just to see whether it is related?

  2. andreabisello commented on May 9, 2022

    @andreabisello
    Author

    Dmitry Gozman (@dgozman) sorry i never see the notification. i'll try deactivating video and updating versions. thanks.

  3. mxschmitt commented on May 16, 2022

    @mxschmitt
    Contributor

    Andrea Bisello (@andreabisello) are you able to share with us a minimal reproducible? Otherwise we can't act on it unfortunately.

  4. andreabisello commented on May 16, 2022

    @andreabisello
    Author

    i'm so sorry, i cannot in this time :( i will try updating versions and when i could publish a demo version i'll update this issue again.

  5. rwoll commented on May 21, 2022

    @rwoll
    Member

    Closing for now, but if you do happen to find a repro you can share, please file a new issue that references this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions