Issue 1:
System info

Playwright Version: [1.26]

Operating System: [Ubuntu 20]

Browser: [Firefox]

Other info:

Also with latest version of browser and playwright, also in another machine with the same settings

Source code

I provided exact source code that allows reproducing the issue locally.

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

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

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

await page.pause();
});

Config file

// 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;

Test file (self-contained)

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

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

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

await page.pause();
});

Steps

npx playwright uninstall --all

npm install @playwright/test@1.26

npx playwright install firefox chromium

npx playwright test --project=firefox

Expected

See Google's page

[Describe expected behavior]

See google's page with active javascript

[Describe actual behavior]

blank page with the html and JS code visible through inspection tool,

title with the correct page

content blank

With Chromium and WebKit expected behavior is satisfied

Issue 2:
Checked for duplicate but all other issues with this error have been closed with no resolution.

Whenever I attempt to run a test using "npx playwright test .\practiceTests\FirstTest.js" an error is given that no tests are found.

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.

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.

System info

Playwright Version: v. 1.6.2

Operating System: Windows 11

Browser: All

Other info:

new installation of playwright

Source code

Code used

Correct testDir in config file

Error:

Test only appears in Testing section of VS code if the ".spec" is added to the file name

Expected

The files are in the correct location, the correct file path is being used so the tests should be found.

Actual

Error given that no test files found