@playwright/test
Advanced tools
Comparing version 1.12.0-next-alpha-jun-8-2021 to 1.12.0
@@ -11,8 +11,8 @@ { | ||
"name": "firefox", | ||
"revision": "1268", | ||
"revision": "1269", | ||
"installByDefault": true | ||
}, | ||
{ | ||
"name": "firefox-stable", | ||
"revision": "1259", | ||
"name": "firefox-beta", | ||
"revision": "1260", | ||
"installByDefault": false | ||
@@ -19,0 +19,0 @@ }, |
@@ -56,4 +56,4 @@ "use strict"; | ||
let executablePath = undefined; | ||
if (channel === 'firefox-stable') | ||
executablePath = this._registry.executablePath('firefox-stable'); | ||
if (channel === 'firefox-beta') | ||
executablePath = this._registry.executablePath('firefox-beta'); | ||
utils_1.assert(executablePath, `unsupported firefox channel "${channel}"`); | ||
@@ -60,0 +60,0 @@ utils_1.assert(fs_1.default.existsSync(executablePath), `"${channel}" channel is not installed. Try running 'npx playwright install ${channel}'`); |
@@ -67,3 +67,3 @@ "use strict"; | ||
'firefox': [], | ||
'firefox-stable': [], | ||
'firefox-beta': [], | ||
'clank': [], | ||
@@ -70,0 +70,0 @@ 'ffmpeg': [], |
@@ -140,4 +140,4 @@ "use strict"; | ||
// No --config option, let's look for the config file in the current directory. | ||
// If not, do not assume that current directory is a root testing directory, to avoid scanning the world. | ||
throw new Error(`Configuration file not found. Run "npx playwright test --help" for more information.`); | ||
// If not, scan the world. | ||
runner.loadEmptyConfig(process.cwd()); | ||
} | ||
@@ -144,0 +144,0 @@ const result = await runner.run(!!opts.list, args.map(forceRegExp), opts.project || undefined); |
@@ -39,2 +39,3 @@ "use strict"; | ||
const fs = __importStar(require("fs")); | ||
const path = __importStar(require("path")); | ||
const testType_1 = require("./testType"); | ||
@@ -68,2 +69,3 @@ var expect_1 = require("./expect"); | ||
video: 'off', | ||
trace: 'off', | ||
acceptDownloads: undefined, | ||
@@ -89,3 +91,3 @@ bypassCSP: undefined, | ||
contextOptions: {}, | ||
context: async ({ browser, screenshot, video, acceptDownloads, bypassCSP, colorScheme, deviceScaleFactor, extraHTTPHeaders, hasTouch, geolocation, httpCredentials, ignoreHTTPSErrors, isMobile, javaScriptEnabled, locale, offline, permissions, proxy, storageState, viewport, timezoneId, userAgent, contextOptions }, use, testInfo) => { | ||
context: async ({ browser, screenshot, trace, video, acceptDownloads, bypassCSP, colorScheme, deviceScaleFactor, extraHTTPHeaders, hasTouch, geolocation, httpCredentials, ignoreHTTPSErrors, isMobile, javaScriptEnabled, locale, offline, permissions, proxy, storageState, viewport, timezoneId, userAgent, contextOptions }, use, testInfo) => { | ||
testInfo.snapshotSuffix = process.platform; | ||
@@ -141,4 +143,17 @@ if (process.env.PWDEBUG) | ||
context.on('page', page => allPages.push(page)); | ||
const collectingTrace = trace === 'on' || trace === 'retain-on-failure' || (trace === 'retry-with-trace' && testInfo.retry); | ||
if (collectingTrace) { | ||
const name = path.relative(testInfo.project.outputDir, testInfo.outputDir).replace(/[\/\\]/g, '-'); | ||
await context.tracing.start({ name, screenshots: true, snapshots: true }); | ||
} | ||
await use(context); | ||
const testFailed = testInfo.status !== testInfo.expectedStatus; | ||
const saveTrace = trace === 'on' || (testFailed && trace === 'retain-on-failure') || (trace === 'retry-with-trace' && testInfo.retry); | ||
if (saveTrace) { | ||
const tracePath = testInfo.outputPath(`trace.zip`); | ||
await context.tracing.stop({ path: tracePath }); | ||
} | ||
else if (collectingTrace) { | ||
await context.tracing.stop(); | ||
} | ||
if (screenshot === 'on' || (screenshot === 'only-on-failure' && testFailed)) { | ||
@@ -145,0 +160,0 @@ await Promise.all(allPages.map((page, index) => { |
@@ -48,3 +48,3 @@ "use strict"; | ||
const utils_1 = require("./utils"); | ||
exports.allBrowserNames = new Set(['chromium', 'webkit', 'firefox', 'ffmpeg', 'webkit-technology-preview', 'firefox-stable']); | ||
exports.allBrowserNames = new Set(['chromium', 'webkit', 'firefox', 'ffmpeg', 'webkit-technology-preview', 'firefox-beta']); | ||
const PACKAGE_PATH = path_1.default.join(__dirname, '..', '..'); | ||
@@ -74,3 +74,3 @@ const EXECUTABLE_PATHS = { | ||
}, | ||
'firefox-stable': { | ||
'firefox-beta': { | ||
'ubuntu18.04': ['firefox', 'firefox'], | ||
@@ -143,12 +143,12 @@ 'ubuntu20.04': ['firefox', 'firefox'], | ||
}, | ||
'firefox-stable': { | ||
'ubuntu18.04': '%s/builds/firefox-stable/%s/firefox-stable-ubuntu-18.04.zip', | ||
'ubuntu20.04': '%s/builds/firefox-stable/%s/firefox-stable-ubuntu-20.04.zip', | ||
'mac10.13': '%s/builds/firefox-stable/%s/firefox-stable-mac-10.14.zip', | ||
'mac10.14': '%s/builds/firefox-stable/%s/firefox-stable-mac-10.14.zip', | ||
'mac10.15': '%s/builds/firefox-stable/%s/firefox-stable-mac-10.14.zip', | ||
'mac11': '%s/builds/firefox-stable/%s/firefox-stable-mac-10.14.zip', | ||
'mac11-arm64': '%s/builds/firefox-stable/%s/firefox-stable-mac-11.0-arm64.zip', | ||
'win32': '%s/builds/firefox-stable/%s/firefox-stable-win32.zip', | ||
'win64': '%s/builds/firefox-stable/%s/firefox-stable-win64.zip', | ||
'firefox-beta': { | ||
'ubuntu18.04': '%s/builds/firefox-beta/%s/firefox-beta-ubuntu-18.04.zip', | ||
'ubuntu20.04': '%s/builds/firefox-beta/%s/firefox-beta-ubuntu-20.04.zip', | ||
'mac10.13': '%s/builds/firefox-beta/%s/firefox-beta-mac-10.14.zip', | ||
'mac10.14': '%s/builds/firefox-beta/%s/firefox-beta-mac-10.14.zip', | ||
'mac10.15': '%s/builds/firefox-beta/%s/firefox-beta-mac-10.14.zip', | ||
'mac11': '%s/builds/firefox-beta/%s/firefox-beta-mac-10.14.zip', | ||
'mac11-arm64': '%s/builds/firefox-beta/%s/firefox-beta-mac-11.0-arm64.zip', | ||
'win32': '%s/builds/firefox-beta/%s/firefox-beta-win32.zip', | ||
'win64': '%s/builds/firefox-beta/%s/firefox-beta-win64.zip', | ||
}, | ||
@@ -313,3 +313,3 @@ 'webkit': { | ||
case 'firefox': | ||
case 'firefox-stable': | ||
case 'firefox-beta': | ||
return [path_1.default.join(browserDirectory, 'firefox')]; | ||
@@ -341,3 +341,3 @@ default: | ||
'firefox': 'PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST', | ||
'firefox-stable': 'PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST', | ||
'firefox-beta': 'PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST', | ||
'webkit': 'PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST', | ||
@@ -344,0 +344,0 @@ 'webkit-technology-preview': 'PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST', |
{ | ||
"name": "@playwright/test", | ||
"version": "1.12.0-next-alpha-jun-8-2021", | ||
"version": "1.12.0", | ||
"description": "Playwright Test Runner", | ||
@@ -5,0 +5,0 @@ "repository": "github:Microsoft/playwright", |
@@ -965,2 +965,11 @@ /** | ||
/** | ||
* Whether to record trace for each test, off by default. | ||
* - `off`: Do not record trace. | ||
* - `on`: Record trace for each test. | ||
* - `retain-on-failure`: Record trace for each test, but remove trace from successful test run. | ||
* - `retry-with-trace`: Record trace only when retrying a test. | ||
*/ | ||
trace: 'off' | 'on' | 'retain-on-failure' | 'retry-with-trace'; | ||
/** | ||
* Whether to record video for each test, off by default. | ||
@@ -967,0 +976,0 @@ * - `off`: Do not record video. |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7719962
134659
0