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
waitUntil not working as expected #594
Comments
Each Try this: $browser->type('#search_value', $searchtext);
$browser->press('Continue');
$browser->waitUntil('!$.active'); |
Hey @staudenmeir , Thanks for the reply. But i am actually confused what is $.active? |
Wow. This is one of those Aha moment. Never heard of $.active. Really awesome solution :) 👍 I was wondering do you know anything where i can actually intercept ajax response and evalute what to do. |
Do you want to intercept the AJAX response in the test? |
The actual code fires $.get() request and based on response does diffrent things based on error or success response. I want to get that response so i don't have to work with html as responses vary so much in the old legacy app i am working with. |
I'm not sure this is possible and even if it is, it's not really a good approach. Browser tests are meant to be high-level and should only test user interaction. This is also the reason why you don't have access to the HTTP status code. |
the thing is this legacy app we are testing results error in span like, I can use assertsee but how do i check like in if condition that is bit confusing. i.e. i wish i could test it like, |
Like @staudenmeir said I don't think this is really possible with Dusk. Can you first please try one of the following support channels? If after that you still feel that this should be added, feel free to report back. |
So that works for jQuery AJAX calls, what about axios & vue? Check out my axios interceptors in this SO ticket, but it isn't working. It works similar to |
After this fix waitFor and others stopped waiting and just check for the condition. |
Hello,
i am testing App via dusk. it has this button which checks validation and fires ajax and gives form if suceeses and error message if fails. To intercept ajax request i am adding variable AppdataLoaded = false and when ajax finishes it will be true using $browser->script. this works but i am having trouble checking AppdataLoaded variable via waitUntil, as per document i should be able to check if AppdataLoaded == true but it does not work. Here is the code,
Facebook\WebDriver\Exception\TimeOutException: Waited 10 seconds for callback. I am not sure if i am understanding docs wrong or there is issue with waituntill. I tried $browser->waitUntil('AppdataLoaded',10); first but it also it did not work.
Can anyone point me what i am missing here. If its not right way to test then any other way to test this ?
The text was updated successfully, but these errors were encountered: