Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(test runner): properly match test suffix (#7392)

Joel Einbindera1f9fc3f321a
diff --git a/src/test/workerRunner.ts b/src/test/workerRunner.ts
index d5ec484beb..34b8ab511a 100644
--- a/src/test/workerRunner.ts
+++ b/src/test/workerRunner.ts
@@ -184,7 +184,7 @@ export class WorkerRunner extends EventEmitter {
const testId = test._id;
const baseOutputDir = (() => {
- const relativeTestFilePath = path.relative(this._project.config.testDir, spec._requireFile.replace(/\.(spec|test)\.(js|ts|mjs)/, ''));
+ const relativeTestFilePath = path.relative(this._project.config.testDir, spec._requireFile.replace(/\.(spec|test)\.(js|ts|mjs)$/, ''));
const sanitizedRelativePath = relativeTestFilePath.replace(process.platform === 'win32' ? new RegExp('\\\\', 'g') : new RegExp('/', 'g'), '-');
let testOutputDir = sanitizedRelativePath + '-' + sanitizeForFilePath(spec.title);
if (this._uniqueProjectNamePathSegment)