categories_block.feature
3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Feature: categories_block
As an admin
I want to manage the categories block
Background:
Given I am on the homepage
And the following product_categories
| name | display_in_menu |
| Food | true |
| Book | true |
And the following product_categories
| parent | name | display_in_menu |
| Food | Vegetarian | true |
| Food | Steak | true |
| Book | Fiction | false |
| Book | Literature | true |
And the following categories
| name | display_in_menu |
| Wood | true |
And the following regions
| name | display_in_menu |
| Bahia | true |
And the following blocks
| owner | type |
| environment | CategoriesBlock |
And I am logged in as admin
And I go to /admin/environment_design
# Note that this @ignore-hidden-elements only works for seeing hidden
# elements. It actually doesn't work for following hidden link or pressing
# hidden buttons. That's why it's necessary to use this display hack to show
# the link.
@selenium @ignore-hidden-elements
Scenario: List just product categories
Given display ".button-bar"
And I follow "Edit" within ".categories-block"
And I check "Product"
When I press "Save"
Then I should see "Food"
And I should see "Book"
And "Vegetarian" should not be visible within "span#category-name"
And "Steak" should not be visible within "span#category-name"
And "Fiction" should not be visible within "span#category-name"
@selenium
Scenario: Show submenu if it exists
Given display ".button-bar"
And I follow "Edit" within ".categories-block"
And I check "Product"
And I press "Save"
Then I should see "Food"
And I should see "Book"
And "Vegetarian" should not be visible within "span#category-name"
And "Steak" should not be visible within "span#category-name"
And "Literature" should not be visible within "span#category-name"
When I follow "block_2_category_2"
Then I should see "Literature"
When I follow "block_2_category_1"
Then I should see "Vegetarian"
And I should see "Steak"
And I should not see "Fiction"
@selenium
Scenario: Show only one submenu per time
Given display ".button-bar"
And I follow "Edit" within ".categories-block"
And I check "Product"
And I press "Save"
Then I should see "Book"
And "Literature" should not be visible within "span#category-name"
When I follow "block_2_category_2"
Then I should see "Literature"
@selenium
Scenario: List just general categories
Given display ".button-bar"
And I follow "Edit" within ".categories-block"
And I check "Generic category"
When I press "Save"
Then I should see "Wood"
@selenium
Scenario: List just regions
Given display ".button-bar"
And I follow "Edit" within ".categories-block"
And I check "Region"
When I press "Save"
Then I should see "Bahia"