Comments (9)
Haven't tested yet, but you might be able to listen for nprogress to disappear
$browser->waitUntilMissing('#nprogress');
from inertia-laravel.
Started implementing dusk in my current project and I am also running into issues. I am using a custom .env.dusk.local file with the proper settings. It works for the initial page load, but when geting things from usePage(), it seems that dusk is loading the original .env file instead of the new one. I can simply dump my database.default value to the screen (In react), and check the "failed" screenshot
I am unsure if this is a problem with dusk or inertia
Edit: Silly me. I had forgotten that artisan serve caches my .env files! :/ Changed to homestead and it works π
from inertia-laravel.
Laravel Dusk has a feature to wait until an element is visible by passing a query selector. For example:
$browser->waitFor('.button');
You can view the documentation here for more examples - https://laravel.com/docs/5.8/dusk#waiting-for-elements
from inertia-laravel.
hi @georgehanson. Thanks for your reply!
Yes I was already aware of that. I can try to find an element for each test case to wait for, but I'm actually curious if there is a generic element to wait for. Like the same element in each test. This would make everything much easier.
Since I'm sure I'm not the only one who uses Dusk, I interested to find out how other Inertia users handle this.
from inertia-laravel.
Thanks @sinnbeck !
I've tried it and it works!
from inertia-laravel.
Thanks for the edit @sinnbeck .
Good to hear you've figured it out.
from inertia-laravel.
Looks like this issue's been solved! π
Another solution (I think?) could be to wait for first element inside the inertia-rendered element. Since Vue replaces the whole node tree that it gets mounted on (#app
, by default in Inertia), it's presence would indicate that your app is ready.
In either case, I'll close this issue for now, but if you feel like it still wasn't answered properly, feel free to re-open the issue at any point by continuing the conversation.
Thanks!
from inertia-laravel.
I want to recommend some package here which helps a lot testing Inertia.js with Laravel Dusk
https://github.com/protonemedia/inertiajs-events-laravel-dusk
from inertia-laravel.
I want to recommend some package here which helps a lot testing Inertia.js with Laravel Dusk
https://github.com/protonemedia/inertiajs-events-laravel-dusk
We wrote almost same code, but a bit simpler. Great package. Confirm, that the idea behind that macro works.
from inertia-laravel.
Related Issues (20)
- SSR (react) error ui doesn't match initial ui when including prop having html
- β¨Feature Request: Support `ziggy` 2.0 HOT 4
- fails testing nested pros
- External JS files not working unless you manually reload the page HOT 1
- image upload help HOT 2
- Laravel 11 support HOT 2
- There is no automatic follow protocol, http is used under https, how to solve it HOT 4
- Laravel 11 update and Nova issue HOT 2
- Vue Watch not working upon redirect route HOT 2
- Problem with SSR HOT 1
- Force app.blade.php to reload HOT 2
- Should Inertia middleware call session()->setPreviousUrl? HOT 6
- - HOT 1
- redirection to /dashboard after login does not work HOT 1
- Prevent a webpage from navigating away HOT 1
- Release notes for 1.0 could make it more clear that "Fix URL generation (#592)" is a breaking change HOT 5
- Ziggy2.0 and Laravel11 and Breeze for Inertia + React, TypeScript and SSR starter kit throws error on initial setting HOT 2
- assertInertia() fails when testing Inertia visits HOT 1
- Inertia components/hooks wrapped with redux Provider stopped working HOT 2
- client-side validation libraries HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inertia-laravel.