PHPackages                             jayak/sauce-sausage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. jayak/sauce-sausage

ActiveSauce-sausage[Testing &amp; Quality](/categories/testing)

jayak/sauce-sausage
===================

PHP version of the Sauce Labs API

1.0(10y ago)08Apache-2.0PHPPHP &gt;=5.6

Since Apr 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jaya-konduru/sauce)[ Packagist](https://packagist.org/packages/jayak/sauce-sausage)[ Docs](https://github.com/jaya-konduru/sauce)[ RSS](/packages/jayak-sauce-sausage/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/0d31a784d62aee656b4455a03846d882cc4610cc40eea20fae1853fb4f4024b6/68747470733a2f2f7472617669732d63692e6f72672f6a6c697070732f736175736167652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jlipps/sausage)

Sausage
=======

[](#sausage)

Your one-stop shop for everything Selenium + Sauce Labs + PHP. This is a set of classes and libraries that make it easy to run your Selenium tests, either locally or on Sauce Labs. You run the tests with [PHPUnit](http://phpunit.de).

Sausage comes bundled with [Paratest](http://github.com/brianium/paratest) (for running your PHPUnit tests in parallel) and optionally [Sauce Connect](http://saucelabs.com/docs/connect) (for testing locally-hosted sites with Sauce).

Read the rest of this page for installation and usage instructions designed to help you get the most out of your sausage.

License
-------

[](#license)

Sausage is available under the Apache 2 license. See `LICENSE.APACHE2` for more details.

Quickstart
----------

[](#quickstart)

Check out [sausage-bun](http://github.com/jlipps/sausage-bun). It's a one-line script you can run via curl and PHP to get everything going. For example:

```
curl -sL https://raw.githubusercontent.com/jlipps/sausage-bun/master/givememysausage.php | php

```

*Note*: if you are a Windows user who's not using Cygwin, it'll take a little extra work to set you up---please see the [sausage-bun README](http://github.com/jlipps/sausage-bun)

Manual Install
--------------

[](#manual-install)

Sausage is distributed as a [Composer](http://getcomposer.org) package via [Packagist](http://packagist.org/), under the package `sauce/sausage`. To get it, add (or update) the `composer.json`file in your project root. A minimal example composer.json would look like:

```
{
    "require": {
        "jayak/sauce-sausage": "dev-master"
    }
}
```

If you haven't already got Composer installed, get it thusly (for \*nix/Mac):

```
curl -sL http://getcomposer.org/installer | php

```

Then, install the packages (or `update` if you've already set up Composer):

```
php composer.phar install

```

This will install Sausage and all its dependences (like PHPUnit, etc...). If you didn't already have the `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables set, you'll now need to configure Sausage for use with your Sauce account:

```
vendor/bin/sauce_config YOUR_SAUCE_USERNAME YOUR_SAUCE_ACCESS_KEY

```

(Or for Windows):

```
vendor\bin\sauce_config.bat YOUR_SAUCE_USERNAME YOUR_SAUCE_ACCESS_KEY

```

(It's a Composer convention for package binaries to be located in `vendor/bin`; you can always symlink things elsewhere if it's more convenient).

Requirements
------------

[](#requirements)

- Sausage will work on any modern (&gt;= 5.4) PHP installation
- Composer's requirements must also be satisfied (unfortunately, I could not find these documented anywhere). Suffice it to say they're normal requirements like the cURL extension, `safe_mode` off, `allow_url_fopen`, etc...
- If you're on a Windows machine, you might want to set up all your PHP stuff in [Cygwin](http://cygwin.com)

Getting Started
---------------

[](#getting-started)

If everything's set up correctly, you should be able to run this:

```
vendor/bin/phpunit vendor/sauce/sausage/WebDriverDemo.php

```

(Or for Windows):

```
vendor\bin\phpunit.bat vendor\sauce\sausage\WebDriverDemo.php

```

And start seeing tests pass. (While the tests are running, you can check on their progress by going to your [Sauce tests page](http://saucelabs.com/tests))

Getting Started with Mobile
---------------------------

[](#getting-started-with-mobile)

Running tests on Mobile uses [Appium](http://appium.io). If everything is set up correctly, you should be able to run this:

```
vendor/bin/phpunit vendor/sauce.sausage/MobileDemo.php

```

(Or for Windows):

```
vendor\bin\phpunit.bat vendor\sauce\sausage\AppiumDemo.php

```

And start seeing tests pass. (While the tests are running, you can check on their progress by going to your [Sauce tests page](http://saucelabs.com/tests))

Running tests in parallel
-------------------------

[](#running-tests-in-parallel)

Running Selenium tests one at a time is like eating one cookie at a time. Let's do it all at once! Try this:

```
vendor/bin/paratest -p 2 -f --phpunit=vendor/bin/phpunit vendor/sauce/sausage/WebDriverDemo.php

```

(Or for Windows):

```
vendor\bin\paratest.bat -p 2 -f --phpunit=vendor\bin\phpunit.bat vendor\sauce\sausage\WebDriverDemo.php

```

Now they'll finish twice as fast! (And if you get a [Sauce Labs account](http://saucelabs.com/pricing), you can bump up that concurrency to 4, 10, 20, 30, or more!)

Writing WebDriver tests
-----------------------

[](#writing-webdriver-tests)

Writing tests for Selenium 2 (WebDriver) is easy and straightforward. Sausage is by default built on top of [PHPUnit\_Selenium](http://github.com/sebastianbergmann/phpunit-selenium). All commands that work in `PHPUnit_Extensions_Selenium2TestCase` also work in Sausage's `WebDriverTestCase`. Here's a simple example:

```
