Download the PHP package jayak/sauce-sausage without Composer

On this page you can find all versions of the php package jayak/sauce-sausage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sauce-sausage

Build Status

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.

Sausage comes bundled with Paratest (for running your PHPUnit tests in parallel) and optionally Sauce 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

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

Quickstart

Check out sausage-bun. It's a one-line script you can run via curl and PHP to get everything going. For example:

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

Manual Install

Sausage is distributed as a Composer package via Packagist, 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:

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

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)

Getting Started with Mobile

Running tests on Mobile uses Appium. 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)

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, you can bump up that concurrency to 4, 10, 20, 30, or more!)

Writing WebDriver tests

Writing tests for Selenium 2 (WebDriver) is easy and straightforward. Sausage is by default built on top of PHPUnit_Selenium. All commands that work in PHPUnit_Extensions_Selenium2TestCase also work in Sausage's WebDriverTestCase. Here's a simple example:

In this example, we define a set of browsers to use, and run a simple check to make sure that clicking on a link gets us to the expected new page.

For more examples, check out:

If you're into Selenium 1 (Selenium RC), instead take a look at SeleniumRCDemo.php

Writing Mobile tests

Writing tests for mobile devices is easy and straightforward. Sausage is by default built on top of Appium and the Appium PHP Client and PHPUnit_Selenium. All commands that work in PHPUnit_Extensions_Selenium2TestCase also work in Sausage's MobileTestCase. Here's a simple example:

Here we define a the device capabilities we want to use, and run a simple test of finding elements and interacting with them.

Sauce Labs API

Sausage comes bundled with a nice PHP interface to the Sauce Labs API:

See Sauce/Sausage/SauceMethods.php for the list of Sauce API functions (currently boasting 100% support). Also check out sauce_api_test.php for other examples.

Automatic Test Naming

By default, Sauce Labs doesn't know how to display the name of your test. Sausage comes up with a good name (TestClass::testFunction) and reports it with your test so it's easy to find on your tests page.

Automatic Test Status Reporting

Since Selenium commands might be successful but your test still fails because of an assertion, there is in principle no way for Sauce Labs to know whether a particular run was a pass or fail. Sausage catches any failed assertions and makes sure to report the status of the test to Sauce after it's complete, so as you're looking at your log of tests you can easily see which passed and which failed.

Automatic Authorized Link Generation

Upon test failure, Sausage generates a authorized link to the failed job report on the Sauce Labs website, to facilitate reporting to people who need to know the details of the test. The job remains private (unless you change the status yourself), but others can follow the link without needing to log in with your credentials.

Build IDs

If you're running your tests as part of your build, you can define a build id, either by updating the browser arrays to include a 'build' parameter, or (more reasonably), defining an environment variable SAUCE_BUILD, like so:

SAUCE_BUILD=build-1234 vendor/bin/phpunit MyAwesomeTestCase.php

SpinAsserts

SpinAsserts are awesome and you should really use them. Luckily, Sausage comes with a SpinAssert framework built in. Let's say we want to perform a check and we're not exactly sure how quickly the state will change to what we want. We can do this:

This will submit a comment and wait for up to 10 seconds for the comment to show up before declaring the test failed.

The spinWait function is similar and allows you to wait for a certain condition without necessarily asserting anything of it.

Sauce Connect

Sauce Connect is a special tunnel-creating binary application (see the Sauce Connect Docs). It is bundled as another composer package (sauce/connect), which you can add to your composer.json requirements:

If you've already run vendor/bin/sauce_config or otherwise set your Sauce credentials, starting sauce connect is as easy as:

vendor/bin/sauce_connect

(Or for Windows):

vendor\bin\sauce_connect.bat

Run that and you'll be testing against your local test server in no time!

Ignoring certificate validation

To connect to saucelabs, cURL is used. Sometimes certificate validation may fail, resulting in an error similar to this:

You can manually disable curl certificate validation if needed by setting an environment variable SAUCE_DONT_VERIFY_CERTS. If any value is set, validation is skipped completely.


All versions of sauce-sausage with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
sauce/sausage-installer Version >=0.1.0
phpunit/phpunit-selenium Version >=3.0.2
brianium/paratest Version >=0.13.2
appium/php-client Version >=0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jayak/sauce-sausage contains the following files

Loading the files please wait ....