jeudi 24 novembre 2016

Laravel Testing Javascript with Selenium

I'm currently using Laravel Integrated with Selenium and PHPUnit to run some tests on a new application, and wondering what the best approach is to test Javascript? I've got this to spawn Selenium on a port, and using the framework perform some clicks. From looking at the documentation

http://ift.tt/2gs73PL

There doesn't seem to be javascript specific functions, so I'm guessing another approach is needed. Any guidance on how to get Selenium to do some other JS related stuff too?

use Laracasts\Integrated\Extensions\Selenium;

class HomePageTest extends Selenium
{
    protected $baseUrl = 'http://localhost:8000';
    /**
     * A basic test example.
     *
     * @return void
     */
    public function testHomePageWork()
    {
      $this->visit('/')->see('Home');
    }

    public function testSomeClicksWork()
    {
      $this->visit('/')
        ->click('Features')
        ->andSee('Features')
        ->click('Pricing')
        ->andSee('Our Pricing Options')
        ->click('Contact')
        ->andSee('Some Address');

    }


}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire