laravel / dusk

Laravel Dusk provides simple end-to-end testing and browser automation.
https://laravel.com/docs/dusk
MIT License
1.87k stars 319 forks source link

Add `waitUntilPresent()` #1069

Closed u01jmg3 closed 10 months ago

u01jmg3 commented 10 months ago

The new waitUntilPresent() compliments the existing waitUntilMissing().

(Test included ✅)

crynobone commented 10 months ago

What's the different compared to existing waitFor()?

https://github.com/laravel/dusk/blob/fa6c39f80dbafe6d99d76c12420bd85e11faa03a/src/Concerns/WaitsForElements.php#L31-L47

u01jmg3 commented 10 months ago

Good catch. Could we have an alias? I immediately looked for the opposite of waitUntilMissing(), which I was already using, and couldn't find waitUntilPresent(). When there are so many assertions, naming them is key for folks to find the one they want (without diving into the code). ✌🏻

(Happy to update just the docs assuming you don't want the extra code.)

taylorotwell commented 10 months ago

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.