Behat for Magento

Overview

BehatMage

Build Status Scrutinizer Code Quality

Behat extension for Magento, providing Behat context with specific Magento requirements allowing you to quickly define Magento scenarios and steps to enable BDD within Magento projects.

Target

  • To create a tool that makes testing easy and straight forward to use for testing external behavior of Magento.
  • To create a tool that provides clear feedback when exceptions are raised. The feedback should coach the developer on how to resolve the issue and the messaging should be correct to the Magento domain.

How?

  • The tool can be installed easily with composer.
  • The creation of standard scenarios can be accomplished without the need to create new contexts.
  • There are no exceptions raised that do not provide feedback on how to proceed or resolve the issue.
  • The documentation includes examples of how to use each feature of the tool.

Installation

Prerequisites

BehatMage requires PHP 5.3.x or greater.

Install using composer

For this document we assume the directory layout is as follows.

project-dir
├── behat.yml
├── bin
│   └── behat
├── composer.json
├── composer.lock
├── features
│   ├── bootstrap
│   └── ...
├── htdocs
│   ├── app
│   ├── downloader
│   ├── index.php
│   ├── js
│   ├── skin
│   ├── var
│   └── ...
└── vendor
    ├── autoload.php
    ├── behat
    ├── magetest
    └── ...

We are assuming you will be keeping your behat features declarations and will be calling the behat script from your project directory (one step above your Magento base dir). Of course, any other layout is possible, too. Just be aware of the following adjustments you will have to make:

  • The behat.yml file needs to be in the directory where you call the behat script from.
  • The composer.json PSR-0 autoload path declaration will need to be adjusted.
  • The default.paths.features setting in your behat.yml will need to be adjusted.

First, add BehatMage to the list of dependencies inside your composer.json and be sure to register few paths for autoloading:

{
    "config": {
        "bin-dir": "bin"
    },
    "require": {
        "php": ">=5.3.0"
    },
    "require-dev": {
        "magetest/magento-behat-extension": "dev-develop"
    },
    "autoload": {
        "psr-0": {
            "": [
                "htdocs/app",
                "htdocs/app/code/local",
                "htdocs/app/code/community",
                "htdocs/app/code/core",
                "htdocs/lib"
            ]
        }
    },
    "minimum-stability": "dev"
}

Then simply install it with composer:

$ composer install --dev --prefer-dist

You can read more about Composer on its official webpage.

Basic usage

Change directory to your project one and setup behat inside the directory:

$ cd project
$ bin/behat --init

The behat --init will create a features/ directory with some basic things to get your started. The output on the screen should be similar to:

$ bin/behat --init
+d features - place your *.feature files here
+d features/bootstrap - place bootstrap scripts and static files here
+f features/bootstrap/FeatureContext.php - place your feature related code here

Define your feature

Everything in Behat always starts with a feature that you want to describe and then implement. In this example, the feature will be give an admin user the ability to manage review visibility, so we can start by creating a features/admin_user_manages_review_visibility.feature file:

Feature: Admin User can manage review visibility
    So that our Customers are not influenced by a product with bad review history,
    as an Admin User
    I want to disable reviews of those specific products

Every feature starts with this same format: a line naming the feature, followed by three lines that describe the benefit, the role and the feature itself. And while this section is required, its contents aren’t actually important to Behat or your eventual test. This section is important, however, so that each feature is described consistently and is readable by other people.

Define a scenario

Next, add the following scenario to the end of the features/admin_user_manages_review_visibility.feature file:

Scenario: Turn off reviews per product
    Given the following products exist:
        | sku      | name           | accepts_reviews |
        | Ottoman1 | Ottoman        | 1               |
    And "Ottoman1" has existing reviews
    When I turn reviews off for "Ottoman1" product
    Then no review should be displayed for "Ottoman1"

Each feature is defined by one or more “scenarios”, which explain how that feature should act under different conditions. This is the part that will be transformed into a test. Each scenario always follows the same basic format:

