mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
parent
e10cb4a619
commit
42876a0528
@ -325,6 +325,8 @@ const debugEnv = getFromENV('PWDEBUG') || '';
|
|||||||
export function debugMode() {
|
export function debugMode() {
|
||||||
if (debugEnv === 'console')
|
if (debugEnv === 'console')
|
||||||
return 'console';
|
return 'console';
|
||||||
|
if (debugEnv === '0' || debugEnv === 'false')
|
||||||
|
return '';
|
||||||
return debugEnv ? 'inspector' : '';
|
return debugEnv ? 'inspector' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import * as path from 'path';
|
|||||||
import type { LaunchOptions, BrowserContextOptions, Page, BrowserContext, BrowserType, Video, Browser, APIRequestContext } from 'playwright-core';
|
import type { LaunchOptions, BrowserContextOptions, Page, BrowserContext, BrowserType, Video, Browser, APIRequestContext } from 'playwright-core';
|
||||||
import type { TestType, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestInfo } from '../types/test';
|
import type { TestType, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestInfo } from '../types/test';
|
||||||
import { rootTestType } from './testType';
|
import { rootTestType } from './testType';
|
||||||
import { createGuid, removeFolders } from 'playwright-core/lib/utils/utils';
|
import { createGuid, removeFolders, debugMode } from 'playwright-core/lib/utils/utils';
|
||||||
import { GridClient } from 'playwright-core/lib/grid/gridClient';
|
import { GridClient } from 'playwright-core/lib/grid/gridClient';
|
||||||
import { prependToTestError } from './util';
|
import { prependToTestError } from './util';
|
||||||
export { expect } from './expect';
|
export { expect } from './expect';
|
||||||
@ -190,7 +190,7 @@ export const test = _baseTest.extend<TestFixtures, WorkerFixtures>({
|
|||||||
|
|
||||||
_setupContextOptionsAndArtifacts: [async ({ playwright, _snapshotSuffix, _combinedContextOptions, _artifactsDir, trace, screenshot, actionTimeout, navigationTimeout }, use, testInfo) => {
|
_setupContextOptionsAndArtifacts: [async ({ playwright, _snapshotSuffix, _combinedContextOptions, _artifactsDir, trace, screenshot, actionTimeout, navigationTimeout }, use, testInfo) => {
|
||||||
testInfo.snapshotSuffix = _snapshotSuffix;
|
testInfo.snapshotSuffix = _snapshotSuffix;
|
||||||
if (process.env.PWDEBUG)
|
if (debugMode())
|
||||||
testInfo.setTimeout(0);
|
testInfo.setTimeout(0);
|
||||||
|
|
||||||
let traceMode = typeof trace === 'string' ? trace : trace.mode;
|
let traceMode = typeof trace === 'string' ? trace : trace.mode;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user