Skip to content

Latest commit

 

History

History
executable file
·
94 lines (74 loc) · 3.7 KB

File metadata and controls

executable file
·
94 lines (74 loc) · 3.7 KB

Welcome to the example of Codeception + Robo + Allure!

Prerequisites

  • Codeception, Allure and Robo are PHP based applications installed via Composer, so you will need to have Composer installed in order to run the following. Please visit the Composer homepage for installation instructions.
  • Some settings need to be adjusted to meet the build environment settings in the appropriate XXX.suite.yml file in the [PROJECT_ROOT]/tests/ directory: [PROJECT_ROOT]/tests/XXXXXXX.suite.yml

Configuration

  • Create .env file by copying existing .env.example file at project root directory.

    cp .env.example .env 
    
  • Configure the following environment variables according to Magento application being tested.

    MAGENTO_BASE_URL=http://magento.loc/index.php
    
    MAGENTO_BACKEND_NAME=admin
    MAGENTO_ADMIN_USERNAME=admin
    MAGENTO_ADMIN_PASSWORD=123123q
    
    DB_DSN=''
    DB_USERNAME=''
    DB_PASSWORD=''
    
  • [Optional] If you wish to customize entire test suite locally, you can create codeception.yml by copying existing codeception.dist.yml, and make change in codeception.yml.

    cp codeception.dist.yml codeception.yml
    
  • [Optional] If you wish to customize acceptance test suite locally, you can create acceptance.suite.yml by copying existing acceptance.suite.dist.yml, and make change in acceptance.suite.yml.

    cp acceptance.suite.dist.yml acceptance.suite.yml
    

Running the Tests

  • Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies:

    cd [LOCATION_OF_GITHUB_REPO]
    composer install
    
  • Build the project:

    vendor/bin/codecept build
    
  • You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions: http://wiki.qatools.ru/display/AL/Allure+Commandline.

  • Next you will need to start a Selenium server so we can run the tests (This will vary based on your local setup).

  • Then open a New Terminal Window.

  • Kick off the entire E2E Test Suite run the following command:

    robo test
    
  • To kick off some example tests with 2 test cases run the following command:

    robo example
    

Testing using Robo

  • You can run the following test suites using robo:

    • Run the tests marked with @group chrome: robo chrome
    • Run the tests marked with @group firefox: robo chrome
    • Run the tests marked with @group phantomjs: robo phantomjs

Allure + Robo

  • You can generate an Allure report, open an Allure report or both using robo:
    • Generate a report from [PROJECT_ROOT]/tests/_output/allure-results/: robo allure:generate
    • Open a generate report from [PROJECT_ROOT]/tests/_output/allure-report: robo allure:open
    • Generate a report and open it: robo allure:report

Testing Environments

  • You can run a subset of Tests by editing a command in the file RoboFile.php or by running codecept directly:

    codecept run --env chrome

    codecept run --env firefox

    codecept run --env phantomjs

    codecept run --env chrome --group slow

RoboFile.php

  • Edit the following command to change the Tests that the command robo test executes:

    $this->_exec('codecept run --env chrome');
    

TROUBLESHOOTING