feat(ci): add husky pre-commit hook and fix puppeteer-core chrome detection
This commit is contained in:
@@ -124,11 +124,19 @@ export class BrowserDevToolsAdapter implements IBrowserAutomation {
|
||||
'--no-sandbox',
|
||||
];
|
||||
|
||||
this.browser = await puppeteer.launch({
|
||||
const launchOptions: Parameters<typeof puppeteer.launch>[0] = {
|
||||
headless: this.config.headless,
|
||||
executablePath: this.config.executablePath || undefined,
|
||||
args: launchArgs,
|
||||
});
|
||||
};
|
||||
|
||||
// Use explicit executablePath if provided, otherwise use channel to auto-detect Chrome
|
||||
if (this.config.executablePath) {
|
||||
launchOptions.executablePath = this.config.executablePath;
|
||||
} else {
|
||||
launchOptions.channel = 'chrome';
|
||||
}
|
||||
|
||||
this.browser = await puppeteer.launch(launchOptions);
|
||||
|
||||
const pages = await this.browser.pages();
|
||||
this.page = pages[0] || await this.browser.newPage();
|
||||
|
||||
Reference in New Issue
Block a user