From 333db2e9b933d44549a92a0ba718e453d73c678f Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 31 Oct 2013 14:22:02 +0800 Subject: [PATCH] MDL-42625 behat: Editing .feature files --- admin/tests/behat/upload_users.feature | 1 - .../behat/tests/behat/data_generators.feature | 2 -- .../ui/tests/behat/backup_courses.feature | 2 +- .../tests/behat/view_my_courses.feature | 3 --- blog/tests/behat/comment.feature | 7 ++---- .../behat/enable_manual_complete_mark.feature | 1 - .../behat/activities_group_icons.feature | 2 -- group/tests/behat/create_groups.feature | 2 -- mod/forum/tests/behat/add_forum.feature | 1 - .../tests/behat/edit_post_teacher.feature | 3 +-- .../tests/behat/track_read_posts.feature | 23 +++++++------------ 11 files changed, 12 insertions(+), 35 deletions(-) diff --git a/admin/tests/behat/upload_users.feature b/admin/tests/behat/upload_users.feature index 16aef6dc396..b276f44fd53 100644 --- a/admin/tests/behat/upload_users.feature +++ b/admin/tests/behat/upload_users.feature @@ -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" diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature index 063e1983ac5..8f21a72f8a7 100644 --- a/admin/tool/behat/tests/behat/data_generators.feature +++ b/admin/tool/behat/tests/behat/data_generators.feature @@ -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" diff --git a/backup/util/ui/tests/behat/backup_courses.feature b/backup/util/ui/tests/behat/backup_courses.feature index ddc406ed345..60b187117fa 100644 --- a/backup/util/ui/tests/behat/backup_courses.feature +++ b/backup/util/ui/tests/behat/backup_courses.feature @@ -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 diff --git a/blocks/navigation/tests/behat/view_my_courses.feature b/blocks/navigation/tests/behat/view_my_courses.feature index 6287bad3d15..d1670b40747 100644 --- a/blocks/navigation/tests/behat/view_my_courses.feature +++ b/blocks/navigation/tests/behat/view_my_courses.feature @@ -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" diff --git a/blog/tests/behat/comment.feature b/blog/tests/behat/comment.feature index 1527a3ca256..f02bc19228c 100644 --- a/blog/tests/behat/comment.feature +++ b/blog/tests/behat/comment.feature @@ -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 " 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\"!" diff --git a/completion/tests/behat/enable_manual_complete_mark.feature b/completion/tests/behat/enable_manual_complete_mark.feature index a14b9b9a1ce..98d29827e5c 100644 --- a/completion/tests/behat/enable_manual_complete_mark.feature +++ b/completion/tests/behat/enable_manual_complete_mark.feature @@ -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" diff --git a/course/tests/behat/activities_group_icons.feature b/course/tests/behat/activities_group_icons.feature index 055cb1a0cf9..2fde9985cd6 100644 --- a/course/tests/behat/activities_group_icons.feature +++ b/course/tests/behat/activities_group_icons.feature @@ -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 diff --git a/group/tests/behat/create_groups.feature b/group/tests/behat/create_groups.feature index c6e3f84e3e3..7ec76223217 100644 --- a/group/tests/behat/create_groups.feature +++ b/group/tests/behat/create_groups.feature @@ -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" diff --git a/mod/forum/tests/behat/add_forum.feature b/mod/forum/tests/behat/add_forum.feature index 90edd7473d2..135a3e53ce6 100644 --- a/mod/forum/tests/behat/add_forum.feature +++ b/mod/forum/tests/behat/add_forum.feature @@ -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" diff --git a/mod/forum/tests/behat/edit_post_teacher.feature b/mod/forum/tests/behat/edit_post_teacher.feature index 5dafb8fb5aa..c9e1d57d897 100644 --- a/mod/forum/tests/behat/edit_post_teacher.feature +++ b/mod/forum/tests/behat/edit_post_teacher.feature @@ -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" diff --git a/mod/forum/tests/behat/track_read_posts.feature b/mod/forum/tests/behat/track_read_posts.feature index d08ce1d7567..da92f8605e3 100644 --- a/mod/forum/tests/behat/track_read_posts.feature +++ b/mod/forum/tests/behat/track_read_posts.feature @@ -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 -- 2.43.0