<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [1.26]</li>
<li>Operating System: [Ubuntu 20]</li>
<li>Browser: [Firefox]</li>
<li>Other info:</li>
<li>Also with latest version of browser and playwright, also in another machine with the same settings</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test, expect } from '@playwright/test';

test('firefox-test', async ({ page }) =&gt; {
  const contentHtml = `&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv=&quot;refresh&quot; content=&quot;0; URL='https://www.google.com'&quot; /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;Redirecting to Google...&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;`;

  await page.setContent(contentHtml, {
    waitUntil: 'domcontentloaded',
  });

  await page.pause();
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'firefox-test'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">contentHtml</span> <span class="pl-c1">=</span> <span class="pl-s">`&lt;!DOCTYPE html&gt;</span>
<span class="pl-s">  &lt;html&gt;</span>
<span class="pl-s">  &lt;head&gt;</span>
<span class="pl-s">    &lt;meta http-equiv="refresh" content="0; URL='https://www.google.com'" /&gt;</span>
<span class="pl-s">  &lt;/head&gt;</span>
<span class="pl-s">  &lt;body&gt;</span>
<span class="pl-s">    &lt;h1&gt;Redirecting to Google...&lt;/h1&gt;</span>
<span class="pl-s">  &lt;/body&gt;</span>
<span class="pl-s">  &lt;/html&gt;`</span><span class="pl-kos">;</span>

  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">setContent</span><span class="pl-kos">(</span><span class="pl-s1">contentHtml</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">waitUntil</span>: <span class="pl-s">'domcontentloaded'</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">pause</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
// @ts-check
const { devices } = require('@playwright/test');

/**
 * Read environment variables from file.
 * https://github.com/motdotla/dotenv
 */
// require('dotenv').config();

/**
 * @see https://playwright.dev/docs/test-configuration
 * @type {import('@playwright/test').PlaywrightTestConfig}
 */
const config = {
  testDir: './tests',
  /* Maximum time one test can run for. */
  timeout: 30 * 1000,
  expect: {
    /**
     * Maximum time expect() should wait for the condition to be met.
     * For example in `await expect(locator).toHaveText();`
     */
    timeout: 5000,
  },
  /* Run tests in files in parallel */
  fullyParallel: true,

  /* Fail the build on CI if you accidentally left test.only in the source code. */
  forbidOnly: !!process.env.CI,
  /* Retry on CI only */
  retries: process.env.CI ? 2 : 0,
  /* Opt out of parallel tests on CI. */
  workers: process.env.CI ? 1 : undefined,
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  reporter: 'html',
  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  use: {
    /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
    actionTimeout: 0,
    /* Base URL to use in actions like `await page.goto('/')`. */
    // baseURL: 'http://localhost:3000',

    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
    trace: 'on-first-retry',
    headless: false,
  },

  /* Configure projects for major browsers */
  projects: [
    {
      name: 'chromium',
      use: {
        ...devices['Desktop Chrome'],
      },
    },

    {
      name: 'firefox',
      use: {
        ...devices['Desktop Firefox'],
      },
    },

    {
      name: 'webkit',
      use: {
        ...devices['Desktop Safari'],
      },
    },

  ],
};

module.exports = config;
"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-c">// <span class="pl-k">@ts</span>-check</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> devices <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@playwright/test'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">/**</span>
<span class="pl-c"> * Read environment variables from file.</span>
<span class="pl-c"> * https://github.com/motdotla/dotenv</span>
<span class="pl-c"> */</span>
<span class="pl-c">// require('dotenv').config();</span>

<span class="pl-c">/**</span>
<span class="pl-c"> * <span class="pl-k">@see</span> https://playwright.dev/docs/test-configuration</span>
<span class="pl-c"> * <span class="pl-k">@type</span> {import('@playwright/test').PlaywrightTestConfig}</span>
<span class="pl-c"> */</span>
<span class="pl-k">const</span> <span class="pl-s1">config</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">testDir</span>: <span class="pl-s">'./tests'</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Maximum time one test can run for. */</span>
  <span class="pl-c1">timeout</span>: <span class="pl-c1">30</span> <span class="pl-c1">*</span> <span class="pl-c1">1000</span><span class="pl-kos">,</span>
  <span class="pl-c1">expect</span>: <span class="pl-kos">{</span>
    <span class="pl-c">/**</span>
<span class="pl-c">     * Maximum time expect() should wait for the condition to be met.</span>
<span class="pl-c">     * For example in `await expect(locator).toHaveText();`</span>
<span class="pl-c">     */</span>
    <span class="pl-c1">timeout</span>: <span class="pl-c1">5000</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Run tests in files in parallel */</span>
  <span class="pl-c1">fullyParallel</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Fail the build on CI if you accidentally left test.only in the source code. */</span>
  <span class="pl-c1">forbidOnly</span>: <span class="pl-c1">!</span><span class="pl-c1">!</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Retry on CI only */</span>
  <span class="pl-c1">retries</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span> ? <span class="pl-c1">2</span> : <span class="pl-c1">0</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Opt out of parallel tests on CI. */</span>
  <span class="pl-c1">workers</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span> ? <span class="pl-c1">1</span> : <span class="pl-c1">undefined</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Reporter to use. See https://playwright.dev/docs/test-reporters */</span>
  <span class="pl-c1">reporter</span>: <span class="pl-s">'html'</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */</span>
  <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
    <span class="pl-c">/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */</span>
    <span class="pl-c1">actionTimeout</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
    <span class="pl-c">/* Base URL to use in actions like `await page.goto('/')`. */</span>
    <span class="pl-c">// baseURL: 'http://localhost:3000',</span>

    <span class="pl-c">/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */</span>
    <span class="pl-c1">trace</span>: <span class="pl-s">'on-first-retry'</span><span class="pl-kos">,</span>
    <span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Configure projects for major browsers */</span>
  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
        ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'firefox'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
        ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Firefox'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'webkit'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
        ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Safari'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">config</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test, expect } from '@playwright/test';

test('firefox-test', async ({ page }) =&gt; {
  const contentHtml = `&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv=&quot;refresh&quot; content=&quot;0; URL='https://www.google.com'&quot; /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;Redirecting to Google...&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;`;

  await page.setContent(contentHtml, {
    waitUntil: 'domcontentloaded',
  });

  await page.pause();
});
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'firefox-test'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">contentHtml</span> <span class="pl-c1">=</span> <span class="pl-s">`&lt;!DOCTYPE html&gt;</span>
<span class="pl-s">  &lt;html&gt;</span>
<span class="pl-s">  &lt;head&gt;</span>
<span class="pl-s">    &lt;meta http-equiv="refresh" content="0; URL='https://www.google.com'" /&gt;</span>
<span class="pl-s">  &lt;/head&gt;</span>
<span class="pl-s">  &lt;body&gt;</span>
<span class="pl-s">    &lt;h1&gt;Redirecting to Google...&lt;/h1&gt;</span>
<span class="pl-s">  &lt;/body&gt;</span>
<span class="pl-s">  &lt;/html&gt;`</span><span class="pl-kos">;</span>

  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">setContent</span><span class="pl-kos">(</span><span class="pl-s1">contentHtml</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">waitUntil</span>: <span class="pl-s">'domcontentloaded'</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">pause</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>npx playwright uninstall --all</li>
<li>npm install @playwright/test@1.26</li>
<li>npx playwright install  firefox chromium</li>
<li>npx playwright test --project=firefox</li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
See Google's page</p>
<p dir="auto">[Describe expected behavior]<br>
<strong>See google's page with active javascript</strong></p>
<p dir="auto">[Describe actual behavior]</p>
<ul dir="auto">
<li>blank page with the html and JS code visible through inspection  tool,</li>
<li>title with the correct page</li>
<li>content blank<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/5399875/253279730-718ab7c7-1035-4c0c-80f8-475ad0c49d71.png"><img src="https://user-images.githubusercontent.com/5399875/253279730-718ab7c7-1035-4c0c-80f8-475ad0c49d71.png" alt="immagine" style="max-width: 100%;"></a></li>
</ul>
<p dir="auto">With Chromium and WebKit expected behavior is satisfied</p>
<p dir="auto">Checked for duplicate but all other issues with this error have been closed with no resolution.<br>
Whenever I attempt to run a test using "npx playwright test .\practiceTests\FirstTest.js"  an error is given that no tests are found.<br>
The test directory and file location have been verified and is correct. The file doesn't even appear in the testing folder, however when looking in my C drive files, the files exist.<br>
If I attempt to create a test file with "xxx.spec.js" it still doesn't find it. If the ".spec" is added, it at least appears in the testing menu with the play buttons and I can run from there, but the tests fail immediately with a browser closed error.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v. 1.6.2</li>
<li>Operating System: Windows 11</li>
<li>Browser: All</li>
<li>Other info:<br>
new installation of playwright</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto">Code used<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/44308197/224229811-d3d89c1a-5867-40ed-8b41-1748796c225d.png"><img src="https://user-images.githubusercontent.com/44308197/224229811-d3d89c1a-5867-40ed-8b41-1748796c225d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Correct testDir in config file<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/44308197/224230453-a8b282e2-bf7b-40a6-8441-0697a9adf3c9.png"><img src="https://user-images.githubusercontent.com/44308197/224230453-a8b282e2-bf7b-40a6-8441-0697a9adf3c9.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Error:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/44308197/224230512-8925ab78-4409-4214-be3c-eb594bf98b2d.png"><img src="https://user-images.githubusercontent.com/44308197/224230512-8925ab78-4409-4214-be3c-eb594bf98b2d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Test only appears in Testing section of VS code if the ".spec" is added to the file name<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/44308197/224232098-f1dc706e-ef1f-4c6f-b000-04c21aee01e8.png"><img src="https://user-images.githubusercontent.com/44308197/224232098-f1dc706e-ef1f-4c6f-b000-04c21aee01e8.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">The files are in the correct location, the correct file path is being used so the tests should be found.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Error given that no test files found</p>