I\'m getting sad,
I use Laravel 5.2 and I am developping my unit tests.
In Laravel 5.1, you could use the great Integrated lib to use selenium, but it doesn
You need to install PHPUnit_selenium package using composer
composer require --dev phpunit/phpunit-selenium
Create Selenium Test Case class inside laravel/tests/
setBrowser('firefox');
$this->setBrowserUrl('http://localhost:8000/');
}
protected function visit($path)
{
$this->url($path);
return $this;
}
protected function see($text, $tag = 'body')
{
print_r(request()->session()->all());
//method call by tag name;
$this->assertContains($text,$this->byTag($tag)->text());
return $this;
}
protected function pressByName($text){
$this->byName($text)->click();
return $this;
}
protected function pressByTag(){
$this->byTag('button')->click();
return $this;
}
protected function type($value, $name)
{
$this->byName($name)->value($value);
return $this;
}
protected function hold($seconds){
sleep($seconds);
return $this;
}
}
and Create new test case for visiting home page url
visit('/')
->see('Site title','title');
}
}
and Run command PHPunit test from terminal
java -jar /usr/local/bin/selenium-server-standalone-2.35.0.jar
Reference document: