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

Better way to ensure DOM is settled #217

Open
gladyshcodes opened this issue Dec 30, 2024 · 4 comments
Open

Better way to ensure DOM is settled #217

gladyshcodes opened this issue Dec 30, 2024 · 4 comments

Comments

@gladyshcodes
Copy link
Contributor

What

Get rid of setTimeout and use Playwright API instead

Why

Currently, we use timeouts, wait one second before performing any actions on a page: new Promise((resolve) => setTimeout(resolve, ms));

This is ineffective for several reasons:

  • DOM settlement can potentially take more than 1 second, making tests flaky
  • Performance decrease: setTimeout unnecessarily introduces a delay, even when the DOM settles faster
@slavingia
Copy link
Contributor

Eventually I'd like to deprecate Playwright and rely on Computer Use; so a "native" solution would be cool. We could always start with PW and then eventually deprecate.

@gladyshcodes
Copy link
Contributor Author

Understood. I will pick it up shortly and implement it without Playwright

Asking about your vision—are you aiming for Shortest to eventually become the "next-gen Playwright"?

@slavingia
Copy link
Contributor

Yep!

"Playwright can automate browser tasks in Chromium, Firefox, and WebKit with a single API."

Eventually computer use will be able to do all of this, and there won't be a need for playwright. I think we should bet on this!

@gladyshcodes
Copy link
Contributor Author

Eventually computer use will be able to do all of this, and there won't be a need for playwright. I think we should bet on this!

Agree!

@slavingia slavingia changed the title Better way ensure DOM is settled Better way to ensure DOM is settled Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants