dappeteer icon indicating copy to clipboard operation
dappeteer copied to clipboard

fix: use newPage method

Open 3794 opened this issue 3 years ago • 1 comments

Short description of work done

Used newPage instead of pages in bootstrap.

PR Checklist

  • [x] I have run linter locally
  • [x] I have run unit and integration tests locally
    • [ ] Update configuration the newest version (readme and const)
  • [x] Rebased to master branch / merged master

Changes

  • bootstrap - Change browser.pages to browser.newPage method

Issues

Closes #

3794 avatar Aug 15 '22 13:08 3794

Thanks for taking the time to contribute to a project.

@3794 can you give a rationale why it is better to approach this way?

@BeroBurny It did not work like the attached screenshot when run the sample code in the README.(network did not changed) but the test case (test.spec.ts) works well, so I found the difference and it was the statement. and when I use that statement, it works well. but I don't know exactly why. What do you think?

// test.spec.ts
testPage = await browser.newPage();
// setup/index.ts
const pages = await browser.pages();
return [dappeteer, pages[0], browser];
Screen Shot 2022-08-22 at 2 44 54 AM

3794 avatar Aug 21 '22 18:08 3794

Thanks for you PR, this is being revamped in https://github.com/ChainSafe/dappeteer/pull/202 and it should be more robust

Tbaut avatar Dec 03 '22 14:12 Tbaut