File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/playwright-core/src/server/supplements/recorder Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,15 @@ export class JavaScriptLanguageGenerator implements LanguageGenerator {
36
36
37
37
generateAction ( actionInContext : ActionInContext ) : string {
38
38
const action = actionInContext . action ;
39
+ if ( this . _isTest && ( action . name === 'openPage' || action . name === 'closePage' ) )
40
+ return '' ;
41
+
39
42
const pageAlias = actionInContext . frame . pageAlias ;
40
43
const formatter = new JavaScriptFormatter ( 2 ) ;
41
44
formatter . newLine ( ) ;
42
45
formatter . add ( '// ' + actionTitle ( action ) ) ;
43
46
44
47
if ( action . name === 'openPage' ) {
45
- if ( this . _isTest )
46
- return '' ;
47
48
formatter . add ( `const ${ pageAlias } = await context.newPage();` ) ;
48
49
if ( action . url && action . url !== 'about:blank' && action . url !== 'chrome://newtab/' )
49
50
formatter . add ( `await ${ pageAlias } .goto(${ quote ( action . url ) } );` ) ;
You can’t perform that action at this time.
0 commit comments