jeudi 31 mai 2018

laravel dusk and if else statements

I am using laravel dusk to test local websites, there is this one submit that can either go to one of 2 pages and I am wondering if someone could assist me with that.

I am using an if elseif statement but it is not working to see what the next url path begins with

 $this->browse(function (Browser $browser) {
                $browser->visit('/')
                    ->mouseover('@Appliances-mouseover')

                            ->type('@enter-city', 'Location')
                        ->type('@enter-postal-code', '0165')
                        ->click('@select-province')
                        ->click('@selected-province-some-province')
                        ->click('@select-hear-about-us')
                        ->click('@hear-about-us-email')
                        ->click('@agree-terms')
                        ->press('@submit-step-1');

       //                   prevet or step 3 forms in application B
                if ($URL = $browser- 
>assertPathBeginsWith('/application/prevet')) {
                    $browser->screenshot('Prevet form')
                        ->assertUrlIs('/application/prevet')
                        ->pause(25000);

                } elseif ($URL = $browser- 
>assertPathBeginsWith('/application/step3')) {
                    $browser->screenshot('step3 form')
                        ->assertUrlIs('/application/step3')
                        ->click('@uploadPayslip')
                        ->assertSee('Personal Documents')



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire