Im attualmente facendo un test di accettazione con i seguenti strumenti:PhantomJS non possono visitare le pagine HTTPS auto-firmato Codeception
- Codeception
- Selenio WebDriver
- PhantomJS (come senza testa del browser fantasma)
Il mio problema è I miei test falliscono quando si visita una pagina autofirmata (https)
Quello che ho provato:
phantomjs --webdriver=5555 --ignore-ssl-errors=true --ssl-protocol=any
- L'aggiunta di questo nelle capacità di
phantomjs.cli.args: ["--ignore-ssl-errors=true"]
nel mio acceptance.suit.yml
Finora queste opzioni doesnt darmi alcuna fortuna.
Ecco il mio file di acceptance.suit.yml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver
config:
WebDriver:
url: https://myproject.com
browser: firefox
capabilities:
unexpectedAlertBehaviour: 'accept'
env:
phantom:
modules:
enabled:
- WebDriver
config:
WebDriver:
url: https://myproject.com
http_proxy: 192.1.1.1
http_proxy_port: 3000
browser: phantomjs
capabilities:
phantomjs.cli.args: ["--ignore-ssl-errors=true"]
UPDATE
Questo errore si presenta [ModuleException] WebDriver: Current url is blank, no page was opened
Non so perché questo errore si verifica in quanto ho indicato una pagina. Ecco un esempio del mio test
public function tryToTestThis(AcceptanceTester $I)
{
$I->wantTo('Test this function');
$I->amOnPage('/mypage/');
$I->see('This text');
}
Una risposta in Codeception sarebbe preferibile. Grazie
La prego di elaborare più su ciò che sta accadendo? Qualche errore, come fallisce il test? Grazie. – alecxe
@alecxe Ciao, ho aggiornato il mio post.Dice '[ModuleException] WebDriver: L'url corrente è vuoto, nessuna pagina è stata aperta' –
Sono stato in grado di replicare il tuo errore ed eseguire phantomjs con --ignore-ssl-errors = true abilitato al test da passare. L'unica differenza è che non sto usando http_proxy e http_proxy_port, hai controllato il tuo proxy? – MajicBob