Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Latest commit

 

History

History
60 lines (44 loc) · 1.9 KB

README.md

File metadata and controls

60 lines (44 loc) · 1.9 KB

Codeception Extension: Saucelabs Metadata

Codeception extension that provides metadata to Saucelabs when running tests.

Modified by Datalink to have the correct include path to vendor/autoload.php

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.