[Git][noosfero/noosfero][master] shopping_cart: wait for animations and requests to finish (fix test)

Bráulio Bhavamitra gitlab at mg.gitlab.com
Thu Feb 11 19:37:28 BRST 2016


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
5a1eee95 by Braulio Bhavamitra at 2016-02-11T18:36:53-03:00
shopping_cart: wait for animations and requests to finish (fix test)

- - - - -


4 changed files:

- features/step_definitions/web_steps.rb
- plugins/shopping_cart/features/delivery_admin.feature
- plugins/shopping_cart/features/delivery_client.feature
- plugins/shopping_cart/features/purchases.feature


Changes:

=====================================
features/step_definitions/web_steps.rb
=====================================
--- a/features/step_definitions/web_steps.rb
+++ b/features/step_definitions/web_steps.rb
@@ -315,3 +315,8 @@ When /^(?:|I )follow exact "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector|
     find("a", :text => /\A#{link}\z/).click
   end
 end
+
+When /^(?:|I )wait ([^ ]+) seconds?(?:| .+)$/ do |seconds|
+  sleep seconds.to_f
+end
+


=====================================
plugins/shopping_cart/features/delivery_admin.feature
=====================================
--- a/plugins/shopping_cart/features/delivery_admin.feature
+++ b/plugins/shopping_cart/features/delivery_admin.feature
@@ -62,7 +62,7 @@ Feature: delivery administration
     Then I should see "Bike"
     And I follow "Remove" within ".delivery-method"
     When I confirm the browser dialog
-    Then I should see "Bike"
+    Then I should not see "Bike"
 
   @selenium
   Scenario: edit delivery


=====================================
plugins/shopping_cart/features/delivery_client.feature
=====================================
--- a/plugins/shopping_cart/features/delivery_client.feature
+++ b/plugins/shopping_cart/features/delivery_client.feature
@@ -35,9 +35,10 @@ Feature: delivery client
     Given I follow "Add to basket"
     And I follow "Add to basket"
     And I should see "Show basket"
-    And I follow "Show basket"
+    And I follow "Show "
+    And I wait 1 second for animations
     And I follow "Shopping checkout"
-    And I fill in "order_consumer_data_contact_phone" with "123456789"
+    And I fill in "Contact phone" with "123456789"
     When I select "Bike ($8.00)" from "Option"
     Then I should see "My good old bike." within ".instructions"
     And I should see "Address"
@@ -50,8 +51,9 @@ Feature: delivery client
     And I follow "Add to basket"
     And I should see "Show basket"
     And I follow "Show basket"
+    And I wait 1 second for animations
     And I follow "Shopping checkout"
-    And I fill in "order_consumer_data_contact_phone" with "123456789"
+    And I fill in "Contact phone" with "123456789"
     When I select "Bar" from "Option"
     Then I should see "Come to my bar and drink it!" within ".instructions"
     And I should not see "Address"
@@ -68,8 +70,9 @@ Feature: delivery client
     And I follow "Add to basket"
     And I should see "Show basket"
     And I follow "Show basket"
+    And I wait 1 second for animations
     And I follow "Shopping checkout"
-    And I fill in "order_consumer_data_contact_phone" with "123456789"
+    And I fill in "Contact phone" with "123456789"
     When I select "Bike ($8.00)" from "Option"
     Then I should see "My good old bike." within ".instructions"
     And I should see "Address"


=====================================
plugins/shopping_cart/features/purchases.feature
=====================================
--- a/plugins/shopping_cart/features/purchases.feature
+++ b/plugins/shopping_cart/features/purchases.feature
@@ -121,11 +121,14 @@ Feature: purchases
       | pickup  | Bar  | Come to my bar and drink it!          | 0.00         | 0.00            |
     And I am on moes-tavern's products page
     And I follow "Add to basket"
+    And I wait 0.2 seconds to finish the request
     And I follow "Add to basket"
+    And I wait 0.2 seconds to finish the request
     And I follow "Add to basket"
     And I follow "Show basket"
+    And I wait 1 second for animations
     And I follow "Shopping checkout"
-    And I fill in "order_consumer_data_contact_phone" with "123456789"
+    And I fill in "Contact phone" with "123456789"
     And I select "Bike ($8.00)" from "Option"
     And I press "Send buy request"
     And I go to homer's control panel



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/5a1eee95f424aa559aaa98eca6bf99436cf4e997
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160211/683b5de3/attachment-0001.html>


More information about the Noosfero-dev mailing list