Giter VIP home page Giter VIP logo

php-automation's Introduction

Prerequisites

I run this natively on a Mac so all these instructions are based on that. Shouldn't be too hard to rework for Linux/Windows though.

  • Brew
  • Composer - brew install composer
  • PHP 7.4
    • I use brew to manage PHP versions - brew install [email protected] then brew unlink php@<version> and brew link [email protected] to install 7.4 then replace whichever version you have with 7.4
  • Java

Install Things

Dependencies

Run this from the repo root:

composer install

Chrome & Chromedriver

Install Chrome, I mean, you should have this already to be fair!

Then install Chromedriver - on Mac use Brew by running:

brew install chromedriver

Selenium

Download and extract the latest stable version of Selenium Server Standalone (v3.141.59 at time of writing) into resources/selenium-server-standalone/<version>. If you're feeling spicy go for the latest Selenium 4 Alpha release...

BrowserMob

Download and extract the BrowserMob Proxy zip (v2.1.4 at time of writing) into resources/browsermob-proxy/<version>.

BrowserUP

Optionally, if you want to try out BrowserUp Proxy then there's a resource folder for that.

Start Servers

Selenium

Open a Terminal tab and run the following...the first is an example of how to get to the location to run the java command:

cd ~/Documents/GitHub/php-automation/resources/selenium/3.141.59
java -jar selenium-server-standalone-3.141.59.jar

This will launch a Selenium server used for orchestrating the tests in Chrome. It'll be running on http://localhost:4444/wd/hub.

The terminal session will still be open - leave it like this.

BrowserMob

In a new Terminal tab run the following...again, the first command is an example of how to get to the right location:

cd ~/Documents/GitHub/php-automation/resources/browsermob-proxy/2.1.4
sh bin/browsermob-proxy -port 8080 -proxyPortRange 8081-8281 -ttl 180

This launches a server that is then used for launching proxy instances for recording HAR files. The server will be running on port 8080 and can launch proxies on ports 8081 to 8281 that have a TTL of 180 seconds so that the pool can be reused.

The terminal session will still be open - leave it like this.

Test

To test the setup, run my example script:

php example.php --recording_hars --recording_screenshots --add-option=headless --test_identifier=tyler-architects

php-automation's People

Contributors

yippeykeiyay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.