There are various different drivers that codeception uses, PhpBrowser which doesn’t do JS, Selenium WebDriver does, and you have several options; you could install Selenium, chrome headless browser, or phantomjs. I chose phantomjs, as it was easiest (for me) to get up and running on a non X Server.
First up, you’ll need phantomjs. Go download it, unpack the zip, move the folder somewhere, and then symlink the bin/phantomjs to /usr/bin/phantomjs.
Next, launch phantomjs like so:
phantomjs --webdriver=4444 --ignore-ssl-errors=true --ssl-protocol=any
Now, in your YAML:
# Codeception Test Suite Configuration # suite for acceptance tests. # Run the following command FIRST: # phantomjs --webdriver=4444 --ignore-ssl-errors=true --ssl-protocol=any # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. class_name: WebGuy modules: enabled: - WebDriver - WebHelper config: WebDriver: url: 'https://USER:PASS@YOUR_URL_HERE' browser: phantomjs capabilities: acceptSslCerts: true
If you have a site using HTTP Basic Auth, put USER:PASSWORD@ in yopur URL, if not, remove it.
Now in your acceptance test, you can write:
$i->click('Nouvel abonnement'); $i->switchToWindow('webformswin');