headless-recorder icon indicating copy to clipboard operation
headless-recorder copied to clipboard

Add options to wait for network after a click

Open dolfje opened this issue 4 years ago • 4 comments

Description

With a React application, a click doesn't always change the navigation. But in most cases will load some extra data. So add an option to wait after all network activity is done when clicking.

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

Internal testing

Checklist:

  • [x] My code follows the style guidelines of this project. npm run lint passes with no errors.
  • [x] I have made corresponding changes to the documentation
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes. npm run test passes with no errors.

dolfje avatar Nov 09 '21 17:11 dolfje

@dolfje is this something that will work the same way in playwright? If not, we need to consider it only as a valid option for puppeteer.

ianaya89 avatar Nov 17 '21 01:11 ianaya89

@dolfje reminder 👆

ianaya89 avatar Nov 24 '21 18:11 ianaya89

I don't know playwright, but can't find it in their docs. So probably not.

dolfje avatar Nov 24 '21 20:11 dolfje

Hi all, in playwright we can use await page.waitForLoadState('networkidle') instead :)

Maybe this can be a reference (self-test only, not ready for merge): https://github.com/RexSkz/headless-recorder/pull/4/files

RexSkz avatar Jan 19 '22 11:01 RexSkz

https://github.com/checkly/headless-recorder/issues/232

ianaya89 avatar Dec 16 '22 13:12 ianaya89