I am currently building tests in playwright, we use playwright UI to run the tests.
Last week it was working fine, today, no changes have been made to the config file only changes to one of my spec files and one of my page files and now it’s as if playwright.config.js is not being read.. here is the current playwright.config.js:
// @ts-check
const { defineConfig, devices } = require('@playwright/test');
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();
/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
testDir: './tests-mark',
timeout: 240000,
expect:{
timeout: 240000
},
/* 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',
outputDir: 'test-results',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
trace: 'on',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
headless: true
// extraHTTPHeaders: {
// Authorization: '***'
// },
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: '***',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
},
/* Configure projects for major browsers */
projects: [
// {
// name: 'chromium',
// use: { ...devices['Desktop Chrome'] },
// },
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'Safari / webkit',
use: { ...devices['Desktop Safari'] },
},
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: '***',
// reuseExistingServer: !process.env.CI,
// },
});
and the file structure:
File Structure Screenshot
there have been no changes as i haven’t pulled anything down in the past week so it should just work like it did last week but now it says “No Tests” in playwright UI and in the projects tab there are no projects making me think it can’t see the config file as that has 3 projects in it.
how can i solve this?
I have closed and re-opened vsCode, I have tried npm install playwright to see if it had corrupted itself, neither of these things have fixed it.
I have made no changes so I would expect it to just work as it did last week