Reputation: 1
In one of my projects I am running the playwright tests on ubuntu Wsl2 because the project was initially set up for unix systems and I cannot run the playwright tests on windows without changing all the scripts of the project.
When I try to run a specific test with playwright, the test starts, it can only visit the url localhost:3000, but the browser does not render anything and the tests fail. The browser is in windows. When I try to run the project, everything runs perfectly fine, meaning everything renders as it is supposed to.
I have tried exporting the ip address of the host as the DISPLAY variable and xserver. Doesn't work. I tried opening vscode on windows and opening the ubuntu wsl2 terminal, it doesn't work. tried 127.0.0.1:3000, 127.0.1.1:3000, localhost:3000, don't work.
nvm 0.39.3, npm 10.2.3, wsl2, ubuntu 22.04.4 wsl2, windows 11.
I run npx playwright test name-of-file.test.ts and it starts running. It goes to await await page.goto('http://localhost:3000'); but when it tries to hit any of the components of the website/browser, it doesn't since the browser when it opens up, is empty, blank white.
Upvotes: 0
Views: 508