How to configure and start working with Magento Test Automation Framework

Magento TAF is a pretty good thing to automize your Magento store testing. When you start working with Magento TAF, you have many tests, which are ready for use, so this framework can help to develop all kinds of tests without building an automatic infrastructure. Since a TAF users guide is a bit outdated, and some things in the framework have been already changed we’ve decided to write an article on this topic.

  • At the base level, Magento TAF will require the following software:
  • PHP: 5.2.0 or later
  • PHPUnit: 3.5 or later
  • Java SE Development Kit
  • Apache
  • MySQL Server
  • Selenium RC 2.0.3

Furthermore, Magento TAF contains the following two configuration files:

1. config.yml  – contains the settings of the Selenium Server.
It is located in:

Here is a default content:

## Set up browsers for running tests  ##                         

// List of browsers which can be used
    googlechrome: &googlechrome
         name: 'Google Chrome'

// Browser name
         browser: '*googlechrome'

// Host where it is installed and will be run
         host: 'localhost'

// Port on the Host where this browser will be available
         port: 4444

         timeout: 60
    firefox: &firefox
         name: 'Firefox'
         browser: '*chrome'
         host: 'localhost'
         port: 4444
         timeout: 60
    iexplorer: &iexplorer
         name: 'Internet Explorer'
         browser: '*iexplore'
         host: 'localhost'
         port: 4444
         timeout: 60

// Default browser for run tests
    default: *firefox

## Framework configuration  ##      


// Base pathes to the fixture and testsuite
    fixture_base_path: 'fixture'
    testsuite_base_path: 'testsuite'

    // work only if tests are run for single browser
    shareSession: true
    coverageScriptUrl: ''

  // Capture screenshot on failure works only for browsers that support it: Firefox/Chrome, IE with snapsIE tool
    captureScreenshotOnFailure: true

// Parameter sets up the saves HTML pages on failure
    saveHtmlPageOnFailure: false

    load_all_uimaps: true
    load_all_data: true
            name: 'core'
                caching: false
                cache_id_prefix: 'selenium_'
                automatic_serialization: true
            name: 'file'
                cache_dir: 'var/cache'

##  Applications for running tests   ##

//List of Applications which can be tested


//Settings of Magento  application

// Name of  Magento application
    mage: &mage

        fallbackOrderFixture: 'default'
        fallbackOrderHelper: 'Core'

// General link, base UImap, login and password to the backend
                url: ''
                base_page_uimap: 'log_in_to_admin'
                uimap_path: 'admin'
                login: 'admin_login'
                password: 'admin_password'

// General link, base UImap, login and password to the frontend
                url: ''
                base_page_uimap: 'home_page'
                uimap_path: 'frontend'
                login: ''
                password: ''

// General link, base UImap, login and password to the paypal sandbox           
 paypal_sandbox: &paypalSandbox
                url: ''
                base_page_uimap: 'paypal_sandbox'
                uimap_path: 'paypal_sandbox'
                login: 'paypal_sandbox_login'
                password: 'paypal_sandbox_password'

// General link, base UImap, login and password to the paypal developer
            paypal_developer: &paypalDeveloper
                url: ''
                base_page_uimap: 'paypal_developer_home'
                uimap_path: 'paypal_developer'
                login: 'paypal_developer_login'
                password: 'paypal_developer_password'

// Default Magento application which can be used
    default: *mage

2. phpunit.xml – contains the list of the test-scripts (test cases) to be run, and it is located in:

Default content:

<phpunit backupGlobals="true"
        <testsuite name="Test Suite">
            <directory suffix=".php">tests/Customer/</directory>
        <log type="json" target="./var/logs/logfile.json"/>
        <log type="tap" target="./var/logs/logfile.tap"/>
        <log type="junit" target="./var/logs/logfile.xml" logIncompleteSkipped="false"/>
        <log type="testdox-html" target="./var/logs/testdox.html"/>
        <log type="testdox-text" target="./var/logs/testdox.txt"/>

Then, for executing all tests, you should change the test suite name to All Tests, choose directory with all tests, and leave empty test name in the phpunit.xml file, like on the following example:

        <testsuite name="All Tests">
            <directory suffix=".php">testsuite</directory>

Moreover, for executing one or few test suites, you should change a test suite name to Test Suite, choose the directories with test suites and leave empty test name. If you want to execute all tests from the suite, it is necessary to enter the name of a single test from the chosen directory:

        <testsuite name="Test Suite">
            <directory suffix="RegisterTest.php">testsuite/core/Mage/Customer/</directory>
 <directory suffix=".php">testsuite/core/mage/Newsletter/</directory>

For executing a single test, you should change a test suite name to Single Test, enter full name of the test file and full path to this file:

        <testsuite name="Single Test">
            <directory suffix="SimpleTest.php">testsuite/core/Mage/Product/Create/</directory>

In case of executing Magento TAF – follow these steps:

1. Run Selenium Server.

$ java -jar BaseDir/selenium-server-standalone-x.xx.x.jar

2. Execute runtest.bat (in Windows) through the command prompt for test running.

3. Execute for Linux/*NIX OS through the terminal for the running.

$ sh BaseDir/

After executing in the terminal, you will be able to see the current progress.
When all the tests have been executed, you’ll see a description of all failures, errors, incompletes, skips.


  • “.” – test PASSed
  • “S” – test SKIPped
  • “I” – test INCOMPLETE
  • “F” – test FAILed
  • “E” – error appears during test running
Configuration read from /Users/admin/taf/magento-afw/phpunit.xml

..FF.........................................F.................  63 / 241 ( 26%)
....................F.............F............................ 126 / 241 ( 52%)
..........F...............F.................................F.F 189 / 241 ( 78%)

Time: 20.13 hours, Memory: 36.00Mb

There was 1 error:

1) Core_Mage_Product_DuplicateTest::duplicateConfigurable
OutOfRangeException: Cannot find page with mca "catalog_product/edit/attributes/NjQ1/set/4/type/configurable" in "admin" area



There were 14 failures:

1) Core_Mage_Product_Create_BundleTest::allFieldsForDynamic
general_news_from: The stored value is not equal to specified: ('1/8/14' != '1/8/2014')
general_news_to: The stored value is not equal to specified: ('1/8/14' != '1/8/2014')
prices_special_price_from: The stored value is not equal to specified: ('1/8/14' != '1/8/2014')
prices_special_price_to: The stored value is not equal to specified: ('1/8/14' != '1/8/2014')
design_active_from: The stored value is not equal to specified: ('1/8/14' != '1/8/2014')
design_active_to: The stored value is not equal to specified: ('1/8/14' != '1/8/2014')


That’s all for now. We hope this article will help you to start working with the test automation framework and you are welcome to share your experience and thoughts about it in the comments.