Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active March 2, 2017 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpdave/f152439cf723b2dcc05ea99277a4f388 to your computer and use it in GitHub Desktop.
Save phpdave/f152439cf723b2dcc05ea99277a4f388 to your computer and use it in GitHub Desktop.
#Get composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
#Create composer.json in project
{
"require-dev": {
"phpunit/phpunit": "*",
"facebook/webdriver": "dev-master"
}
}
#install dependencies via composer
php composer.phar install
#Get selenium-standalone http://www.seleniumhq.org/download/ and put it in the project folder and in the index.php run it
wget http://goo.gl/qTy1IB -O selenium-server-standalone.jar
<?php
exec("java -jar selenium-server-standalone.jar &", $output);
#Get Chrome browser extension to make it easy to right click and find an element's css selector
https://chrome.google.com/webstore/detail/copy-css-selector/kemkenbgbgodoglfkkejbdcpojnodnkg/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment