jeudi 21 décembre 2017

Laravel Dusk Conditionals

I am building an automated test in Laravel Dusk, The test is supposed to run through the order-process of a website. It needs to go to the category listing page, select a product, select a size, add to cart, go to checkout and complete the checkout until the very last step. I have succesfully made this test but when it selects a product that is out of stock, the whole test fails (ofcourse). I seem to struggle to make it so that the test could see if a product is out of stock, and if it is, select the next product. I have searched for a long time but cannot find anything about conditional logic in Dusk. I have tried determining the result that comes out of assert functions, but it returns a Browser object. If I var_dump this object, i'm not able to get any data from it that is specific about succeeding in adding the product. How would i go about doing this? Has it been done?

Aucun commentaire:

Enregistrer un commentaire