Commit 87b69cf20f39fb2be99b9e1369842f3a92aa9be7

Authored by Daniel Cunha
Committed by Daniela Feitosa
1 parent ebeba0ae

categories_block.feature

features/categories_block.feature
... ... @@ -25,7 +25,7 @@ Feature: categories_block
25 25 | environment | CategoriesBlock |
26 26 And I am logged in as admin
27 27  
28   - @selenium
  28 + @selenium @ignore-hidden-elements
29 29 Scenario: List just product categories
30 30 Given I go to /admin/environment_design
31 31 And I follow "Edit" within ".categories-block"
... ... @@ -33,11 +33,11 @@ Feature: categories_block
33 33 When I press "Save"
34 34 Then I should see "Food"
35 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 41 Scenario: Show submenu if it exists
42 42 Given I go to /admin/environment_design
43 43 And I follow "Edit" within ".categories-block"
... ... @@ -45,40 +45,39 @@ Feature: categories_block
45 45 And I press "Save"
46 46 Then I should see "Food"
47 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 52 Then I should see "Literature"
53   - When I click ".category-link-expand category-root"
  53 + When I follow "block_2_category_1"
54 54 Then I should see "Vegetarian"
55 55 And I should see "Steak"
56 56 And I should not see "Fiction"
57 57  
58   - @selenium
  58 + @selenium @ignore-hidden-elements
59 59 Scenario: Show only one submenu per time
60 60 Given I go to /admin/environment_design
61 61 And I follow "Edit" within ".categories-block"
62 62 And I check "Product"
63 63 And I press "Save"
64 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 67 Then I should see "Literature"
68 68  
69   - @selenium
  69 + @selenium @ignore-hidden-elements
70 70 Scenario: List just general categories
71 71 Given I go to /admin/environment_design
72 72 And I follow "Edit" within ".categories-block"
73   - And I check "Generic Category"
  73 + And I check "Generic category"
74 74 When I press "Save"
75 75 Then I should see "Wood"
76 76  
77   - @selenium
  77 + @selenium @ignore-hidden-elements
78 78 Scenario: List just regions
79 79 Given I go to /admin/environment_design
80 80 And I follow "Edit" within ".categories-block"
81 81 And I check "Region"
82 82 When I press "Save"
83 83 Then I should see "Bahia"
84   -
... ...
features/support/selenium.rb
... ... @@ -16,6 +16,10 @@ Before do
16 16 DatabaseCleaner.start
17 17 end
18 18  
  19 +Before('@ignore-hidden-elements') do
  20 + Capybara.ignore_hidden_elements = true
  21 +end
  22 +
19 23 After do
20 24 DatabaseCleaner.clean
21 25 end
... ...