/**
* @Then /^I should see the modal "([^"]*)"$/
*/
public function iShouldSeeTheModal($title)
{
$this->getSession()->wait(20000, '(0 === jQuery.active && 0 === jQuery(\':animated\').length)');
$this->assertElementContainsText('#modal-from-dom .modal-header h3', $title);
assertTrue($this->getSession()->getPage()->find('css', '#modal-from-dom')->isVisible());
}
I’ll run through this method now line-by-line:
In Mink, the entry point to the browser is called the session. Think about it as being your browser window (some drivers even let you switch tabs!).
First, start your session (it’s like opening your browser tab). Nothing can be done with it before starting it.
The session allows you to execute or evaluate Javascript.
// Execute JS
$session->executeScript('document.body.firstChild.innerHTML = "";');
// evaluate JS expression:
echo $session->evaluateScript(
"return 'something from browser';"
);
Note
bin/behat -c tests/behat/behat.profiles.yml --format pretty --out logs/report.txt --format junit --out logs/xml --format progress
bin/behat -c tests/behat/behat.profiles.yml --format pretty --out logs/report.txt --format junit --out logs/junitxml --format progress --no-colors
[setup@c7 behatmink]$ bin/behat -c tests/behat/behat.profiles.yml --format pretty --out logs/report.txt --format junit --out logs/junitxml --format progress --no-colors -p p_goutte --suite=smoke
tail -f /var/www/tools/phantomjs/phantomjs.log
touch /etc/systemd/system/phantomjs
[setup@c7 ~]$ cd /etc/systemd
[setup@c7 systemd]$ ls
bootchart.conf coredump.conf journald.conf logind.conf system system.conf user user.conf
[setup@c7 systemd]$ cd system
[setup@c7 system]$ sudo touch phantomjs.service
[sudo] password for setup:
Copyright 2018· All rights reserved