@@ -130,15 +130,15 @@ export class Generator {
130
130
let ctPackageName = '' ;
131
131
if ( answers . framework ) {
132
132
ctPackageName = `@playwright/experimental-ct-${ answers . framework } ` ;
133
- sections . set ( 'ct' , 'show' ) ;
134
133
installExamples = false ;
134
+ sections . set ( 'ct' , 'show' ) ;
135
135
} else {
136
136
sections . set ( 'ct' , 'hide' ) ;
137
137
}
138
138
139
139
files . set ( `playwright.config.${ fileExtension } ` , executeTemplate ( this . _readAsset ( `playwright.config.${ fileExtension } ` ) , {
140
140
testDir : answers . testDir || '' ,
141
- ctPackageName,
141
+ testRunnerImport : ctPackageName || '@playwright/test' ,
142
142
} , sections ) ) ;
143
143
144
144
if ( answers . installGitHubActions ) {
@@ -181,11 +181,6 @@ export class Generator {
181
181
182
182
const jsTemplate = this . _readAsset ( path . join ( 'playwright' , 'index.js' ) ) ;
183
183
files . set ( `playwright/index.${ extension } ` , jsTemplate ) ;
184
-
185
- if ( answers . language === 'TypeScript' ) {
186
- files . set ( `playwright/types.d.ts` , `import '${ ctPackageName } ';\n` ) ;
187
- this . _patchTsconfigJSON ( ) ;
188
- }
189
184
}
190
185
191
186
const browsersSuffix = this . options . browser ? ' ' + this . options . browser . join ( ' ' ) : '' ;
@@ -226,20 +221,6 @@ export class Generator {
226
221
await createFiles ( this . rootDir , files , true ) ;
227
222
}
228
223
229
- private async _patchTsconfigJSON ( ) {
230
- const tsconfigFile = path . join ( this . rootDir , 'tsconfig.json' ) ;
231
- const files = new Map < string , string > ( ) ;
232
- if ( ! fs . existsSync ( tsconfigFile ) ) {
233
- files . set ( `tsconfig.json` , this . _readAsset ( path . join ( 'tsconfig.json' ) ) ) ;
234
- } else {
235
- const tsconfigJSON = fs . readFileSync ( path . join ( this . rootDir , 'tsconfig.json' ) , 'utf-8' ) ;
236
- const newJSON = tsconfigJSON . replace ( / ( " i n c l u d e " [ \s \S ] * : [ \s \S ] \[ [ \s \S ] * " s r c " ) / m, '$1, "playwright/types.d.ts"' ) ;
237
- if ( ! tsconfigJSON . includes ( 'playwright' ) && tsconfigJSON !== newJSON )
238
- files . set ( 'tsconfig.json' , newJSON ) ;
239
- }
240
- await createFiles ( this . rootDir , files , true ) ;
241
- }
242
-
243
224
private _printEpilogue ( answers : PromptOptions ) {
244
225
console . log ( colors . green ( '✔ Success!' ) + ' ' + colors . bold ( `Created a Playwright Test project at ${ this . rootDir } ` ) ) ;
245
226
const pathToNavigate = path . relative ( process . cwd ( ) , this . rootDir ) ;
0 commit comments