Scenario: Some description of the scenario
    Given [some context]
    When [some event]
    Then [outcome]

Each part of the scenario - the context, the event, and the outcome - can be extended by adding the And or But keyword:

Scenario: Some description of the scenario
    Given [some context]
        And [more context]
    When [some event]
        And [second event occurs]
    Then [outcome]
        And [another outcome]
        But [another outcome]

There’s no actual difference between, Then, And But or any of the other words that start each line. These keywords are all made available so that your scenarios are natural and readable.

Executing Behat

You’ve now defined the feature and one scenario for that feature. You’re ready to see Behat in action! Try executing Behat from inside your project directory:

$ bin/behat

If everything worked correctly, you should see something like this:

Feature: Admin User can manage review visibility
  So that our Customers are not influenced by a product with bad review history,
  as an Admin User
  I want to disable reviews of those specific products

  Scenario: Turn off reviews per product              # features/reviews/admin_user_manages_review_visibility.feature:7
    Given the following products exist:
      | sku      | name    | accepts_reviews |
      | Ottoman1 | Ottoman | 1               |
    And "Ottoman1" has existing reviews
    When I turn reviews off for "Ottoman1" product
    Then no review should be displayed for "Ottoman1"

1 scenario (1 undefined)
4 steps (4 undefined)
0m1.836s

You can implement step definitions for undefined steps with these snippets:

    /**
     * @Given /^the following products exist:$/
     */
    public function theFollowingProductsExist(TableNode $table)
    {
        throw new PendingException();
    }

    /**
     * @Given /^"([^"]*)" has existing reviews$/
     */
    public function hasExistingReviews($arg1)
    {
        throw new PendingException();
    }

    /**
     * @When /^I turn reviews off for "([^"]*)" product$/
     */
    public function iTurnReviewsOffForProduct($arg1)
    {
        throw new PendingException();
    }

    /**
     * @Then /^no review should be displayed for "([^"]*)"$/
     */
    public function noReviewShouldBeDisplayedFor($arg1)
    {
        throw new PendingException();
    }

Writing your step definition

Behat automatically finds the feature/admin_user_manages_review_visibility.feature file and tries to execute its Scenario as a test. However, we haven’t told Behat what to do with statements like Given the following products exist, which causes an error. Behat works by matching each statement of a Scenario to a list of regular expression “steps” that you define. In other words, it’s your job to tell Behat what to do when it sees Given the following products exist. Fortunately, Behat helps you out by printing the regular expression that you probably need in order to create that step definition:

You can implement step definitions for undefined steps with these snippets:

    /**
     * @Given /^the following products exist:$/
     */
    public function theFollowingProductsExist(TableNode $table)
    {
        throw new PendingException();
    }

    /**
     * @Given /^"([^"]*)" has existing reviews$/
     */
    public function hasExistingReviews($arg1)
    {
        throw new PendingException();
    }

    /**
     * @When /^I turn reviews off for "([^"]*)" product$/
     */
    public function iTurnReviewsOffForProduct($arg1)
    {
        throw new PendingException();
    }

    /**
     * @Then /^no review should be displayed for "([^"]*)"$/
     */
    public function noReviewShouldBeDisplayedFor($arg1)
    {
        throw new PendingException();
    }

Behat, however, is not aware yet of the Magento domain and it's requiring us to add step definitions that we likely want to skip because of their repetitive nature. We then have to make Behat be Magento aware using its configuration file behat.yml adding the following lines:

default:
  extensions:
    MageTest\MagentoExtension\Extension:
      base_url: "http://project.development.local"

  # The default is to have the features directory inside the project directory
  # If you want the features directory inside the Magento installation, set paths.features:
  #paths:
  #  features: htdocs/features

where we tell Behat which extension to load and what store we want to test.

Well done so far, we now have to tell Behat that we want to use, just for clarity, a specific sub context for every actor that we have, in our example admin user. In order to do so we have to update the features/bootstrap/FeatureContext.php file as following:

