MDL-42625 behat: Editing .feature files
authorDavid Monllao <davidm@moodle.com>
Thu, 31 Oct 2013 06:22:02 +0000 (14:22 +0800)
committerDavid Monllao <davidm@moodle.com>
Fri, 6 Dec 2013 04:13:39 +0000 (12:13 +0800)
admin/tests/behat/upload_users.feature
admin/tool/behat/tests/behat/data_generators.feature
backup/util/ui/tests/behat/backup_courses.feature
blocks/navigation/tests/behat/view_my_courses.feature
blog/tests/behat/comment.feature
completion/tests/behat/enable_manual_complete_mark.feature
course/tests/behat/activities_group_icons.feature
group/tests/behat/create_groups.feature
mod/forum/tests/behat/add_forum.feature
mod/forum/tests/behat/edit_post_teacher.feature
mod/forum/tests/behat/track_read_posts.feature

index 16aef6d..b276f44 100644 (file)
@@ -42,5 +42,4 @@ Feature: Upload users
     And I expand "Users" node
     And I follow "Groups"
     And I select "Section 1 (1)" from "groups"
-    And I wait "4" seconds
     And the "members" select box should contain "Tom Jones"
index 063e198..8f21a72 100644 (file)
@@ -230,8 +230,6 @@ Feature: Set up contextual data for tests
     Then the "groups" select box should contain "Group 1 (1)"
     And the "groups" select box should contain "Group 2 (1)"
     And I select "Group 1 (1)" from "groups"
-    And I wait "5" seconds
     And the "members" select box should contain "Student 1"
     And I select "Group 2 (1)" from "groups"
-    And I wait "5" seconds
     And the "members" select box should contain "Student 2"
index ddc406e..60b1871 100644 (file)
@@ -38,7 +38,7 @@ Feature: Backup Moodle courses
     And I press "Continue"
     And I click on "Continue" "button" in the ".bcs-current-course" "css_element"
     And "//div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')][contains(., 'Include calendar events')]/descendant::img" "xpath_element" should exists
-    And I check "Include course logs"
+    And "Include course logs" "checkbox" should exists
     And I press "Next"
 
   @javascript
index 6287bad..d1670b4 100644 (file)
@@ -58,14 +58,11 @@ Feature: View my courses in navigation block
     And I should see "cat3" in the "Navigation" "block"
     And I should not see "cat2" in the "Navigation" "block"
     And I expand "cat3" node
-    And I wait "2" seconds
     And I should see "cat31" in the "Navigation" "block"
     And I should see "cat33" in the "Navigation" "block"
     And I should not see "cat32" in the "Navigation" "block"
     And I expand "cat31" node
-    And I wait "2" seconds
     And I should see "c31" in the "Navigation" "block"
     And I expand "cat33" node
-    And I wait "2" seconds
     And I should see "c331" in the "Navigation" "block"
     And I should not see "c332" in the "Navigation" "block"
index 1527a3c..f02bc19 100644 (file)
@@ -33,11 +33,9 @@ Feature: Comment on a blog entry
     And I follow "Comments (0)"
     When I fill in "content" with "$My own >nasty< \"string\"!"
     And I follow "Save comment"
-    And I wait "4" seconds
     Then I should see "$My own >nasty< \"string\"!"
     And I fill in "content" with "Another $Nasty <string?>"
     And I follow "Save comment"
-    And I wait "4" seconds
     And I should see "Comments (2)" in the ".comment-link" "css_element"
 
   @javascript
@@ -53,9 +51,9 @@ Feature: Comment on a blog entry
     And I follow "Comments (0)"
     And I fill in "content" with "$My own >nasty< \"string\"!"
     And I follow "Save comment"
-    And I wait "4" seconds
     When I click on ".comment-delete a" "css_element"
-    And I wait "4" seconds
+    # Waiting for the animation to finish.
+    And I wait "2" seconds
     Then I should not see "$My own >nasty< \"string\"!"
     And I follow "Blog post from user 1"
     And I click on ".comment-link" "css_element"
@@ -73,5 +71,4 @@ Feature: Comment on a blog entry
     When I follow "Comments (0)"
     And I fill in "content" with "$My own >nasty< \"string\"!"
     And I follow "Save comment"
-    And I wait "4" seconds
     Then I should see "$My own >nasty< \"string\"!"
index a14b9b9..98d2982 100644 (file)
@@ -37,7 +37,6 @@ Feature: Allow students to manually mark an activity as complete
     And I log in as "student1"
     And I follow "Course 1"
     And I press "Mark as complete: Test forum name"
-    And I wait "3" seconds
     And I log out
     And I log in as "teacher1"
     And I follow "Course 1"
index 055cb1a..2fde998 100644 (file)
@@ -29,14 +29,12 @@ Feature: Toggle activities groups mode from the course page
     Then "No groups (Click to change)" "link" should exists
     And "//a/child::img[contains(@src, 'groupn')]" "xpath_element" should exists
     And I click on "No groups (Click to change)" "link" in the "Test forum name" activity
-    And I wait "3" seconds
     And "Separate groups (Click to change)" "link" should exists
     And "//a/child::img[contains(@src, 'groups')]" "xpath_element" should exists
     And I reload the page
     And "Separate groups (Click to change)" "link" should exists
     And "//a/child::img[contains(@src, 'groups')]" "xpath_element" should exists
     And I click on "Separate groups (Click to change)" "link" in the "Test forum name" activity
-    And I wait "3" seconds
     And "Visible groups (Click to change)" "link" should exists
     And "//a/child::img[contains(@src, 'groupv')]" "xpath_element" should exists
     And I reload the page
