dappeteer
dappeteer copied to clipboard
fix: use newPage method
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 #
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];
Thanks for you PR, this is being revamped in https://github.com/ChainSafe/dappeteer/pull/202 and it should be more robust