Rayrun
โ† Back to Discord Forum

Playwright Test for VSCODE: No test have been found in this workspace yet

Greetings, I have installed the Playwright extension in VS CODE but it does not work when I want to use some functionality of the testing menu it tells me "No Playwright tests found".

image.png

This thread is trying to answer question "Why does the Playwright extension in VS CODE show 'No Playwright tests found' despite having the latest versions of all required software?"

29 replies
code42thomas
code42thomas
image.png
code42thomas
code42thomas

did you try this ?

Yes sir

image.png
code42thomas
code42thomas

i don't know why this happen :/ sorry (and sorry for my bad english xD)

what's your language?

code42thomas
code42thomas

French

oh cool hahahah, dont be a problem i am spanish

code42thomas
code42thomas

x)

It is quite strange, I have tried to have the latest version of playwright, the latest version of the extension, node, VS CODE and still nothing.

and my playwright can run test without problems

code42thomas
code42thomas

and from a vanilla directory ?

code42thomas
code42thomas

oh

vanilla? explain

example:

image.png
code42thomas
code42thomas

new directory and npm init playwright@latest

code42thomas
code42thomas

and after try to launch test from extension

yeah i tried, in 3 directorys diferents

code42thomas
code42thomas

x)

code42thomas
code42thomas

I have no other idea how to solve your problem, sorry ๐Ÿ˜ฆ

no problem, thanks for try

code42thomas
code42thomas

^^

@code42thomas

sorry but i think i find the problem

when i press reload, in the extesion update the runtime status

image.png
code42thomas
code42thomas

seems config file missing oO ?

this?

image.png

Or the plug in is messed up...? The Uncaught errors should be fixed... Why?? But wouldn't expect anything till that is fixed... Can't assume platform/OS... Seems like powershell. Installed with admin??? I'm a version back, but no errors. Need to get other teams to agree on updating PW...

image.png

no changes with the version 1.0.14

image.png

Answer

Troubleshooting 'No Playwright tests found' in VS Code

If you're seeing "No Playwright tests found" in VS Code, don't worry. Here are some steps you can take to resolve this issue.

Check Your Playwright Extension

First, make sure you've installed and activated the Playwright extension in VS Code. You can find it in the marketplace or the extensions tab.

Generate Playwright Tests

Next, you need to generate some tests using Playwright Test. This tool supports all modern rendering engines, including Chromium, WebKit, and Firefox. Here's how you can generate a test:

import { test } from '@playwright/test';

test('basic test', async ({ page }) => {
  await page.goto('https://ray.run/');
  const title = page.title();
  expect(title).toBe('Ray');
});

Configure Your Tests

Make sure your tests are correctly set up in the playwright.config.ts file. Here, you can specify which browser or device to use for testing.

import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
  projects: [
    {
      name: 'Chromium',
      use: { browserName: 'chromium' },
    },
  ],
};

export default config;

Use TypeScript

Ensure your test files have a .ts extension. TypeScript is supported out of the box with Playwright, and it provides better IDE integration.

Check Your Project Structure

If you're still seeing the message, check your project structure and test file locations. Make sure they align with the best practices recommended by Playwright.

Look for Errors

Finally, check for any errors or warnings in VS Code. There might be issues in your code that prevent the detection of Playwright tests.

If you're still having trouble, check out the official Playwright documentation or the Playwright community for further support.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].