edmondscommerce/behat-magento-one-context

用于 Magento 1.x 的 Behat 扩展

dev-master 2019-03-28 15:41 UTC

This package is auto-updated.

Last update: 2024-09-09 00:54:38 UTC


README

Edmonds Commerce 提供

Behat 上下文,用于协助测试 Magento 1.x 网站

安装

通过 composer 安装

"edmondscommerce/behat-magento-one-context": "~1.1"

在 Behat 配置中包含上下文

default:
    # ...
    suites:
        default:
        # ...
            contexts:
                - # ...
                - EdmondsCommerce\BehatMagentoOneContext\CartContext
                - EdmondsCommerce\BehatMagentoOneContext\CustomerContext
                - EdmondsCommerce\BehatMagentoOneContext\NavigationContext
                - EdmondsCommerce\BehatMagentoOneContext\ProductContext
            parameters:
                magentoSettings:                         
                    pathToMage: '/path/to/app/Mage.php'
                    categoryUri: women/new-arrivals.html
                    simpleUri: accessories/eyewear/aviator-sunglasses.html
                    bundleUri: pillow-and-throw-set.html
                    configurableUri: lafayette-convertible-dress.html
                    groupedUri: vase-set.html

ProductContext 具有额外的参数,允许更轻松地导航到不同类型的产品。如果未指定,将默认到示例数据 URL,以简化使用示例数据的模块原型设计。

自定义上下文应扩展 RawMinkContext

AbstractMagentoContext::gatherContexts() 期望在 behat.yml 中指定 Behat\MinkExtension\Context\MinkContext

如果默认的 FeatureContext 或任何其他上下文也扩展了这个类,Behat 将会报错 "Step 'x' 已经在 Class::method() 中定义"。

因此,上下文应该扩展 Behat\MinkExtension\Context\RawMinkContext