No description, website, or topics provided.
PHP Gherkin
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
features
i18n
.gitignore
.travis.yml
LICENSE
README.md
behat.yml
behatChrome.yml
behatChromeHeadless.yml
behatFirefox.yml
behatGoutte.yml
behatPhantomJS.yml
composer.json

README.md

Behat Talk

Install

Selenium

Download the latest stable version of Selenium Server (http://www.seleniumhq.org/download/)

Firefox

Check the release date of the downloaded version of Selenium server, download and install a firefox version with date less then the date of your selenium server. Before, install the latest version of geckodriver (https://github.com/mozilla/geckodriver/releases):

wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
tar zxfv geckodriver-v0.18.0-linux64.tar.gz
sudo mv geckodriver /usr/bin/
chmod +x /usr/bin/geckodriver

PhantomJS

Download PhantomJS from the oficial site (http://phantomjs.org/download.html). If you use apt for install PhantomJS, will not work good because the version from apt dont have any dependencies to run all features required for integrate PhantomJS with Selenium. Example:

wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2
sudo mv phantomjs-2.1.1-linux-x86_64 /usr/local/share/
sudo ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/

Chrome

Download the latest version of chromedriver (http://chromedriver.storage.googleapis.com/index.html)

wget http://chromedriver.storage.googleapis.com/2.31/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/bin/
chmod +x /usr/bin/chromedriver

Running Standalone Selenium Server Only for Chrome, Firefox and PhantomJS

java -jar ~/Downloads/selenium-server-standalone-3.4.0.jar

Clone the project

git clone https://github.com/vitormattos/palestra-behat

Get the Composer, the dependency manager for PHP

Download last composer phar from https://github.com/composer/composer/releases/latest or follow the install instructions in https://getcomposer.org/ or run sudo apt install composer in debian based linux.

Install dependencies

cd palestra-behat
composer install

Running scenarios

Headless browsers

Goutte

Without JavaScript

vendor/bin/behat -c behatGoutte.yml -s web features/web/exemploGoutte.feature

chrome headless

With JavaScript

OBS: Only supported by versions 59+ of chome or chromium

First start chrome or chromium in headless mode

google-chrome  --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

After start browser in headless mode, run scenario

vendor/bin/behat -c behatChromeHeadless.yml -s web features/web/exemploJavaScript.feature

phantomjs

With JavaScript

phantomjs --webdriver=4445
vendor/bin/behat -c behatPhantomJS.yml -s web features/web/exemploJavaScript.feature

Common browsers

Chrome

vendor/bin/behat -c behatChrome.yml -s web features/web/exemploJavaScript.feature

Firefox

vendor/bin/behat -c behatFirefox.yml -s web features/web/exemploJavaScript.feature