<?php
# features/bootstrap/FeatureContext.php

use Behat\Behat\Context\ClosuredContextInterface,
    Behat\Behat\Context\TranslatedContextInterface,
    Behat\Behat\Context\BehatContext,
    Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
    Behat\Gherkin\Node\TableNode;

//
// Require 3rd-party libraries here:
//
//   require_once 'PHPUnit/Autoload.php';
//   require_once 'PHPUnit/Framework/Assert/Functions.php';
//

/**
 * Features context.
 */
class FeatureContext extends BehatContext
{
    /**
     * Initializes context.
     * Every scenario gets it's own context object.
     *
     * @param array $parameters context parameters (set them up through behat.yml)
     */
    public function __construct(array $parameters)
    {
        // Initialize your context here
        $this->useContext('admin_user', new AdminUserContext($parameters));
    }
}

and create such a sub context as php class extending the MagentoContext provided by the BehatMage extension as following:

<?php
# features/bootstrap/AdminUserContext.php

use Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\TableNode;
use MageTest\MagentoExtension\Context\MagentoContext;

class AdminUserContext extends MagentoContext
{

}

If we run Behat again, now that the framework is aware of the Magento domain, our output should be different and look something this:

Feature: Admin User can manage review visibility
  So that our Customers are not influenced by a product with bad review history,
  as an Admin User
  I want to disable reviews of those specific products

  Scenario: Turn off reviews per product              # features/reviews/admin_user_manages_review_visibility.feature:7
    Given the following products exist:               # AdminUserContext::theProductsExist()
      | sku      | name    | accepts_reviews |
      | Ottoman1 | Ottoman | 1               |
      accepts_reviews is not yet defined as an attribute of Product
    And "Ottoman1" has existing reviews
    When I turn reviews off for "Ottoman1" product
    Then no review should be displayed for "Ottoman1"

1 scenario (1 failed)
4 steps (3 undefined, 1 failed)
0m1.481s

You can implement step definitions for undefined steps with these snippets:

    /**
     * @Given /^"([^"]*)" has existing reviews$/
     */
    public function hasExistingReviews($arg1)
    {
        throw new PendingException();
    }

    /**
     * @When /^I turn reviews off for "([^"]*)" product$/
     */
    public function iTurnReviewsOffForProduct($arg1)
    {
        throw new PendingException();
    }

    /**
     * @Then /^no review should be displayed for "([^"]*)"$/
     */
    public function noReviewShouldBeDisplayedFor($arg1)
    {
        throw new PendingException();
    }

As you can see the recommendation to add the following snippet disappeared

    /**
     * @Given /^the following products exist:$/
     */
    public function theFollowingProductsExist(TableNode $table)
    {
        throw new PendingException();
    }

this because BehatMage provides already the implementation of all those common steps generally needed and required to test Magento behaviours. So now let’s use Behat’s advice and add the following to the features/bootstrap/AdminUserContext.php file:

<?php
# features/bootstrap/AdminUserContext.php

use Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\TableNode;
use MageTest\MagentoExtension\Context\MagentoContext;

class AdminUserContext extends MagentoContext
{
    /**
     * @Given /^"([^"]*)" has existing reviews$/
     */
    public function hasExistingReviews($arg1)
    {
        throw new PendingException();
    }

    /**
     * @When /^I turn reviews off for "([^"]*)" product$/
     */
    public function iTurnReviewsOffForProduct($arg1)
    {
        throw new PendingException();
    }

    /**
     * @Then /^no review should be displayed for "([^"]*)"$/
     */
    public function noReviewShouldBeDisplayedFor($arg1)
    {
        throw new PendingException();
    }
}

or let Behat do it for us using the following commandline option:

$ bin/behat --append-to=AdminUserContext

Great! Now that you’ve defined all of your steps and told Behat what context to use, run Behat again:

$ bin/behat

