@@ -24,8 +24,11 @@ import { TestServer } from '../utils/testserver';
24
24
import { Connection } from '../lib/client/connection' ;
25
25
import { Transport } from '../lib/protocol/transport' ;
26
26
import { installCoverageHooks } from './coverage' ;
27
- import { fixtures as baseFixtures } from '@playwright/test-runner' ;
27
+ import { fixtures as baseFixtures , config } from '@playwright/test-runner' ;
28
28
import assert from 'assert' ;
29
+ import { expect } from '@playwright/test' ;
30
+ export { expect } from '@playwright/test' ;
31
+ export { config } from '@playwright/test-runner' ;
29
32
30
33
const mkdtempAsync = util . promisify ( fs . mkdtemp ) ;
31
34
const removeFolderAsync = util . promisify ( require ( 'rimraf' ) ) ;
@@ -83,7 +86,6 @@ export const beforeEach = fixtures.beforeEach;
83
86
export const afterEach = fixtures . afterEach ;
84
87
export const beforeAll = fixtures . beforeAll ;
85
88
export const afterAll = fixtures . afterAll ;
86
- export const expect = fixtures . expect ;
87
89
88
90
export const options = {
89
91
CHROMIUM : ( parameters : PlaywrightParameters ) => parameters . browserName === 'chromium' ,
@@ -127,7 +129,7 @@ const getExecutablePath = browserName => {
127
129
return process . env . WKPATH ;
128
130
} ;
129
131
130
- defineWorkerFixture ( 'defaultBrowserOptions' , async ( { browserName, testConfig } , runTest ) => {
132
+ defineWorkerFixture ( 'defaultBrowserOptions' , async ( { browserName } , runTest ) => {
131
133
const executablePath = getExecutablePath ( browserName ) ;
132
134
if ( executablePath )
133
135
console . error ( `Using executable at ${ executablePath } ` ) ;
@@ -136,7 +138,7 @@ defineWorkerFixture('defaultBrowserOptions', async ({ browserName, testConfig },
136
138
slowMo : options . SLOW_MO ,
137
139
headless : options . HEADLESS ,
138
140
executablePath,
139
- artifactsPath : testConfig . outputDir ,
141
+ artifactsPath : config . outputDir ,
140
142
} ) ;
141
143
} ) ;
142
144
@@ -261,9 +263,9 @@ defineWorkerFixture('expectedSSLError', async ({browserName, platform}, runTest)
261
263
} ) ;
262
264
263
265
defineTestFixture ( 'testOutputDir' , async ( { testInfo } , runTest ) => {
264
- const relativePath = path . relative ( testInfo . config . testDir , testInfo . file ) . replace ( / \. s p e c \. [ j t ] s / , '' ) ;
266
+ const relativePath = path . relative ( config . testDir , testInfo . file ) . replace ( / \. s p e c \. [ j t ] s / , '' ) ;
265
267
const sanitizedTitle = testInfo . title . replace ( / [ ^ \w \d ] + / g, '_' ) ;
266
- const testOutputDir = path . join ( testInfo . config . outputDir , relativePath , sanitizedTitle ) ;
268
+ const testOutputDir = path . join ( config . outputDir , relativePath , sanitizedTitle ) ;
267
269
await fs . promises . mkdir ( testOutputDir , { recursive : true } ) ;
268
270
await runTest ( testOutputDir ) ;
269
271
const files = await fs . promises . readdir ( testOutputDir ) ;
@@ -274,9 +276,9 @@ defineTestFixture('testOutputDir', async ({ testInfo }, runTest) => {
274
276
}
275
277
} ) ;
276
278
277
- defineTestFixture ( 'context' , async ( { browser, testOutputDir, testConfig } , runTest ) => {
279
+ defineTestFixture ( 'context' , async ( { browser, testOutputDir } , runTest ) => {
278
280
const contextOptions : BrowserContextOptions = {
279
- relativeArtifactsPath : path . relative ( testConfig . outputDir , testOutputDir ) ,
281
+ relativeArtifactsPath : path . relative ( config . outputDir , testOutputDir ) ,
280
282
recordTrace : ! ! options . TRACING ,
281
283
recordVideos : ! ! options . TRACING ,
282
284
} ;
0 commit comments