Commit 4c2ccd01d4b04a77b5112ad5376a306d62fec996

Authored by Daniela Feitosa
1 parent 37105a38

Fixed test: features/manage_product_price_details.feature

features/manage_product_price_details.feature
@@ -51,9 +51,9 @@ Feature: manage product price details @@ -51,9 +51,9 @@ Feature: manage product price details
51 And I follow "Price composition" 51 And I follow "Price composition"
52 And I follow "Describe here the cost of production" 52 And I follow "Describe here the cost of production"
53 And I follow "New cost" 53 And I follow "New cost"
54 - And I select "Taxes" 54 + And I select "Taxes" from "price_details__production_cost_id" within "#display-product-price-details"
55 And I fill in "$" with "5.00" 55 And I fill in "$" with "5.00"
56 - And I leave the ".price-details-price" field 56 + And I leave the "#price_details__price" field
57 And I press "Save" 57 And I press "Save"
58 Then I should not see "Save" 58 Then I should not see "Save"
59 And I should see "Describe here the cost of production" 59 And I should see "Describe here the cost of production"
@@ -67,15 +67,15 @@ Feature: manage product price details @@ -67,15 +67,15 @@ Feature: manage product price details
67 And I follow "Price composition" 67 And I follow "Price composition"
68 And I follow "Describe here the cost of production" 68 And I follow "Describe here the cost of production"
69 And I follow "New cost" 69 And I follow "New cost"
70 - And I select "Taxes" 70 + And I select "Taxes" from "price_details__production_cost_id" within "#display-product-price-details"
71 And I fill in "$" with "20.00" 71 And I fill in "$" with "20.00"
72 And I leave the ".price-details-price" field 72 And I leave the ".price-details-price" field
73 And I press "Save" 73 And I press "Save"
74 Then I should not see "Save" 74 Then I should not see "Save"
75 And I should see "Taxes" within "#display-price-details" 75 And I should see "Taxes" within "#display-price-details"
76 When I follow "Describe here the cost of production" 76 When I follow "Describe here the cost of production"
77 - And I select "Energy"  
78 - And I leave the ".price-details-price" field 77 + And I select "Energy" from "price_details__production_cost_id" within "#display-product-price-details"
  78 + And I leave the "#price_details__price" field
79 And I press "Save" 79 And I press "Save"
80 And I should not see "Taxes" within "#display-price-details" 80 And I should not see "Taxes" within "#display-price-details"
81 And I should see "Energy" within "#display-price-details" 81 And I should see "Energy" within "#display-price-details"
@@ -102,7 +102,7 @@ Feature: manage product price details @@ -102,7 +102,7 @@ Feature: manage product price details
102 And I follow "Price composition" 102 And I follow "Price composition"
103 And I follow "Describe here the cost of production" 103 And I follow "Describe here the cost of production"
104 And I follow "New cost" 104 And I follow "New cost"
105 - And I select "Taxes" 105 + And I select "Taxes" from "price_details__production_cost_id" within "#display-product-price-details"
106 And I fill in "$" with "20.00" 106 And I fill in "$" with "20.00"
107 And I press "Save" 107 And I press "Save"
108 Then I should see "Inputs" within ".price-detail-name" 108 Then I should see "Inputs" within ".price-detail-name"
@@ -114,10 +114,10 @@ Feature: manage product price details @@ -114,10 +114,10 @@ Feature: manage product price details
114 And I follow "Price composition" 114 And I follow "Price composition"
115 And I follow "Describe here the cost of production" 115 And I follow "Describe here the cost of production"
116 And I follow "New cost" 116 And I follow "New cost"
  117 + And I select "Other cost" from "price_details__production_cost_id" within "#display-product-price-details"
117 And I want to add "Energy" as cost 118 And I want to add "Energy" as cost
118 - And I select "Other cost"  
119 And I fill in "$" with "10.00" 119 And I fill in "$" with "10.00"
120 - And I leave the ".price-details-price" field 120 + And I leave the "#price_details__price" field
121 And I press "Save" 121 And I press "Save"
122 When I follow "Describe here the cost of production" 122 When I follow "Describe here the cost of production"
123 Then I should see "Energy" within ".production-cost-selection" 123 Then I should see "Energy" within ".production-cost-selection"
@@ -127,8 +127,9 @@ Feature: manage product price details @@ -127,8 +127,9 @@ Feature: manage product price details
127 Given I go to Rede Moinho's page of product Abbey Road 127 Given I go to Rede Moinho's page of product Abbey Road
128 And I follow "Price composition" 128 And I follow "Price composition"
129 And I follow "Describe here the cost of production" 129 And I follow "Describe here the cost of production"
  130 + And I follow "New cost"
  131 + And I select "Other cost" from "price_details__production_cost_id" within "#display-product-price-details"
130 And I want to add "Energy" as cost 132 And I want to add "Energy" as cost
131 - And I select "Other cost"  
132 Then I should see "Energy" within "#new-cost-fields" 133 Then I should see "Energy" within "#new-cost-fields"
133 134
134 @selenium 135 @selenium
@@ -160,7 +161,7 @@ Feature: manage product price details @@ -160,7 +161,7 @@ Feature: manage product price details
160 Then I should see "$ 60.00 of $ 80.00" within "#progressbar-text" 161 Then I should see "$ 60.00 of $ 80.00" within "#progressbar-text"
161 And I follow "New cost" 162 And I follow "New cost"
162 And I fill in "$" with "10.00" 163 And I fill in "$" with "10.00"
163 - And I leave the ".price-details-price" field 164 + And I leave the "#price_details__price" field
164 Then I should see "$ 70.00 of $ 80.00" within "#progressbar-text" 165 Then I should see "$ 70.00 of $ 80.00" within "#progressbar-text"
165 166
166 @selenium 167 @selenium
features/step_definitions/custom_web_steps.rb
@@ -36,3 +36,11 @@ When /^I reload and wait for the page$/ do @@ -36,3 +36,11 @@ When /^I reload and wait for the page$/ do
36 raise "Why why need this? Remove!" 36 raise "Why why need this? Remove!"
37 visit page.driver.browser.current_url 37 visit page.driver.browser.current_url
38 end 38 end
  39 +
  40 +When /^I leave the "([^\"]+)" field$/ do |selector|
  41 + page.execute_script "jQuery('#{selector}').trigger('blur')"
  42 +end
  43 +
  44 +When /^I confirm$/ do
  45 + page.driver.browser.switch_to.alert.accept
  46 +end
features/step_definitions/noosfero_steps.rb
@@ -602,7 +602,9 @@ Given /^the following enterprise homepages?$/ do |table| @@ -602,7 +602,9 @@ Given /^the following enterprise homepages?$/ do |table|
602 end 602 end
603 603
604 And /^I want to add "([^\"]*)" as cost$/ do |string| 604 And /^I want to add "([^\"]*)" as cost$/ do |string|
605 - selenium.answer_on_next_prompt(string) 605 + prompt = page.driver.browser.switch_to.alert
  606 + prompt.send_keys(string)
  607 + prompt.accept
606 end 608 end
607 609
608 Given /^([^\s]+) (enabled|disabled) translation redirection in (?:his|her) profile$/ do 610 Given /^([^\s]+) (enabled|disabled) translation redirection in (?:his|her) profile$/ do