drashland / sinco

Browser Automation and Testing Tool for Deno, written in full TypeScript
https://drash.land/sinco
MIT License
57 stars 3 forks source link

feat: Make sure to wait for DOM events #128

Closed ebebbington closed 2 years ago

ebebbington commented 2 years ago

Summary

What:

Wait for:

Why:

We need to be sure that the Dom is loaded properly when the location is awaited, to test this, we could add a basic Dom content loaded handler that adds text to the Dom, assert we see the text

another thing I want to make sure we can cover is say the JS is what loads the content on the page eg API calls, React/Vue, where a basic view is displayed, and API calls are made once pagebis loaded to get a use rod users or whatever

There is also wait(‘$.active’) I used in Laravel, investigate this to see if it can help in waiting for these things

Acceptance Criteria

Below is a list of tasks that must be completed before this issue can be closed.

Example Pseudo Code (for implementation)

// Add example pseudo code for implementation
ebebbington commented 2 years ago
  1. We do this already
  2. Providing a wait function doesn't provide enough use, a user can use std/async/delay to wait
  3. user can write their own logic if they want to wait
  4. waiting for requests following click already covered by click method
  5. waitinf for dom to load ie react components fetch data can be covered by std/async/delay
ebebbington commented 2 years ago

Be good to do what puppeteer does, via networkidle0, but i just have no clue how to implement it