Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make sure to wait for DOM events #128

Closed
4 tasks
ebebbington opened this issue Apr 29, 2022 · 2 comments
Closed
4 tasks

feat: Make sure to wait for DOM events #128

ebebbington opened this issue Apr 29, 2022 · 2 comments

Comments

@ebebbington
Copy link
Member

Summary

What:

Wait for:

  • Dom to be ready eg Dom.readyState
  • Allow users to wait a certain amount of time
    - they can pass a callback to instead wait until a specific condition passed eg until button text equals something

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.

  • Write documentation
  • Write unit tests
  • Write integration tests
  • {add more checkboxes required by this issue as needed}

Example Pseudo Code (for implementation)

// Add example pseudo code for implementation
@ebebbington
Copy link
Member Author

  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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant