<?php
namespace Facebook\WebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\assertStringContainsString;
require_once('vendor/autoload.php');
class loginTest extends TestCase {
public function testAcessarTelaDeLogin (){
$host = 'http://localhost:4444/wd/hub';
$capabilities = DesiredCapabilities::chrome();
$driver = RemoteWebDriver::create($host, $capabilities);
$url = 'https://github.com/login';
$driver->navigate()->to($url);
self::assertStringContainsString('Sign in to GitHub', $driver->getPageSource());
}
}
Quando eu rodo o teste aprensenta esse erro no console
cannot open file "loginTest.php".
[ffigueiredo@fedora php-test]$ php vendor/bin/phpunit tests/
PHP Fatal error: Uncaught Facebook\WebDriver\Exception\UnknownServerException:
Could not initialize class net.sf.cglib.proxy.Enhancer in /home/ffigueiredo/Documentos/douglas-projetos/php-test/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:114