Unverified Commit dc90838a authored by Rajesh Taneja's avatar Rajesh Taneja
Browse files

MDL-56630 behat: Click on link in specificed block/region

parent 1fd6b255
......@@ -60,9 +60,9 @@ Feature: Verify that all form fields values can be get and set
| HTML format | Student page contents |
And I press "Save"
Then I should see "Student page contents" in the "region-main" "region"
And I follow "Edit"
And I click on "Edit" "link" in the "Administration" "block"
# Select (multi-select) - Checking "I set the field".
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
# Checkbox - Checking "I set the field".
And I set the field "Display description on course page" to "1"
......@@ -75,7 +75,7 @@ Feature: Verify that all form fields values can be get and set
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
# Checkbox - Checking "the field matches value" and "the following fields match these values".
And the following fields match these values:
| Display description on course page | 1 |
......@@ -91,7 +91,7 @@ Feature: Verify that all form fields values can be get and set
# Select (simple) - Checking "I set the field".
And I set the field "Group mode" to "Separate groups"
And I press "Save and display"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And the following fields match these values:
| Default format | NWiki |
| Group mode | Separate groups |
......@@ -158,7 +158,7 @@ Feature: Verify that all form fields values can be get and set
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
And I press "Save and display"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And the field "available[enabled]" matches value "1"
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
......
......@@ -115,7 +115,7 @@ Feature: availability_grade
# Give the assignment 40%.
And I follow "A1"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
# Pick the grade link in the row that has s@example.com in it.
And I click on "Grade" "link" in the "s@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
......
......@@ -56,7 +56,7 @@ Feature: Restrict activity availability through grade conditions
And I am on site homepage
And I follow "Course 1"
And I follow "Grade assignment"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
| Grade | 21 |
......
......@@ -93,7 +93,7 @@ Feature: Restrict sections availability through completion or grade conditions
And I am on site homepage
And I follow "Course 1"
And I follow "Grade assignment"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
| Grade | 21 |
......
......@@ -35,24 +35,24 @@ Feature: Edit completion settings of an activity
@javascript
Scenario: Pressing the unlock button allows the user to edit completion settings
Given I follow "TestPage"
When I follow "Edit settings"
When I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I press "Unlock completion options"
Then I should see "Completion options unlocked"
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
And I press "Save and display"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
Then the field "Completion tracking" matches value "Students can manually mark the activity as completed"
@javascript
Scenario: Even when completion is locked, the user can still set the date
Given I follow "TestPage"
And I follow "Edit settings"
When I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
When I click on "id_completionexpected_enabled" "checkbox"
And I set the field "id_completionexpected_year" to "2013"
And I press "Save and display"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
Then the field "id_completionexpected_year" matches value "2013"
......@@ -87,7 +87,7 @@ Feature: Marking guides can be created and edited
And I press "Ok"
And I follow "Edit settings"
And I follow "Test assignment 1 name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
# Checking that the user grade is correct.
Then I should see "80" in the "Student 1" "table_row"
And I log out
......
......@@ -49,7 +49,13 @@ class behat_grading extends behat_base {
$this->execute('behat_general::click_link', $this->escape($activityname));
$this->execute('behat_general::click_link', get_string('gradingmanagement', 'grading'));
$this->execute('behat_general::i_click_on_in_the',
array(
get_string('gradingmanagement', 'grading'),
'link',
'Administration',
'block'
));
}
/**
......@@ -86,7 +92,13 @@ class behat_grading extends behat_base {
$this->execute('behat_general::click_link', $this->escape($activityname));
$this->execute('behat_general::click_link', $this->escape(get_string('viewgrading', 'assign')));
$this->execute('behat_general::i_click_on_in_the',
array(
get_string('viewgrading', 'mod_assign'),
'link',
'Administration',
'block'
));
$this->execute('behat_general::i_click_on_in_the',
array(
......@@ -157,7 +169,13 @@ class behat_grading extends behat_base {
$this->execute('behat_forms::press_button', 'Ok');
$this->execute('behat_general::i_click_on', array($this->escape(get_string('editsettings')), 'link'));
$this->execute('behat_forms::press_button', get_string('cancel'));
$this->execute('behat_general::i_click_on', array($this->escape(get_string('viewgrading', 'mod_assign')), 'link'));
$this->execute('behat_general::i_click_on_in_the',
array(
get_string('viewgrading', 'mod_assign'),
'link',
'Administration',
'block'
));
}
/**
......
......@@ -33,7 +33,7 @@ Feature: We can bulk insert grades for students in a course
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment one"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
| Grade out of 100 | 50 |
......@@ -74,7 +74,7 @@ Feature: We can bulk insert grades for students in a course
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment two"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
| Grade out of 100 | 50 |
......
......@@ -25,7 +25,7 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Validate that switching the type of grading used correctly disables input form elements
When I follow "Test Assignment 1"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
Then the "Scale" "select" should be disabled
......@@ -41,12 +41,12 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Create an activity with a maximum grade point value less than the system maximum
When I follow "Test Assignment 1"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
And I press "Save and display"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
Then the field "grade[modgrade_point]" matches value "600"
And the "Scale" "select" should be disabled
And I press "Save and return to course"
......@@ -54,12 +54,12 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Create an activity with a scale as the grade type
When I follow "Test Assignment 1"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Separate and Connected ways of knowing"
And I press "Save and display"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
Then the field "grade[modgrade_scale]" matches value "Separate and Connected ways of knowing"
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
......@@ -67,18 +67,18 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Create an activity with no grade as the grade type
When I follow "Test Assignment 1"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "None"
And I press "Save and display"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
Scenario: Create an activity with a maximum grade point value higher than the system maximum
When I follow "Test Assignment 1"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
And I set the field "grade[modgrade_point]" to "20000"
......@@ -88,7 +88,7 @@ Feature: We can change the grading type and maximum grade point values
Scenario: Create an activity with a valid maximum grade point and then change the system maximum to be lower
When I follow "Test Assignment 1"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
......@@ -100,7 +100,7 @@ Feature: We can change the grading type and maximum grade point values
And I am on site homepage
And I follow "Course 1"
And I follow "Test Assignment 1"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I press "Save and display"
Then I should see "Invalid grade value. This must be an integer between 1 and 100"
And I press "Cancel"
......@@ -44,12 +44,12 @@ Feature: View gradebook when scales are used
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment one"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Letterscale"
And I press "Save and display"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save changes"
......
......@@ -38,12 +38,12 @@ Feature: View gradebook when single item scales are used
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment one"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Singleitem"
And I press "Save and display"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save changes"
......
......@@ -111,7 +111,7 @@ Feature: Using the activity grade form element
# Try saving the form and visiting it back to verify that everything is working ok.
And I press "Save and display"
And I should not see "When selecting a ratings aggregate type you must also select"
And I click on "Edit settings" "link"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And the field "Aggregate type" matches value "Average of ratings"
And the field "scale[modgrade_type]" matches value "Scale"
......@@ -142,17 +142,17 @@ Feature: Using the activity grade form element
| grade[modgrade_scale] | ABCDEF |
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "C"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
And I click on "Edit settings" "link" in the "Administration" "block"
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
# Try saving the form and visiting it back to verify everything is working ok.
And I press "Save and display"
And I click on "Edit settings" "link"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And the field "grade[modgrade_type]" matches value "Scale"
And the field "grade[modgrade_scale]" matches value "ABCDEF"
......@@ -202,11 +202,11 @@ Feature: Using the activity grade form element
| Description | Test assignment description |
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
And I click on "Edit settings" "link" in the "Administration" "block"
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
......@@ -34,7 +34,7 @@ Feature: In an assignment, teacher can submit feedback files during grading
| Maximum number of uploaded files | 2 |
| Students submit in groups | Yes |
And I follow "Test assignment name"
And I follow "Edit settings"
And I click on "Edit settings" "link" in the "Administration" "block"
And I follow "Expand all"
And I set the field "assignfeedback_file_enabled" to "1"
And I press "Save and display"
......
......@@ -38,7 +38,7 @@ Feature: In an assignment, students start a new attempt based on their previous
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
| Allow another attempt | 1 |
......@@ -55,7 +55,7 @@ Feature: In an assignment, students start a new attempt based on their previous
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I should see "I'm the student first submission"
......@@ -112,7 +112,7 @@ Feature: In an assignment, students start a new attempt based on their previous
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
When I follow "View all submissions"
When I click on "View all submissions" "link" in the "Administration" "block"
Then "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading"
And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading"
And "Student 3" row "Status" column of "generaltable" table should contain "No submission"
......
......@@ -40,7 +40,7 @@ Feature: In an assignment, teachers can edit a students submission inline
When I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
| Grade out of 100 | 50 |
......@@ -50,7 +50,7 @@ Feature: In an assignment, teachers can edit a students submission inline
And I press "Ok"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
Then I should see "50.00" in the "Student 1" "table_row"
And I should see "Submitted for grading" in the "Student 1" "table_row"
And I should see "Graded" in the "Student 1" "table_row"
......
......@@ -28,7 +28,7 @@ Feature: Check that the assignment grade can not be input in a wrong format.
| Description | Test assignment description |
| Use marking workflow | Yes |
When I follow "Test assignment name"
Then I follow "View all submissions"
Then I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50,,6"
And I press "Save changes"
......@@ -58,7 +58,7 @@ Feature: Check that the assignment grade can not be input in a wrong format.
| Description | Test assignment description |
| Use marking workflow | Yes |
When I follow "Test assignment name"
Then I follow "View all submissions"
Then I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50..6"
And I press "Save changes"
......
......@@ -28,14 +28,14 @@ Feature: Check that the assignment grade can be updated correctly
| Description | Test assignment description |
| Use marking workflow | Yes |
When I follow "Test assignment name"
Then I follow "View all submissions"
Then I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
@javascript
......@@ -64,12 +64,12 @@ Feature: Check that the assignment grade can be updated correctly
| Students submit in groups | Yes |
| Group mode | No groups |
When I follow "Test assignment name"
Then I follow "View all submissions"
Then I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
......@@ -40,7 +40,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I set the following fields to these values:
| Grade | 49 |
......@@ -58,7 +58,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
When I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I click on "View a different attempt" "link"
And I click on "//div[contains(concat(' ', normalize-space(@class), ' '), ' confirmation-dialogue ')]//input[@value='0']" "xpath_element"
......
......@@ -36,18 +36,18 @@ Feature: In an assignment, the administrator can edit students' submissions
And I am on site homepage
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Edit" "link" in the "Student 1" "table_row"
And I choose "Edit submission" in the open action menu
And I set the following fields to these values:
| Online text | Have you seen the movie Chef? |
And I press "Save changes"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
Then I should see "Have you seen the movie Chef?"
And I click on "Edit" "link" in the "Student 1" "table_row"
And I choose "Edit submission" in the open action menu
And I set the following fields to these values:
| Online text | I have seen the movie chef. |
And I press "Save changes"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
Then I should see "I have seen the movie chef."
......@@ -32,7 +32,7 @@ Feature: In an assignment, teachers can filter displayed submissions by assigned
| Use marking workflow | Yes |
| Use marking allocation | Yes |
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "allocatedmarker" to "Marker 1"
And I press "Save changes"
......@@ -42,7 +42,7 @@ Feature: In an assignment, teachers can filter displayed submissions by assigned
When I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "View all submissions" "link" in the "Administration" "block"
And I set the field "markerfilter" to "Marker 1"
Then I should see "Student 1"
And I should not see "Student 2"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment