Commit 87b69cf20f39fb2be99b9e1369842f3a92aa9be7
Committed by
Daniela Feitosa
1 parent
ebeba0ae
Exists in
master
and in
29 other branches
categories_block.feature
Showing
2 changed files
with
20 additions
and
17 deletions
Show diff stats
features/categories_block.feature
@@ -25,7 +25,7 @@ Feature: categories_block | @@ -25,7 +25,7 @@ Feature: categories_block | ||
25 | | environment | CategoriesBlock | | 25 | | environment | CategoriesBlock | |
26 | And I am logged in as admin | 26 | And I am logged in as admin |
27 | 27 | ||
28 | - @selenium | 28 | + @selenium @ignore-hidden-elements |
29 | Scenario: List just product categories | 29 | Scenario: List just product categories |
30 | Given I go to /admin/environment_design | 30 | Given I go to /admin/environment_design |
31 | And I follow "Edit" within ".categories-block" | 31 | And I follow "Edit" within ".categories-block" |
@@ -33,11 +33,11 @@ Feature: categories_block | @@ -33,11 +33,11 @@ Feature: categories_block | ||
33 | When I press "Save" | 33 | When I press "Save" |
34 | Then I should see "Food" | 34 | Then I should see "Food" |
35 | And I should see "Book" | 35 | And I should see "Book" |
36 | - And I should not see "Vegetarian" | ||
37 | - And I should not see "Steak" | ||
38 | - And I should not see "Fiction" | 36 | + And "Vegetarian" should not be visible within "span#category-name" |
37 | + And "Steak" should not be visible within "span#category-name" | ||
38 | + And "Fiction" should not be visible within "span#category-name" | ||
39 | 39 | ||
40 | - @selenium | 40 | + @selenium @ignore-hidden-elements |
41 | Scenario: Show submenu if it exists | 41 | Scenario: Show submenu if it exists |
42 | Given I go to /admin/environment_design | 42 | Given I go to /admin/environment_design |
43 | And I follow "Edit" within ".categories-block" | 43 | And I follow "Edit" within ".categories-block" |
@@ -45,40 +45,39 @@ Feature: categories_block | @@ -45,40 +45,39 @@ Feature: categories_block | ||
45 | And I press "Save" | 45 | And I press "Save" |
46 | Then I should see "Food" | 46 | Then I should see "Food" |
47 | And I should see "Book" | 47 | And I should see "Book" |
48 | - And I should not see "Vegetarian" | ||
49 | - And I should not see "Steak" | ||
50 | - And I should not see "Literature" | ||
51 | - When I click ".category-link-expand category-root" | 48 | + And "Vegetarian" should not be visible within "span#category-name" |
49 | + And "Steak" should not be visible within "span#category-name" | ||
50 | + And "Literature" should not be visible within "span#category-name" | ||
51 | + When I follow "block_2_category_2" | ||
52 | Then I should see "Literature" | 52 | Then I should see "Literature" |
53 | - When I click ".category-link-expand category-root" | 53 | + When I follow "block_2_category_1" |
54 | Then I should see "Vegetarian" | 54 | Then I should see "Vegetarian" |
55 | And I should see "Steak" | 55 | And I should see "Steak" |
56 | And I should not see "Fiction" | 56 | And I should not see "Fiction" |
57 | 57 | ||
58 | - @selenium | 58 | + @selenium @ignore-hidden-elements |
59 | Scenario: Show only one submenu per time | 59 | Scenario: Show only one submenu per time |
60 | Given I go to /admin/environment_design | 60 | Given I go to /admin/environment_design |
61 | And I follow "Edit" within ".categories-block" | 61 | And I follow "Edit" within ".categories-block" |
62 | And I check "Product" | 62 | And I check "Product" |
63 | And I press "Save" | 63 | And I press "Save" |
64 | Then I should see "Book" | 64 | Then I should see "Book" |
65 | - And I should not see "Literature" | ||
66 | - When I click ".category-link-expand category-root" | 65 | + And "Literature" should not be visible within "span#category-name" |
66 | + When I follow "block_2_category_2" | ||
67 | Then I should see "Literature" | 67 | Then I should see "Literature" |
68 | 68 | ||
69 | - @selenium | 69 | + @selenium @ignore-hidden-elements |
70 | Scenario: List just general categories | 70 | Scenario: List just general categories |
71 | Given I go to /admin/environment_design | 71 | Given I go to /admin/environment_design |
72 | And I follow "Edit" within ".categories-block" | 72 | And I follow "Edit" within ".categories-block" |
73 | - And I check "Generic Category" | 73 | + And I check "Generic category" |
74 | When I press "Save" | 74 | When I press "Save" |
75 | Then I should see "Wood" | 75 | Then I should see "Wood" |
76 | 76 | ||
77 | - @selenium | 77 | + @selenium @ignore-hidden-elements |
78 | Scenario: List just regions | 78 | Scenario: List just regions |
79 | Given I go to /admin/environment_design | 79 | Given I go to /admin/environment_design |
80 | And I follow "Edit" within ".categories-block" | 80 | And I follow "Edit" within ".categories-block" |
81 | And I check "Region" | 81 | And I check "Region" |
82 | When I press "Save" | 82 | When I press "Save" |
83 | Then I should see "Bahia" | 83 | Then I should see "Bahia" |
84 | - |
features/support/selenium.rb
@@ -16,6 +16,10 @@ Before do | @@ -16,6 +16,10 @@ Before do | ||
16 | DatabaseCleaner.start | 16 | DatabaseCleaner.start |
17 | end | 17 | end |
18 | 18 | ||
19 | +Before('@ignore-hidden-elements') do | ||
20 | + Capybara.ignore_hidden_elements = true | ||
21 | +end | ||
22 | + | ||
19 | After do | 23 | After do |
20 | DatabaseCleaner.clean | 24 | DatabaseCleaner.clean |
21 | end | 25 | end |