公司的前端自动化项目使用的jest框架,已经通过yarn add --dev jest安装了jest,
执行自动化脚本
package.json中如下
"scripts": {
"start_one":"jest --runInBand --forceExit --update=true --downloaXXXXX后面的省略掉"
}
进入自动化项目命令行 yarn start_one,报错如下:
jest-jasmine is no longer shipped by default with Jest, you need to install it explicitly or provide an absolute path to Jest
Configuration Documentation:
https://jestjs.io/docs/configuration
使用全局安装jest, yarn global add jest,再次执行,问题还在
求助求助,
另外怎么把jest添加系统变量PATH中,真不会阿(安装jest后的路径D:\programs\node_modules\@jest)
20230915:
TimeoutError: Navigation timeout of 30000 ms exceeded
at LifecycleWatcher._LifecycleWatcher_createTimeoutPromise (node_modules/puppeteer-core/src/common/LifecycleWatcher.ts:258:12)
解决方案:
const browser = await puppeteer.launch({ timeout: 60000, // 设置超时时间为 60 秒 });
或者
const browser = await puppeteer.launch(); const page = await browser.newPage(); const auditUrl = 'https://example.com'; await page.goto(auditUrl, { timeout: 60000 });