mercredi 20 février 2019

Laravel PhpUnit: How to trigger events on DOM elements

I am using Laravel 5.1 and PHPUNIT 4.8 and PHP 7.0. I am trying to test my login functionality. My login form is opened after clicking a div. As far as I have read documentation and tried different things, I am only able to click if there is a button or there is a link. Please guide

class ExampleTest extends TestCase
{
/**
 * A basic functional test example.
 *
 * @return void
 */

    public function testUrl(){
        $this->visit('/')->click("#login_popup");
    }

    public function checkAssert(){
        $this->assertTrue(true);
    }
}

Here I have a div with id #login_popup. When I run test it gives following error

InvalidArgumentException: Could not find a link with a body, name, or ID attribute of [#login_popup].



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire