neam/codeception-saucelabs-metadata

Codeception extension that provides metadata to Saucelabs when running tests

dev-develop 2015-10-21 21:32 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:17:22 UTC


README

Codeception extension that provides metadata to Saucelabs when running tests.

Requirements

  • A Saucelabs account
  • A Codeception acceptance testing suite that is configured to run tests against Saucelabs
  • Codeception >= 2.0.2

Installation

  1. Install Codeception via Composer
  2. Run composer require neam/codeception-saucelabs-metadata dev-develop
  3. Include the extension into codeception.yml configuration:

Sample configuration:

paths:
    tests: tests
    log: tests/_log
    data: tests/_data
    helpers: tests/_helpers
extensions:
    enabled:
      - Codeception\Extension\SaucelabsMetadata
    config:
      Codeception\Extension\SaucelabsMetadata:
          username: "foouser"
          accesskey: "secretavbcde1234"
          build: "Shows up in the Build column in the Saucelabs dashboard"
          tags: "shows up,in the tags column,in the saucelabs dashboard"

Testing this extension

Run the following from the same directory as this README (change the access details accordingly):

composer install
vendor/bin/codecept bootstrap
vendor/bin/codecept generate:cept acceptance ExampleTest

export SAUCE_USERNAME="changeme"
export SAUCE_ACCESS_KEY="changeme"
export SAUCE_METADATA_BUILD="foo"
export SAUCE_METADATA_TAGS="foo,bar,zoo"
export SELENIUM_HOST=$SAUCE_USERNAME:$SAUCE_ACCESS_KEY@ondemand.saucelabs.com
export SELENIUM_PORT=80

erb extension-testing/codeception.yml.erb > codeception.yml
erb extension-testing/acceptance.suite.yml.erb > tests/acceptance.suite.yml
cp extension-testing/*Cept.php tests/acceptance/

vendor/bin/codecept run acceptance

Verify in your Saucelabs dashboard that the tests show up properly.