Skip to content

Instantly share code, notes, and snippets.

@wayne-o
Created October 15, 2012 10:46
Show Gist options
  • Save wayne-o/3891913 to your computer and use it in GitHub Desktop.
Save wayne-o/3891913 to your computer and use it in GitHub Desktop.
Manage Product Categories
Feature: Manage Product Categories
In order to group products by categories
As an admin of the site
I want to be able to manage categories in the system
Background:
Given I am an admin user and I have logged in
And I have navigated to the manage categories screen
@UI
Scenario: adding an enabled category
Given I click the "Add category" button
And I enter "category1" into the "CategoryName" textbox
And I ensure the "Enabled" checkbox is "true"
When I click the "save" button
Then I should see "category1" show up in the list of existing categories
And it should be enabled
And the number of products associated should be 0
@UI
Scenario: adding an disabled category
Given I click the "Add category" button
And I enter "category1" into the "CategoryName" textbox
And I ensure the "Enabled" checkbox is "false"
When I click the "save" button
Then I should see "category1" show up in the list of existing categories
And it should be disabled
And the number of products associated should be 0
@UI
Scenario: adding a category which already exists
Given I click the "Add category" button
And there is already a category named "category1"
When I enter "category1" into the "CategoryName" textbox
And I click the "save" button
Then I should see an error message saying the category already exists
And the category should not have been added to the list of existing categories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment