matmanjs / matman

Web 端对端测试(E2E,End-to-End Testing)解决方案
https://matmanjs.github.io/matman
MIT License
46 stars 10 forks source link

导航之后 puppeteer 上下文被销毁导致报错 #201

Closed wangjq4214 closed 4 years ago

wangjq4214 commented 4 years ago

For BUG

导航之后 puppeteer 上下文被销毁导致报错

damonare commented 4 years ago

截屏2020-07-13 下午8 52 08

damonare commented 4 years ago

Error: Execution context was destroyed, most likely because of a navigation.

helinjiang commented 4 years ago

修改:

  // https://github.com/puppeteer/puppeteer/blob/v5.1.0/docs/api.md#pagegotourl-options
    await this.page?.goto(this.pageDriver?.pageUrl, {
      // timeout: 0,
      waitUntil: 'networkidle2',
    });