Coder Social home page Coder Social logo

s001dxp / phpunit-selenium Goto Github PK

View Code? Open in Web Editor NEW

This project forked from giorgiosironi/phpunit-selenium

0.0 2.0 0.0 2.12 MB

Selenium RC integration for PHPUnit

Home Page: http://www.phpunit.de/

License: Other

Shell 0.52% PHP 90.83% HTML 8.65%

phpunit-selenium's Introduction

This package contains a base Testcase Class that can be used to run end-to-end tests against Selenium 2 (using its Selenium 1 backward compatible Api).

Please direct pull requests to giorgiosironi/phpunit-selenium for automated testing upon merging.

A feature branch containing all the commits you want to propose works best.

Running the test suite

Manually

To run the test suite for this package, you should serve selenium-1-tests via HTTP:

selenium-1-tests/ $ python -m SimpleHTTPServer 8080

and configure the constant that you will be asked for accordingly if you do not run the server on localhost:8080. You also need to run a Selenium Server:

$ java -jar  selenium-server-standalone-2.x.xjar

or with xvfb:

$ sudo xvfb-run java -jar bin/selenium-server-standalone-2.x.x.jar

Take a look at before_script.sh for an automated way to setup the HTTP and Selenium servers.

Dependencies are managed via Composer, so you must grab them like this:

$ composer install --dev

The tests can then be run with:

$ vendor/bin/phpunit Tests

You can copy phpunit.xml.dist to phpunit.xml and setup a custom configuration for browsers, but the test suite is based on Firefox on an Ubuntu machine.

Via Vagrant

Just run vagrant up (a minimal version of v1.1 is required) and everything will be set up for you. The first start will take some time which depends on the speed of your connection (and less - speed of your computer). It will take about 160Mb to set up the VM environment and about 300Mb to download the hashicorp/precise32 vagrant box (in case if you don't have it downloaded yet).

After the command finishes its execution just run the following:

vagrant up
# then it's recommended to increase RAM and CPUs (see the note below)

vagrant ssh

cd /vagrant
vendor/bin/phpunit Tests

and you must see the phpunit testing phpunit-selenium project.

IMPORTANT NOTE about Vagrant usage

After vagrant has initialized the VM it makes sense to change amount of memory (and number of CPUs) manually from 384Mb by default to something near 2Gb (and 2 CPUs accordingly). I did nto do that in Vagrantfile deliberately since not every configuration might afford allocating 2Gb and 2 CPUs. Otherwise VM will swap hardly and at least one test will crash due to Out Of Memory.

phpunit-selenium's People

Contributors

giorgiosironi avatar sebastianbergmann avatar mlively avatar zerkms avatar jlipps avatar velovint avatar lexaurin avatar chr0n1x avatar julianseeger avatar bayandin avatar dharrya avatar knxsebastian avatar davidsickmiller avatar tkurnosova avatar till avatar andyfowler avatar erenon avatar digitalica avatar psemuu avatar mattgibson avatar jamesiarmes avatar ravage84 avatar dafish avatar mroycroft avatar nijel avatar nickrenold avatar nicolasrenold avatar paulyg avatar nexpoehler avatar 4lb0 avatar

Watchers

Darryl Porter avatar James Cloos 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.