@@ -24,8 +24,11 @@ import { TestServer } from '../utils/testserver';
2424import { Connection } from '../lib/client/connection' ;
2525import { Transport } from '../lib/protocol/transport' ;
2626import { installCoverageHooks } from './coverage' ;
27- import { fixtures as baseFixtures } from '@playwright/test-runner' ;
27+ import { fixtures as baseFixtures , config } from '@playwright/test-runner' ;
2828import assert from 'assert' ;
29+ import { expect } from '@playwright/test' ;
30+ export { expect } from '@playwright/test' ;
31+ export { config } from '@playwright/test-runner' ;
2932
3033const mkdtempAsync = util . promisify ( fs . mkdtemp ) ;
3134const removeFolderAsync = util . promisify ( require ( 'rimraf' ) ) ;
@@ -83,7 +86,6 @@ export const beforeEach = fixtures.beforeEach;
8386export const afterEach = fixtures . afterEach ;
8487export const beforeAll = fixtures . beforeAll ;
8588export const afterAll = fixtures . afterAll ;
86- export const expect = fixtures . expect ;
8789
8890export const options = {
8991 CHROMIUM : ( parameters : PlaywrightParameters ) => parameters . browserName === 'chromium' ,
@@ -127,7 +129,7 @@ const getExecutablePath = browserName => {
127129 return process . env . WKPATH ;
128130} ;
129131
130- defineWorkerFixture ( 'defaultBrowserOptions' , async ( { browserName, testConfig } , runTest ) => {
132+ defineWorkerFixture ( 'defaultBrowserOptions' , async ( { browserName } , runTest ) => {
131133 const executablePath = getExecutablePath ( browserName ) ;
132134 if ( executablePath )
133135 console . error ( `Using executable at ${ executablePath } ` ) ;
@@ -136,7 +138,7 @@ defineWorkerFixture('defaultBrowserOptions', async ({ browserName, testConfig },
136138 slowMo : options . SLOW_MO ,
137139 headless : options . HEADLESS ,
138140 executablePath,
139- artifactsPath : testConfig . outputDir ,
141+ artifactsPath : config . outputDir ,
140142 } ) ;
141143} ) ;
142144
@@ -261,9 +263,9 @@ defineWorkerFixture('expectedSSLError', async ({browserName, platform}, runTest)
261263} ) ;
262264
263265defineTestFixture ( '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 / , '' ) ;
265267 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 ) ;
267269 await fs . promises . mkdir ( testOutputDir , { recursive : true } ) ;
268270 await runTest ( testOutputDir ) ;
269271 const files = await fs . promises . readdir ( testOutputDir ) ;
@@ -274,9 +276,9 @@ defineTestFixture('testOutputDir', async ({ testInfo }, runTest) => {
274276 }
275277} ) ;
276278
277- defineTestFixture ( 'context' , async ( { browser, testOutputDir, testConfig } , runTest ) => {
279+ defineTestFixture ( 'context' , async ( { browser, testOutputDir } , runTest ) => {
278280 const contextOptions : BrowserContextOptions = {
279- relativeArtifactsPath : path . relative ( testConfig . outputDir , testOutputDir ) ,
281+ relativeArtifactsPath : path . relative ( config . outputDir , testOutputDir ) ,
280282 recordTrace : ! ! options . TRACING ,
281283 recordVideos : ! ! options . TRACING ,
282284 } ;
0 commit comments