shez1983's avatar

Testing FORM component - sometimes fails (have to duplicate filling fields)

So i have a simple test, i m guessing it fails because i have a little bit of logic to update server when user types something..

so what I am having to do is:

visit(route('referrals.create'))
        ->type('#company', $company->name)
        ->select('#type_id', '1')
		->select('#type_id', '1') // repeat this line again
		->screenshot(true) // or do this
        ->radio('[name="code_or_url_radio"]', 'code')
        ->fill('#code_or_url', '122234')
        ->fill('#referrals_commission', '10')
        ->select('#type_id', '1')
        ->press('#save')
0 likes
2 replies
Sergiu17's avatar

Try to add a pause just to see if it's because of the logic on the server

visit(route('referrals.create'))
        ->type('#company', $company->name)
		->pause(1000) // <---------- this
        ->select('#type_id', '1')
        ->radio('[name="code_or_url_radio"]', 'code')
        ->fill('#code_or_url', '122234')
        ->fill('#referrals_commission', '10')	
        ->press('#save')
shez1983's avatar

thanks. pause() doesnt seem to exist, i have tried using waitFor(2). which does.. but that havent worked thus far.

Please or to participate in this conversation.