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 51 And I follow "Price composition"
52 52 And I follow "Describe here the cost of production"
53 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 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 57 And I press "Save"
58 58 Then I should not see "Save"
59 59 And I should see "Describe here the cost of production"
... ... @@ -67,15 +67,15 @@ Feature: manage product price details
67 67 And I follow "Price composition"
68 68 And I follow "Describe here the cost of production"
69 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 71 And I fill in "$" with "20.00"
72 72 And I leave the ".price-details-price" field
73 73 And I press "Save"
74 74 Then I should not see "Save"
75 75 And I should see "Taxes" within "#display-price-details"
76 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 79 And I press "Save"
80 80 And I should not see "Taxes" within "#display-price-details"
81 81 And I should see "Energy" within "#display-price-details"
... ... @@ -102,7 +102,7 @@ Feature: manage product price details
102 102 And I follow "Price composition"
103 103 And I follow "Describe here the cost of production"
104 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 106 And I fill in "$" with "20.00"
107 107 And I press "Save"
108 108 Then I should see "Inputs" within ".price-detail-name"
... ... @@ -114,10 +114,10 @@ Feature: manage product price details
114 114 And I follow "Price composition"
115 115 And I follow "Describe here the cost of production"
116 116 And I follow "New cost"
  117 + And I select "Other cost" from "price_details__production_cost_id" within "#display-product-price-details"
117 118 And I want to add "Energy" as cost
118   - And I select "Other cost"
119 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 121 And I press "Save"
122 122 When I follow "Describe here the cost of production"
123 123 Then I should see "Energy" within ".production-cost-selection"
... ... @@ -127,8 +127,9 @@ Feature: manage product price details
127 127 Given I go to Rede Moinho's page of product Abbey Road
128 128 And I follow "Price composition"
129 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 132 And I want to add "Energy" as cost
131   - And I select "Other cost"
132 133 Then I should see "Energy" within "#new-cost-fields"
133 134  
134 135 @selenium
... ... @@ -160,7 +161,7 @@ Feature: manage product price details
160 161 Then I should see "$ 60.00 of $ 80.00" within "#progressbar-text"
161 162 And I follow "New cost"
162 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 165 Then I should see "$ 70.00 of $ 80.00" within "#progressbar-text"
165 166  
166 167 @selenium
... ...
features/step_definitions/custom_web_steps.rb
... ... @@ -36,3 +36,11 @@ When /^I reload and wait for the page$/ do
36 36 raise "Why why need this? Remove!"
37 37 visit page.driver.browser.current_url
38 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 602 end
603 603  
604 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 608 end
607 609  
608 610 Given /^([^\s]+) (enabled|disabled) translation redirection in (?:his|her) profile$/ do
... ...