Eu escrevi o seguinte código com o $host = o site do trello Mas, ele não abre o navegador e só me retorna um erro e alerta.. Não estou entendendo a mensagem do erro e porque não abre o navegador.
PaginaInicialTest.php
<?php
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use PHPUnit\Framework\TestCase;
class PaginaInicialTest extends \PHPUnit\Framework\TestCase
{
public function testePaginaInicialNaoLogada()
{
// Arrange
$host = 'https://trello.com/';
$driver = RemoteWebDriver::create($host,DesiredCapabilities::chrome());
// Act
$driver->navigate()->to('http://52.170.23.173:8072/Login');
// Assert
self::assertStringContainsString('Trabalhe com qualquer time', $driver->getPageSource());
}
}
O console fica da seguinte maneira;
PS D:\xampp\htdocs\e2e> vendor/bin/phpunit tests/
PHPUnit 9.3.8 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 00:00.921, Memory: 4.00 MB
There was 1 error:
1) PaginaInicialTest::testePaginaInicialNaoLogada
Facebook\WebDriver\Exception\WebDriverException: JSON decoding of remote response failed.
Error code: 4
The response: '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /session</pre>
</body>
</html>'
D:\xampp\htdocs\e2e\vendor\php-webdriver\webdriver\lib\Remote\HttpCommandExecutor.php:337
D:\xampp\htdocs\e2e\vendor\php-webdriver\webdriver\lib\Remote\RemoteWebDriver.php:136
D:\xampp\htdocs\e2e\tests\PaginaInicialTest.php:12
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
PS D:\xampp\htdocs\e2e>
os erros > ERRORS! Tests: 1, Assertions: 0, Errors: 1.
Eu posso usar outro site e colocar o mesmo texto, da sempre a mesma coisa