Adding scenario for browsing product attributes

This commit is contained in:
tuka217 2016-04-22 14:51:28 +02:00
parent 65459839d4
commit 5cb96b9f6c
3 changed files with 39 additions and 0 deletions

View file

@ -13,6 +13,7 @@ default:
- sylius.behat.context.transform.locale
- sylius.behat.context.transform.shared_storage
- sylius.behat.context.transform.lexical
- sylius.behat.context.ui.admin.managing_product_attributes
filters:

View file

@ -0,0 +1,17 @@
@managing_product_attributes
Feature: Browsing product attributes
In order to see all product attributes available in the store
As an Administrator
I want to browse product attributes
Background:
Given the store has a text product attribute "T-shirt brand" with code "t_shirt_brand"
And the store has a checkbox product attribute "T-shirt with cotton" with code "t_shirt_with_cotton"
And the store has a integer product attribute "Book pages" with code "book_pages"
And I am logged in as an administrator
@ui
Scenario: Browsing all product attributes in store
When I want to see all product attributes in store
Then I should see 3 product attributes in the list
And I should see the product attribute "T-shirt brand" in the list

View file

@ -108,6 +108,7 @@ final class ManagingProductAttributesContext implements Context
/**
* @Then the attribute :name should appear in the store
* @Then I should see the product attribute :name in the list
*/
public function theAttributeShouldAppearInTheStore($name)
{
@ -235,4 +236,24 @@ final class ManagingProductAttributesContext implements Context
sprintf('Product attribute %s should be required.', $element)
);
}
/**
* @When I want to see all product attributes in store
*/
public function iWantToSeeAllProductAttributesInStore()
{
$this->indexPage->open();
}
/**
* @Then /^I should see (\d+) product attributes in the list$/
*/
public function iShouldSeeCustomersInTheList($amountOfProductAttributes)
{
Assert::same(
$amountOfProductAttributes,
$this->indexPage->countItems(),
sprintf('Amount of product attributes should be equal %s, but is not.', $amountOfProductAttributes)
);
}
}