If everything worked correctly, you should see something like this:

Feature: Admin User can manage review visibility
  So that our Customers are not influenced by a product with bad review history,
  as an Admin User
  I want to disable reviews of those specific products

  Scenario: Turn off reviews per product              # features/reviews/admin_user_manages_review_visibility
    Given the following products exist:               # AdminUserContext::theProductsExist()
      | sku      | name    | accepts_reviews |
      | Ottoman1 | Ottoman | 1               |
      accepts_reviews is not yet defined as an attribute of Product
    And "Ottoman1" has existing reviews               # AdminUserContext::hasExistingReviews()
    When I turn reviews off for "Ottoman1" product    # AdminUserContext::iTurnReviewsOffForProduct()
    Then no review should be displayed for "Ottoman1" # AdminUserContext::noReviewShouldBeDisplayedFor()## Some more about Behat basics

As you can see Behat is providing to the developer, thanks to the BehatMage extension, meaningful and useful information about the next step to take in order to implement the required behaviour. So let's add the needed code to make the first requirement of our step pass. Create the following files based on the suggested code:

<?xml version="1.0"?>
<!-- app/code/local/BehatMage/Catalog/etc/config.xml -->
<config>
    <modules>
        <BehatMage_Catalog>
            <version>0.1.0</version>
            <depends>
                <Mage_Catalog />
            </depends>
        </BehatMage_Catalog>
    </modules>
    <global>
        <resources>
            <behatmage_catalog_setup>
                <setup>
                    <module>BehatMage_Catalog</module>
                    <class>Mage_Catalog_Model_Resource_Setup</class>
                </setup>
            </behatmage_catalog_setup>
        </resources>
    </global>
</config>
<?xml version="1.0"?>
<!-- app/etc/modules/BehatMage_Catalog.xml -->
<config>
    <modules>
        <BehatMage_Catalog>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Catalog />
            </depends>
        </BehatMage_Catalog>
    </modules>
</config>
<?php
# app/code/local/BehatMage/Catalog/data/behatmage_catalog_setup/data-install-0.1.0.php

/** @var Mage_Catalog_Model_Resource_Setup $this */
$installer = $this;

$installer->startSetup();

