Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when test is extended to create a browser fixture #172

Open
guxx0014 opened this issue Nov 23, 2024 · 1 comment
Open

Error when test is extended to create a browser fixture #172

guxx0014 opened this issue Nov 23, 2024 · 1 comment

Comments

@guxx0014
Copy link

I have extended test from playwright-test-coverage to define a browser fixture. But I run into an error:

    Error: page.evaluate: TypeError: callbacks.set is not a function
    
        at <anonymous>:24:64
        at new Promise (<anonymous>)
        at globalThis.<computed> (<anonymous>:24:21)
        at eval (eval at evaluate (:234:30), <anonymous>:2:16)
        at UtilityScript.evaluate (<anonymous>:236:17)
        at UtilityScript.<anonymous> (<anonymous>:1:44)

I found that it can be avoided by just adding a closure to the callback function of page.evaluate:

await page.evaluate(() => {
    window.collectIstanbulCoverage(JSON.stringify(window.__coverage__));
});
@guxx0014
Copy link
Author

I have created a pull request: #173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant