InaniELHoussain's avatar

is there a way to test Ajax?

Actually I'm using many pages where I have hidden modal ... and filling it using vueJS and sending data using ajax ... Actually I want to test it ... I wonder if there a specific way to do it? to check if there is an ajax call ...

0 likes
8 replies
ohffs's avatar
ohffs
Best Answer
Level 50

@bobbybouwmann but the question asked for ajax + vue, so I was assuming testing some level of dynamic 'building' of the query rather than just testing the api endpoint. Maybe I'm wrong though - I hope so - selenium testing is quite annoying ;-)

InaniELHoussain's avatar

@ohffs && @bobbybouwmann I have just one other question, I want how to test a specific classTest rather than the whole tests ... for the time being I used to make them simple classes that phpunit ignores them

bobbybouwmann's avatar

You can simply do this

phpunit tests/api/MyApiControllerTest

Note: not sure if you need the .php extension as well

1 like

Please or to participate in this conversation.