This repository was archived by the owner on Oct 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class PuppetRunner extends Runner {
1616 this . on ( 'forceExit' , ( ) => this . closeBrowser ( ) ) ;
1717 }
1818
19- async getChromeExecutablePath ( ) {
19+ static async getChromeExecutablePath ( ) {
2020 const installations = await chromeFinder [ getPlatform ( ) ] ( ) ;
2121 if ( installations . length === 0 ) {
2222 throw new Error ( 'Chrome not installed' ) ;
@@ -25,9 +25,6 @@ class PuppetRunner extends Runner {
2525 }
2626
2727 async launch ( ) {
28- if ( ! this . argv . chrome . executablePath ) {
29- this . argv . chrome . executablePath = await this . getChromeExecutablePath ( ) ;
30- }
3128 if ( this . argv . chrome . slowMo && this . argv . chrome . slowMo > 0 ) {
3229 this . argv . mocha . enableTimeouts = false ;
3330 }
@@ -77,6 +74,10 @@ const puppet = {
7774 handler ( argv ) {
7875 ( async function launchAndRun ( ) {
7976 const puppeteer = require ( 'puppeteer-core' ) ;
77+ const launcher = require ( 'puppeteer-core/lib/Launcher' ) ;
78+ if ( ! argv . chrome . executablePath ) {
79+ argv . chrome . executablePath = await ( argv . chrome . stable ? PuppetRunner . getChromeExecutablePath ( ) : launcher . executablePath ( ) ) ;
80+ }
8081 if ( argv . presetEnv ) {
8182 require ( argv . presetEnv ) ;
8283 }
Original file line number Diff line number Diff line change @@ -25,4 +25,9 @@ module.exports = {
2525 default : [ ] ,
2626 type : 'array' ,
2727 } ,
28+ 'chrome.stable' : {
29+ description : 'Use stable Chrome' ,
30+ default : true ,
31+ type : 'boolean' ,
32+ } ,
2833} ;
You can’t perform that action at this time.
0 commit comments