2017 © Pedro Peláez
 

library codeception-events-scripting

The Codeception extension for automatically running shell scripts on codeception events

image

oprudkyi/codeception-events-scripting

The Codeception extension for automatically running shell scripts on codeception events

  • Friday, June 17, 2016
  • by oprudkyi
  • Repository
  • 2 Watchers
  • 9 Stars
  • 13,458 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 9 Versions
  • 10 % Grown

The README.md

oprudkyi/codeception-events-scripting The Codeception extension for automatically running shell scripts on codeception events., (*1)

Latest Stable Version Total Downloads License Build Status, (*2)

About

Run shell scripts on codeception's events - before/after tests/suites (like db seeding, stopping-running additional software etc.) Inspired by Phantoman extension for Codeception, though allow to run anything in more generic way., (*3)

Minimum Requirements

  • Codeception 2.1.0
  • PHP 5.5

Installation

This project can be installed via Composer. To get the latest version, simply add the following line to the require block of your composer.json file:, (*4)

{
    "require-dev": {
            "oprudkyi/codeception-events-scripting": "*"
    }

}

You'll then need to run composer install or composer update to download the package and have the autoloader updated., (*5)

Or run the following command:, (*6)

    composer require oprudkyi/codeception-events-scripting --dev

Configuration

Enable extension in the codeception.yml and write commands. Next events are supported: - BeforeAll - run before tests on every "codecept run" - AfterAll - run after all tests - BeforeSuite - run before each suite (use 'suites' array to run only for selected suites) - AfterSuite - run after each suite (use 'suites' array to run only for selected suites), (*7)

supported next attributes: - command - command line to run (for one-liners you can write command directly) - description - echoed before command - params - additional params for command - ignoreErrors - don't break testing if command fails (failed or retval != 0) - suites - single name or array of suites to run command for (applied to base name, like 'acceptance' as well to long name 'acceptance (phantom, firefox)') - environments - single name or array of environments - platforms - single name or array of platforms (uses PHP_OS constant, i.e. the platform where PHP was built, check here for details), (*8)

extensions:
    enabled:
        - Codeception\Extension\EventsScripting
    config:
        Codeception\Extension\EventsScripting:
            BeforeAll:
                - command: echo "Before All"
                - command: echo "Before All with Description"
                  description: Description of command
                - echo "Before All single line"
                - command: echo 
                  params: "Before All Params"
                  description: Before All with Params
                - command: "false"
                  description: BeforeAll. fail on run but ignore errors
                  ignoreErrors: true
            AfterAll:
                - command: echo "After All"
                - command: uname
                  description: Platform *nx-like
                  platforms: [darwin, linux, bsd, unix]
                - command: ver
                  description: Platform Windows
                  platforms: windows
            BeforeSuite:
                - command: echo "Before acceptance suite"
                  suites: ['acceptance']
                - command: echo "Before any suite"
                - command: echo "Before acceptance suite, phantom environment"
                  suites: ['acceptance']
                  environments: phantom
                - command: echo "Before acceptance suite, phantom,chrome environments"
                  suites: ['acceptance']
                  environments: ['phantom', 'chrome']
            AfterSuite:
                - command: echo "After acceptance suite"
                  suites: 'acceptance'
                - command: echo "After any suite"

Real example (start/stop mailcatcher and seed db):, (*9)

        Codeception\Extension\EventsScripting:
          BeforeAll:
              - command: ./artisan db:seed-test --env=testing
                description: Reset db and seed
          BeforeSuite:
              - command: GEM_HOME=vendor/ruby vendor/ruby/bin/mailcatcher --ip 127.0.0.1 --smtp-port 11031 --http-port 11091
                suites: 'acceptance' 
                description: Start mailcatcher
          AfterSuite:
              - command: curl -s -X DELETE http://127.0.0.1:11091
                suites: 'acceptance' 
                description: Stop mailcatcher
                ignoreErrors: true

Testing

cd sample
composer install -n --prefer-source
cd ../test
composer install -n --prefer-source
./vendor/bin/codecept run

Contribute

This package is (yet) under development and refactoring but is ready for production. Please, feel free to comment, contribute and help. I will be happy to get some help to deliver tests., (*10)

License

Codeception's events scripting is licensed under The MIT License (MIT)., (*11)

The Versions

17/06 2016

dev-master

9999999-dev

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

17/06 2016

v1.0.6

1.0.6.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

17/06 2016

v1.0.7

1.0.7.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

10/06 2016

v1.0.5

1.0.5.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

24/05 2016

v1.0.4

1.0.4.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

26/04 2016

v1.0.3

1.0.3.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

25/04 2016

v1.0.2

1.0.2.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

25/04 2016

v1.0.1

1.0.1.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception

25/04 2016

v1.0.0

1.0.0.0

The Codeception extension for automatically running shell scripts on codeception events

  Sources   Download

MIT

The Requires

 

by Oleksii Prudkyi

extension shell codeception