$installer->addAttribute('catalog_product', 'accepts_reviews', array(
    'group' => 'General',
    'input' => 'boolean',
    'type' => 'int',
    'label' => 'Accept Reviews',
    'default' => true,
    'user_defined' => true,
    'visible_on_front' => true,
    'visible_in_advanced_search' => false,
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

$installer->endSetup();

Once the files have been created clear the Magento cache in order to run the setup script and add the required attribute. It's now time to run Behat again:

$ bin/behat

If everything is successful your output should now be something like this:

Feature: Admin User can manage review visibility
  So that our Customers are not influenced by a product with bad review history,
  as an Admin User
  I want to disable reviews of those specific products

  Scenario: Turn off reviews per product              # features/reviews/admin_user_manages_review_visibility.feature:7
    Given the following products exist:               # AdminUserContext::theProductsExist()
      | sku      | name    | accepts_reviews |
      | Ottoman1 | Ottoman | 1               |
    And "Ottoman1" has existing reviews               # AdminUserContext::hasExistingReviews()
      TODO: write pending definition
    When I turn reviews off for "Ottoman1" product    # AdminUserContext::iTurnReviewsOffForProduct()
    Then no review should be displayed for "Ottoman1" # AdminUserContext::noReviewShouldBeDisplayedFor()

1 scenario (1 pending)
4 steps (1 passed, 2 skipped, 1 pending)
0m6.478s

As you can see now that our product definition has the required attribute Behat moved onto the next step of our scenario. As you can imagine now it's only a matter of implementing, step by step, all the required tests and code to adhere to the previously defined scenario.

More about Features

More about Steps

The Context Class: MagentoContext

The BehatMage Command Line Tool

What’s Next?

Issue Submission

Make sure you've read the issue submission guidelines before you open a new issue.

Contribute

See the contributing docs

License and Authors

Authors: https://github.com/MageTest/BehatMage/contributors

Copyright (C) 2012-2013

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Avoid MySQL integrity constraint violation

    Avoid MySQL integrity constraint violation

    I followed the sample in README and on my second run of the test, it showed this error.

    Unable to create the Magento fixture SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-1' for key 'UNQ_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID'

    I followed the solution in this page (http://www.magentocommerce.com/boards/viewthread/300959/)

    opened by vernard 6
  • Basic steps do not work

    Basic steps do not work

    The simple steps like "I should see" etc. do not work Running behat as described in the README.md it fails to do this:

    Scenario: Display Header
        Given I log in as admin user "admin" identified by "123123pass"
         When I open admin URI "/admin/process/list"
         Then I should see text "Index Management"
    

    In a dry-run it tells me to create the step:

    You can implement step definitions for undefined steps with these snippets:
    
        /**
         * @Then /^I should see text$/
         */
        public function iShouldSeeText()
        {
            throw new PendingException();
        }
    
    opened by ScreamingDev 5
  • Prevent fixture from creating an empty product.

    Prevent fixture from creating an empty product.

    Unable to create the Magento fixture Notice: Undefined index: sku in vendor/magetest/magento-behat-extension/src/MageTest/MagentoExtension/Fixture/Product.php line 70

    opened by robjstanley 4
  • Add media gallery to product fixture with updated product spec

    Add media gallery to product fixture with updated product spec

    Allow products to be created with an image.

        Given the following products exist:
          | name | sku  | type_id | price | tax_class_id | image                                          | category_ids |
          | test    | test  | simple  | 10.00 | 2                  | features/assets/placeholder.png | 2                   |
    
    opened by jamescowie 3
  • Update composer.json to support later versions of behat

    Update composer.json to support later versions of behat

    Behat 3.1 has been released almost a year ago. Having such a restricted version specified in the composer.json means projects using this library can't use Behat 3.1+ (3.3 released in December)

    opened by andytson-inviqa 2
  • Expose FixtureFactory in MagentoContext

    Expose FixtureFactory in MagentoContext

    I discovered an issue using fixtures when extending from MagentoContext. I found I couldn't access the FixtureFactory unless I extended from RawMagentoContext (which has a getFixtureFactory() method) - but that caused problems because it contains all the steps defined in MinkContext, which caused duplication and threw ambiguous exceptions.

    My solution to this was to implement getFixtureFactory() in MagentoContext. It seems like this method was omitted originally, as all the other private properties ($app, $configManager, $cacheManager, $sessionService) have getters and setters, but $factory only has a setter, and then getFixture().

    I'm not sure whether this omission was intentional or accidental, I think the original intention was to use getFixture() to return these objects, but a change in the FixtureFactory implementation means this no longer works.

    opened by daveherbert 2
  • Selenium 2 webdriver not found bug

    Selenium 2 webdriver not found bug

    Hi,

    I am using this setup in combination with the latest selenium rc. Everytime i pass a condition into my wait like:

    $this->getSession()->wait(5000, "$('testdiv').visible()");

    I get the following error:

    Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33' System info: host: 'toonvd-Precision-M4600', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.8.0_20' Driver info: driver.version: unknown

    This was not a problem with the old version of this repo (like 6 months ago). Do you guys have any ideas on how to fix this?

    Thx

    question 
    opened by toonvd 2
  • Avoid MySQL integrity constraint violation (updated tests for #62)

    Avoid MySQL integrity constraint violation (updated tests for #62)

    I've updated the specs in line with the change that @vernard performed in #62. I couldn't see the value of having that ->ordered() call there, feel free to educate!

    opened by punkstar 2
  • SQLSTATE[HY000] [2002] Connection refused / Connection to Redis failed after 2 failures

    SQLSTATE[HY000] [2002] Connection refused / Connection to Redis failed after 2 failures

    I am able to run Behat and test various scenarios that I have defined but when include: MageTest\MagentoExtension\Extension: ~ within my behat.yml file I get

    SQLSTATE[HY000] [2002] Connection refused
    or a redis error if enabling redis in the Magento config.

    Connecting to my Magento instance only seems to be an issue when including this module. I am thinking it might be to do with the way i am adding it to behat.yml or the way i installed using composer ("magetest/magento-behat-extension": "dev-develop").

    I am using a VM to run my site but am ruling access issues out due to the fact i can connect via a browser or Behat once this module is removed.

    Any ideas? I really want to use and contribute to this module, it looks like a great project.

    opened by jimains 2
  • [ReflectionException]  Class Mage_Core_Model_Config_Data does not exist

    [ReflectionException] Class Mage_Core_Model_Config_Data does not exist

    Hi, I have just followed your tutorial to setup magento with behat. After I added this in my behat.yml :

    default: extensions: MageTest\MagentoExtension\Extension: base_url: "http://mywebsite.local.com"

    Then, I executed bin/behat and I got this error in my terminal : [ReflectionException] Class Mage_Core_Model_Config_Data does not exist

    opened by aldosuwandi 2
  • base_url exception

    base_url exception

    When I try to execute bin/behat it get this exception, I do have the base_url configured in my behat.yml file.

    [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
    Unrecognized option "base_url" under "testwork.magento"

    Am I missing something there?

    opened by aftabnaveed 1
  • Add PHP7, phpspec 3 and Behat 3 support

    Add PHP7, phpspec 3 and Behat 3 support

    This PR is based on the original work performed by a group of very talented engineers.

    I've only added the following on top:

    • references the latest version of Magento 1 Community Edition (1.9.4.2)
    • phpspec 3.4 support
    • updated PHP requirement to accept both 5.6 and 7.0+ (older versions of PHP are not supported by Travis any longer)
    • fixed failing specs
    opened by ubick 0
  • [Feature-Request] Use Mage:: in a Behat-Hook

    [Feature-Request] Use Mage:: in a Behat-Hook

    I have a behat test for the Customer-Registration in a Magento-Shop (1.8).

    In order to rerun the test as often as I want As a developer I want the Test to clear the generated user account in a scenario hook

    Possible Solution:

    /**
       * @param $event
       *
       * @BeforeScenario
       */
      public function before($event) {
        if ('Customer Register' == $event->getScenario()->getTitle()) {
          // Delete the TestCustomer if exists.
          $customer = Mage::getModel('customer/customer')->loadByEmail('[email protected]');
          $customer->delete();
        }
      }
    

    BUT this does not work.

    Then I move the code into a Stepdefinition it works. :(

    opened by zuernBernhard 1
  • Packagist is complaining about composer.json

    Packagist is complaining about composer.json

    I've got this email from packagist:

    Disclaimer: These email notifications are in experimental stage, if you find that they look strange or contain false or misleading information please reply to this email to let us know.

    The magetest/magento-behat-extension package of which you are a maintainer has failed to update due to invalid data contained in your composer.json. Please address this as soon as possible since the package stopped updating.

    It is recommended that you use composer validate to check for errors when you change your composer.json.

    Below is the full update log which should highlight errors as "Skipped branch ...":

    [Composer\Repository\InvalidRepositoryException]: Some branches contained invalid data and were discarded, it is advised to review the log and fix any issues present in branches

    Reading composer.json of magetest/magento-behat-extension (0.0.3) Importing tag 0.0.3 (0.0.3.0) Reading composer.json of magetest/magento-behat-extension (0.0.2) Importing tag 0.0.2 (0.0.2.0) Skipped tag 0.0.2, Invalid package information: require-dev.phpspec/phpspec2 : invalid version constraint (Could not parse version constraint magento-demo: Invalid version string "magento-demo") Reading composer.json of magetest/magento-behat-extension (0.0.1) Importing tag 0.0.1 (0.0.1.0) Skipped tag 0.0.1, Invalid package information: require-dev.phpspec/phpspec2 : invalid version constraint (Could not parse version constraint magento-demo: Invalid version string "magento-demo") Reading composer.json of magetest/magento-behat-extension (cleanup) Importing branch cleanup (dev-cleanup) Reading composer.json of magetest/magento-behat-extension (develop) Importing branch develop (dev-develop) Reading composer.json of magetest/magento-behat-extension (feature/Behat3) Skipped branch feature/Behat3, "https://api.github.com/repos/MageTest/BehatMage/contents/composer.json?ref=f6488fddf91e68b4bc6c31e91eef928d2ee9fbcc" does not contain valid JSON Parse error on line 14: ...2-driver": "*", }, "require-dev" ---------------------^ Expected: 'STRING' - It appears you have an extra trailing comma

    Reading composer.json of magetest/magento-behat-extension (feature/Product-image-fixture) Importing branch feature/Product-image-fixture (dev-feature/Product-image-fixture) Reading composer.json of magetest/magento-behat-extension (feature/created-at-fix) Importing branch feature/created-at-fix (dev-feature/created-at-fix) Reading composer.json of magetest/magento-behat-extension (feature/direct-magento-driver-proof-of-concept) Importing branch feature/direct-magento-driver-proof-of-concept (dev-feature/direct-magento-driver-proof-of-concept) Reading composer.json of magetest/magento-behat-extension (feature/enhanced-route-excpetion) Importing branch feature/enhanced-route-excpetion (dev-feature/enhanced-route-excpetion) Reading composer.json of magetest/magento-behat-extension (feature/exception-thrown-if-sku-is-missing) Importing branch feature/exception-thrown-if-sku-is-missing (dev-feature/exception-thrown-if-sku-is-missing) Reading composer.json of magetest/magento-behat-extension (feature/exceptions-thrown-from-fixtures) Importing branch feature/exceptions-thrown-from-fixtures (dev-feature/exceptions-thrown-from-fixtures) Reading composer.json of magetest/magento-behat-extension (feature/fix-date-issue-for-product-fixture) Importing branch feature/fix-date-issue-for-product-fixture (dev-feature/fix-date-issue-for-product-fixture) Reading composer.json of magetest/magento-behat-extension (feature/licensing) Importing branch feature/licensing (dev-feature/licensing) Reading composer.json of magetest/magento-behat-extension (feature/refactor) Importing branch feature/refactor (dev-feature/refactor) Reading composer.json of magetest/magento-behat-extension (feature/spec-magento-context-use-of-fixture-factory) Importing branch feature/spec-magento-context-use-of-fixture-factory (dev-feature/spec-magento-context-use-of-fixture-factory) Reading composer.json of magetest/magento-behat-extension (feature/travis) Importing branch feature/travis (dev-feature/travis) Reading composer.json of magetest/magento-behat-extension (master) Importing branch master (dev-master)

    opened by MarcelloDuarte 2
  • Direct magento driver proof of concept

    Direct magento driver proof of concept

    This is an attempt to integrate magento more directly, similarly to the way the Symfony2 driver does with symfony. It adds a new driver definition called "magento" and it can be used in place of goutte, e.g. in the behat.yml file you would have:

            Behat\MinkExtension:
                base_url: 'http://local.dev'
                magento: ~
    

    From my initial tests, with a basic magento installation, this works, although it doesn't seem to work with all magento installations I've tried (perhaps differences with Enterprise version etc.)

    The main point is, for scenarios that do not require javascript (i.e. those that currently use only the mink:goutte driver) this can speed up execution by 70-80%! (because we'd not making a real HTTP request)

    I've included a sample context for creating an admin user, although this should clearly form part of the behat-mage core, its here for demo purposes.

    opened by jon-acker 4
Owner
MageTest
MageTest
Behat Messenger Context

Behat Messenger Context Version Build Status Code Coverage master develop Installation Step 1: Install Context Open a command console, enter your proj

MacPaw Inc. 13 Jan 29, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
This Magento 2 extension integrates EasyTranslate into Magento 2.

EasyTranslate Magento 2 Connector This Magento 2 extension integrates EasyTranslate into Magento 2. Mind that you need to have an account with EasyTra

Easytranslate ApS 0 Oct 7, 2022
Magento-Functions - A Resource of Magento Functions

Magento-Functions A Resource of Magento Functions Table of Contents Category Product User Cart Checkout General Account [Working w/ URL's] (#urls) Cat

Bryan Littlefield 28 Apr 19, 2021
Magento - Magento Community Editions

Magento Community Edition /// THIS REPOSITORY IS DEPREACTED /// 1.9.4.1 will be the last version update. Please switch over to OpenMage! Either to the

FireGento e. V. 107 Oct 17, 2022
Magento-Vagrant-Puppet-Nginx - Installs magento and a nginx server

Magento-Vagrant-Puppet-Nginx Installs Magento MySQL PHP PHP-FPM Nginx n98-magerun Setup git submodule init git submodule update vagrant up Modify pupp

Christian Münch 61 Aug 10, 2022
Docker-magento - Docker image for Magento 1.6 to 1.9

Docker image for Magento 1.x This repo creates a Docker image for Magento 1.x. Please note The primary goal of this repo is to create Docker images fo

Fu Cheng 144 Nov 18, 2022
Magento-composer-installer - Composer installer for Magento modules

!!! support the maintainer of this project via Patreon: https://www.patreon.com/Flyingmana Magento Composer Installer The purpose of this project is t

null 213 Sep 24, 2022
Chef-magento - Installs and Configures a Magento project

Description Requirements Chef 0.10.0 or higher required (for Chef environment use). Platform Debian, Ubuntu CentOS, Red Hat, Fedora Your basebox must

Inviqa 3 Jun 30, 2020
Cookbook-magento - Collection of recipes to build app stack for the Magento deployments with Chef

Magento Cookbook Collection of recipes to build app stack for the Magento deployments with Chef Installation With Berkshelf echo "cookbook 'magento',

Yevhen Viktorov 37 Sep 26, 2020
Magento-bulk - Bulk Import/Export helper scripts and CLI utilities for Magento Commerce

Magento Bulk Bulk operations for Magento. Configuration Copy config.php.sample to config.php and edit it. Product Attribute Management List All Attrib

Bippo Indonesia 23 Dec 20, 2022
Phpcs-magento-rules - A set of PHPCS rules used by made.com when hacking Magento

Made.com PHPCS Magento Rules A set of PHPCS rules used by made.com when hacking Magento. Pre-Requisites PHPCS Installation Short Version Clone this re

Made.com Tech Team 26 Jun 3, 2020
This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

This Magento extension provides a Real Full Page Caching (FPC) for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

Hugues Alary 95 Feb 11, 2022
Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Strategery 123 Nov 20, 2021
Foundation 3 Framework for Magento 1.7. Foundation styles and libraries. Magento Responsive theme. Off-canvas Left-Right sidebar columns for mobile.

Magento Foundation 3 Framework Zurb Foundation 3 framework for Magento 1.7. Magento Foundation 3 Version 1.3.0. Demo page: http://magendation.internet

Nando Boronat 62 Apr 1, 2022
[ONLY Magento 2.0.x Compatible] Code samples for Magento developers

Synopsis This project is a collection of samples to demonstrate technologies introduced in Magento 2. You will find the most simple extension along wi

Magento 58 Dec 26, 2022
Magento 2 Blog Extension is a better blog extension for Magento 2 platform. These include all useful features of Wordpress CMS

Magento 2 Blog extension FREE Magento 2 Better Blog by Mageplaza is integrated right into the Magento backend so you can manage your blog and your e-c

Mageplaza 113 Dec 14, 2022