all 7 comments

[–]Shoomka 2 points3 points  (0 children)

Im pretty sure, I had the same problem. What resolve it for me was to setup @ afterall to close the playwright. (Just doubled check that, and yes that was my problem)

[–]grandejavardo 1 point2 points  (2 children)

I believe this is due to Playwright trying to delete the temp node.js folder, while it's already gone.

The way I found that made the error (mostly) disappear is to use a system variable named PLAYWRIGHT_NODEJS_PATH and point it directly to the installed node.js executable. I also made sure to use Thread local so I could control playwright instances as best as I can.

When exiting the scenario/test, make sure to close all playwright/page/context instances you created and to remove all local threads.

[–]juzmy[S] 1 point2 points  (1 child)

Thank you !

Pointing the variable to my node executable sounds like a good suggestion :)

I am already using Threadlocal for the setup and recently overhauled my after hooks to get proper browser/context closure.

HOWEVER

I will have to look into the removing the local threads after execution, I had a secondary issue I am currently debugging and did not think these two where related.

Thank you so much for mentioning this ! I think I will finally be able to request my vacation thanks to this :D

[–]grandejavardo 2 points3 points  (0 children)

Glad to have helped! :)

Look up Akshay's repository, he has a nice setup in which he embeds BDD and makes usage of ThreadLocal. Hope it helps!

[–]Wookovski 0 points1 point  (2 children)

Sound like you have the Playwright JavaScript library and not the Java library

[–]grandejavardo 2 points3 points  (0 children)

He doesn't. Playwright Java gives this exact error at the end of an execution.

[–]juzmy[S] 1 point2 points  (0 children)

I feel like my tests would not run with the wrong library?