@playwright/test
Advanced tools
Comparing version 1.13.0-next-1626474230000 to 1.13.0-next-1626500095000
@@ -112,3 +112,3 @@ "use strict"; | ||
async run(list, filePatternFilters, projectName) { | ||
this._reporter = await this._createReporter(); | ||
this._reporter = list ? new ListModeReporter() : await this._createReporter(); | ||
@@ -476,2 +476,22 @@ const config = this._loader.fullConfig(); | ||
} | ||
class ListModeReporter { | ||
onBegin(config, suite) { | ||
console.log(`Listing tests:`); | ||
const tests = suite.allTests(); | ||
const files = new Set(); | ||
for (const test of tests) { | ||
// root, project, file, ...describes, test | ||
const [, projectName,, ...titles] = test.titlePath(); | ||
const location = `${path.relative(config.rootDir, test.location.file)}:${test.location.line}:${test.location.column}`; | ||
const projectTitle = projectName ? `[${projectName}] › ` : ''; | ||
console.log(` ${projectTitle}${location} › ${titles.join(' ')}`); | ||
files.add(test.location.file); | ||
} | ||
console.log(`Total: ${tests.length} ${tests.length === 1 ? 'test' : 'tests'} in ${files.size} ${files.size === 1 ? 'file' : 'files'}`); | ||
} | ||
} | ||
//# sourceMappingURL=runner.js.map |
@@ -141,3 +141,2 @@ "use strict"; | ||
status() { | ||
// List mode bail out. | ||
if (!this.results.length) return 'skipped'; | ||
@@ -144,0 +143,0 @@ if (this.results.length === 1 && this.expectedStatus === this.results[0].status) return this.expectedStatus === 'skipped' ? 'skipped' : 'expected'; |
@@ -12,3 +12,3 @@ "use strict"; | ||
get: function () { | ||
return _reporter.Location; | ||
return _testReporter.Location; | ||
} | ||
@@ -31,3 +31,3 @@ }); | ||
var _reporter = require("./reporter"); | ||
var _testReporter = require("../../types/testReporter"); | ||
//# sourceMappingURL=types.js.map |
@@ -241,6 +241,10 @@ "use strict"; | ||
const executablePathOrDie = (name, e) => { | ||
const executablePathOrDie = (name, e, installByDefault) => { | ||
if (!e) throw new Error(`${name} is not supported on ${_utils.hostPlatform}`); // TODO: language-specific error message | ||
if (!(0, _utils.canAccessFile)(e)) throw new Error(`Executable doesn't exist at ${e}\nRun "npx playwright install ${name}"`); | ||
if (!(0, _utils.canAccessFile)(e)) { | ||
const prettyMessage = [`Looks like Playwright Test or Playwright was just installed or updated.`, `Please run the following command to download new browser${installByDefault ? 's' : ''}:`, ``, ` npx playwright install${installByDefault ? '' : ' ' + name}`, ``, `<3 Playwright Team`].join('\n'); | ||
throw new Error(`Executable doesn't exist at ${e}\n${(0, _utils.wrapInASCIIBox)(prettyMessage, 1)}`); | ||
} | ||
return e; | ||
@@ -259,3 +263,3 @@ }; | ||
executablePath: () => chromiumExecutable, | ||
executablePathOrDie: () => executablePathOrDie('chromium', chromiumExecutable), | ||
executablePathOrDie: () => executablePathOrDie('chromium', chromiumExecutable, chromium.installByDefault), | ||
installType: chromium.installByDefault ? 'download-by-default' : 'download-on-demand', | ||
@@ -276,3 +280,3 @@ validateHostRequirements: () => this._validateHostRequirements('chromium', chromium.dir, ['chrome-linux'], [], ['chrome-win']), | ||
executablePath: () => chromiumWithSymbolsExecutable, | ||
executablePathOrDie: () => executablePathOrDie('chromium-with-symbols', chromiumWithSymbolsExecutable), | ||
executablePathOrDie: () => executablePathOrDie('chromium-with-symbols', chromiumWithSymbolsExecutable, chromiumWithSymbols.installByDefault), | ||
installType: chromiumWithSymbols.installByDefault ? 'download-by-default' : 'download-on-demand', | ||
@@ -361,3 +365,3 @@ validateHostRequirements: () => this._validateHostRequirements('chromium', chromiumWithSymbols.dir, ['chrome-linux'], [], ['chrome-win']), | ||
executablePath: () => firefoxExecutable, | ||
executablePathOrDie: () => executablePathOrDie('firefox', firefoxExecutable), | ||
executablePathOrDie: () => executablePathOrDie('firefox', firefoxExecutable, firefox.installByDefault), | ||
installType: firefox.installByDefault ? 'download-by-default' : 'download-on-demand', | ||
@@ -378,3 +382,3 @@ validateHostRequirements: () => this._validateHostRequirements('firefox', firefox.dir, ['firefox'], [], ['firefox']), | ||
executablePath: () => firefoxBetaExecutable, | ||
executablePathOrDie: () => executablePathOrDie('firefox-beta', firefoxBetaExecutable), | ||
executablePathOrDie: () => executablePathOrDie('firefox-beta', firefoxBetaExecutable, firefoxBeta.installByDefault), | ||
installType: firefoxBeta.installByDefault ? 'download-by-default' : 'download-on-demand', | ||
@@ -396,3 +400,3 @@ validateHostRequirements: () => this._validateHostRequirements('firefox', firefoxBeta.dir, ['firefox'], [], ['firefox']), | ||
executablePath: () => webkitExecutable, | ||
executablePathOrDie: () => executablePathOrDie('webkit', webkitExecutable), | ||
executablePathOrDie: () => executablePathOrDie('webkit', webkitExecutable, webkit.installByDefault), | ||
installType: webkit.installByDefault ? 'download-by-default' : 'download-on-demand', | ||
@@ -413,3 +417,3 @@ validateHostRequirements: () => this._validateHostRequirements('webkit', webkit.dir, webkitLinuxLddDirectories, ['libGLESv2.so.2', 'libx264.so'], ['']), | ||
executablePath: () => ffmpegExecutable, | ||
executablePathOrDie: () => executablePathOrDie('ffmpeg', ffmpegExecutable), | ||
executablePathOrDie: () => executablePathOrDie('ffmpeg', ffmpegExecutable, ffmpeg.installByDefault), | ||
installType: ffmpeg.installByDefault ? 'download-by-default' : 'download-on-demand', | ||
@@ -416,0 +420,0 @@ validateHostRequirements: () => Promise.resolve(), |
@@ -32,2 +32,3 @@ "use strict"; | ||
exports.constructURLBasedOnBaseURL = constructURLBasedOnBaseURL; | ||
exports.wrapInASCIIBox = wrapInASCIIBox; | ||
exports.hostPlatform = exports.existsAsync = void 0; | ||
@@ -431,2 +432,8 @@ | ||
exports.hostPlatform = hostPlatform; | ||
function wrapInASCIIBox(text, padding = 0) { | ||
const lines = text.split('\n'); | ||
const maxLength = Math.max(...lines.map(line => line.length)); | ||
return ['╔' + '═'.repeat(maxLength + padding * 2) + '╗', ...lines.map(line => '║' + ' '.repeat(padding) + line + ' '.repeat(maxLength - line.length + padding) + '║'), '╚' + '═'.repeat(maxLength + padding * 2) + '╝'].join('\n'); | ||
} | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@playwright/test", | ||
"version": "1.13.0-next-1626474230000", | ||
"version": "1.13.0-next-1626500095000", | ||
"description": "Playwright Test", | ||
@@ -5,0 +5,0 @@ "repository": "github:Microsoft/playwright", |
Sorry, the diff of this file is not supported yet
7641234
266
136531