index c6e3f84..7ec7622 100644 (file)
@@ -40,12 +40,10 @@ Feature: Organize students into groups
     And I add "student2" user to "Group 2" group
     And I add "student3" user to "Group 2" group
     Then I select "Group 1 (2)" from "groups"
-    And I wait "5" seconds
     And the "members" select box should contain "Student 0"
     And the "members" select box should contain "Student 1"
     And the "members" select box should not contain "Student 2"
     And I select "Group 2 (2)" from "groups"
-    And I wait "5" seconds
     And the "members" select box should contain "Student 2"
     And the "members" select box should contain "Student 3"
     And the "members" select box should not contain "Student 0"
index 90edd74..135a3e5 100644 (file)
@@ -25,5 +25,4 @@ Feature: Add forum activities and discussions
     When I add a new discussion to "Test forum name" forum with:
       | Subject | Forum post 1 |
       | Message | This is the body |
-    And I wait "6" seconds
     Then I should see "Test forum name"
index 5dafb8f..c9e1d57 100644 (file)
@@ -41,7 +41,6 @@ Feature: Teachers can edit or delete any forum post
     And I follow "Teacher post subject"
     And I click on "Delete" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element"
     And I press "Continue"
-    And I wait "4" seconds
     Then I should not see "Student post subject"
     And I should not see "Student post message"
 
@@ -56,7 +55,7 @@ Feature: Teachers can edit or delete any forum post
     And I fill the moodle form with:
       | Subject | Edited student subject |
     And I press "Save changes"
-    And I wait "4" seconds
+    And I wait to be redirected
     Then I should see "Edited student subject"
     And I should see "Edited by Teacher 1 - original submission"
 
index d08ce1d..da92f86 100644 (file)
@@ -30,7 +30,6 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     And I add a new discussion to "Test forum name" forum with:
       | Subject | Test post subject |
       | Message | Test post message |
-    And I wait "6" seconds
     And I log out
     When I log in as "student1"
     And I follow "Course 1"
@@ -48,19 +47,18 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     And I add a new discussion to "Test forum name" forum with:
       | Subject | Test post subject |
       | Message | Test post message |
-    And I wait "6" seconds
     And I log out
     When I log in as "student1"
     And I follow "Course 1"
     Then I should see "1 unread post"
     And I follow "Test forum name"
     And I follow "Don't track unread posts"
-    And I wait "4" seconds
+    And I wait to be redirected
     And I follow "Course 1"
     And I should not see "1 unread post"
     And I follow "Test forum name"
     And I follow "Track unread posts"
-    And I wait "4" seconds
+    And I wait to be redirected
     And I follow "1"
     And I follow "Course 1"
     And I should not see "1 unread post"
@@ -75,7 +73,6 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     And I add a new discussion to "Test forum name" forum with:
       | Subject | Test post subject |
       | Message | Test post message |
-    And I wait "6" seconds
     And I log out
     When I log in as "student2"
     And I follow "Course 1"
@@ -85,7 +82,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
 
   @javascript
   Scenario: Tracking forum posts forced with user tracking on
-    And I set the following administration settings values:
+    Given I set the following administration settings values:
       | Allow forced read tracking | 1 |
     And I follow "Home"
     And I follow "Course 1"
@@ -97,7 +94,6 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     And I add a new discussion to "Test forum name" forum with:
       | Subject | Test post subject |
       | Message | Test post message |
-    And I wait "6" seconds
     And I log out
     When I log in as "student1"
     And I follow "Course 1"
@@ -110,7 +106,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
 
   @javascript
   Scenario: Tracking forum posts forced with user tracking off
-    And I set the following administration settings values:
+    Given I set the following administration settings values:
       | Allow forced read tracking | 1 |
     And I follow "Home"
     And I follow "Course 1"
@@ -122,7 +118,6 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     And I add a new discussion to "Test forum name" forum with:
       | Subject | Test post subject |
       | Message | Test post message |
-    And I wait "6" seconds
     And I log out
     When I log in as "student2"
     And I follow "Course 1"
@@ -135,7 +130,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
 
   @javascript
   Scenario: Tracking forum posts forced (with force disabled) with user tracking on
-    And I set the following administration settings values:
+    Given I set the following administration settings values:
       | Allow forced read tracking | 1 |
     And I follow "Home"
     And I follow "Course 1"
@@ -147,7 +142,6 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     And I add a new discussion to "Test forum name" forum with:
       | Subject | Test post subject |
       | Message | Test post message |
-    And I wait "6" seconds
     And I set the following administration settings values:
       | Allow forced read tracking | 0 |
     And I log out
@@ -156,19 +150,19 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     Then I should see "1 unread post"
     And I follow "Test forum name"
     And I follow "Don't track unread posts"
-    And I wait "4" seconds
+    And I wait to be redirected
     And I follow "Course 1"
     And I should not see "1 unread post"
     And I follow "Test forum name"
     And I follow "Track unread posts"
-    And I wait "4" seconds
+    And I wait to be redirected
     And I follow "1"
     And I follow "Course 1"
     And I should not see "1 unread post"
 
   @javascript
   Scenario: Tracking forum posts forced (with force disabled) with user tracking off
-    And I set the following administration settings values:
+    Given I set the following administration settings values:
       | Allow forced read tracking | 1 |
     And I follow "Home"
     And I follow "Course 1"
@@ -180,7 +174,6 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
     And I add a new discussion to "Test forum name" forum with:
       | Subject | Test post subject |
       | Message | Test post message |
-    And I wait "6" seconds
     And I set the following administration settings values:
       | Allow forced read tracking | 0 |
     And I log out