2017 © Pedro Peláez
 

library selenium-phpunit-framework

This is a Selenium + PHPUnit Framework and test skeleton

image

atlanticbt/selenium-phpunit-framework

This is a Selenium + PHPUnit Framework and test skeleton

  • Saturday, June 20, 2015
  • by bshirey
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

## Selenium + PHPUnit Black Box Testing Framework

This is a proof-of-concept black box testing framework + test scaffolding that seeks to integrate PHPUnit and Selenium., (*1)

GETTING STARTED

Installation

Composer

Add the following to your repositories (in composer.json), (*2)

{
    "type":"composer",
    "url":"http://satis.atlanticbt.com"
}

Add the following dependency (require in composer.json), (*3)

"require": {
    "atlanticbt/selenium-phpunit-framework" : "dev-feature/selenium2-test-case-web-driver"
}

NOTE: This value for the release is subject to change, currently dev-feature/selenium2-test-case-web-driver is a beta version geared towards Selenium 2, (*4)

Download composer.phar in your project, (*5)

curl -sS https://getcomposer.org/installer | php

Install dependencies, (*6)

php composer.phar install

Sample Files

The sample files are (semi) optional, depending on your project and project requirements. These instructions assume you have installed the package into the vendor directory of your project root using Composer. If that's not the case, adjust paths accordingly. If you have your own bootstrap file, you'll need to port code that defines the configuration file path., (*7)

Bootstrap, (*8)

  • Copy vendor/atlanticbt/selenium-phpunit-framework/sample/Bootstrap.sample.php into the project root
  • Rename the file to Bootstrap.php
  • Update configurationFilePath to suit your needs, by default assumes your test configs are in the ./tests/config/ directory

PHPUnit, (*9)

  • Copy vendor/atlanticbt/selenium-phpunit-framework/sample/phpunit.sample.xml into your project root
  • Rename file to phpunit.xml
  • Update appropriately for your project

Tests, (*10)

  • Copy vendor/atlanticbt/selenium-phpunit-framework/sample/tests directory into your project root
  • Copy (and rename) the files in tests/config, remove the .dist extension
  • Update tests/config/global.php with global configuration (such as site base url)
  • Update /tests/config/test.php with test specific configuration
  • Write your tests, you can use tests/SampleTest.php to start, but eventually you'll want to remove that from your project

MOTIVATION

The goal is to help PHP developers ease into black box (decidedly NOT unit oriented) testing using Selenium + PHPUnit., (*11)

Contributors

LICENSE

N/A, (*12)

DESIGN

  • These testing framework doesn't do much yet, and what it does will need refactoring.
  • Primarily, this abstracts out configuration / setup.
  • Configuration is based on precedence, we have ... ** Global Configuration (shared amongst all tests) in src/tests/config/global.php *** PHP indexed array *** Any file of the format {.}global.php will be read into global config ** Test Configuration (for individual test classes) in src/tests/config/test.php *** PHP indexed array, each class defines a key (i.e. 'login') *** Any file of the format {.}test.php will be read into test-specific config ** PHP GLOBALS *** For instance, as defined by phpunit.xml ** Environment Variables *** For instance, set in test.runner.sh
  • Configuration precedence is (highest to lowest) Environment Variables overwrite GLOBALS overwrite Test Configurations overwrite Global Configurations
  • This setup allows environment specific values so that we can use the test runner to run the tests on different environments (production versus develop server versus local vagrant)

Additional Notes

When you run composer in your project, you will be provided with a sample test runner shell script at /vendor/bin/test.runner.sh The test runner is designed for local testing, such as you want to run the tests on your local machine or within vagrant The PHPUnit sample file can be used to configure the tests in other environments, for instance on Jenkins, (*13)

Final Thoughts

All typos are intentional, (*14)

The Versions

20/06 2015

dev-feature/selenium2-test-case-web-driver

dev-feature/selenium2-test-case-web-driver

This is a Selenium + PHPUnit Framework and test skeleton

  Sources   Download

The Requires

 

by Brian Shirey

20/06 2015

v2.0.1

2.0.1.0

This is a Selenium + PHPUnit Framework and test skeleton

  Sources   Download

The Requires

 

by Brian Shirey

20/06 2015

v2.0.0

2.0.0.0

This is a Selenium + PHPUnit Framework and test skeleton

  Sources   Download

The Requires

 

by Brian Shirey

20/06 2015

dev-feature/migrate-config

dev-feature/migrate-config

This is a Selenium + PHPUnit Framework and test skeleton

  Sources   Download

The Requires

 

by Brian Shirey

12/06 2015

v0.1.2

0.1.2.0

This is a Selenium + PHPUnit Framework and test skeleton

  Sources   Download

The Requires

 

by Brian Shirey

04/05 2015

v0.1.0

0.1.0.0

This is a Selenium + PHPUnit Framework and test skeleton

  Sources   Download

The Requires

 

by Brian Shirey