AutorÃa | Ultima modificación | Ver Log |
@coreFeature: MoodleNet outbound share selected activities in a courseIn order to send a number of selected activities in a course to MoodleNet serverAs a teacherI need to be able to backup the selected activities in a course and share to MoodleNetBackground:Given the following course exists:| name | Test course || shortname | C1 |And the following "activities" exist:| activity | course | idnumber | name | intro || assign | C1 | assign1 | Test Assignment 1 | Test Assignment 1 || assign | C1 | assign2 | Test Assignment 2 | Test Assignment 2 || assign | C1 | assign3 | Test Assignment 3 | Test Assignment 3 |And the following "users" exist:| username | firstname | lastname | email || student1 | Student | 1 | student1@example.com || teacher1 | Teacher | 1 | teacher1@example.com || manager1 | Manager | 1 | manager1@example.com |And the following "course enrolments" exist:| user | course | role || manager1 | C1 | manager || teacher1 | C1 | editingteacher || student1 | C1 | student |And I log in as "admin"And a MoodleNet mock server is configuredAnd the following config values are set as admin:| enablesharingtomoodlenet | 1 |And I navigate to "Server > OAuth 2 services" in site administrationAnd I press "MoodleNet"And I should see "Create new service: MoodleNet"And I change the MoodleNet field "Service base URL" to mock serverAnd I press "Save changes"And I navigate to "MoodleNet > MoodleNet outbound settings" in site administrationAnd I set the field "Auth 2 service" to "MoodleNet"And I press "Save changes"@javascriptScenario: Share to MoodleNet bulk option should only be available for users with the capabilityGiven the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || moodle/moodlenet:sharecourse | Prohibit | editingteacher | Course | C1 |When I am on the "C1" "course" page logged in as teacher1And I turn editing mode onAnd I click on "Bulk actions" "button"And I click on "Select activity Test Assignment 1" "checkbox"Then "Share to MoodleNet" "button" should not exist in the "sticky-footer" "region"And I am on the "C1" "course" page logged in as manager1And I turn editing mode onAnd I click on "Bulk actions" "button"And I click on "Select activity Test Assignment 1" "checkbox"And "Share to MoodleNet" "button" should exist in the "sticky-footer" "region"And the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || moodle/moodlenet:sharecourse | Prohibit | manager | Course | C1 |And I am on the "C1" "course" page logged in as manager1And I turn editing mode onAnd I click on "Bulk actions" "button"And I click on "Select activity Test Assignment 1" "checkbox"And "Share to MoodleNet" "button" should not exist in the "sticky-footer" "region"@javascriptScenario: User can share selected activities in a course to MoodleNetGiven I am on the "C1" "course" page logged in as teacher1And I turn editing mode onAnd I click on "Bulk actions" "button"When I click on "Share to MoodleNet" "button" in the "sticky-footer" "region"Then "Share to MoodleNet" "dialogue" should not existAnd I click on "Select activity Test Assignment 1" "checkbox"And I click on "Select activity Test Assignment 2" "checkbox"And I click on "Share to MoodleNet" "button" in the "sticky-footer" "region"And "Share to MoodleNet" "dialogue" should existAnd I should see "Test course 1" in the "Share to MoodleNet" "dialogue"And I should see "The selected activities are being shared with MoodleNet as a resource." in the "Share to MoodleNet" "dialogue"And I should see "2 activities will be included in the course." in the "Share to MoodleNet" "dialogue"And I click on "Share" "button" in the "Share to MoodleNet" "dialogue"And I switch to "moodlenet_auth" windowAnd I press "Allow" and switch to main windowAnd I should see "Saved to MoodleNet drafts"And "Go to MoodleNet drafts" "link" should exist in the "Share to MoodleNet" "dialogue"@javascriptScenario: User can share activity directly in a course bulk mode to MoodleNetGiven I am on the "C1" "course" page logged in as teacher1And I turn editing mode onAnd I click on "Bulk actions" "button"And I click on "Select activity Test Assignment 1" "checkbox"When I click on "Share to MoodleNet" "button" in the "sticky-footer" "region"Then I should see "Test Assignment 1" in the "Share to MoodleNet" "dialogue"And I should see "This activity is being shared with MoodleNet as a resource." in the "Share to MoodleNet" "dialogue"And I should not see "1 activities will be included in the course." in the "Share to MoodleNet" "dialogue"And I click on "Share" "button" in the "Share to MoodleNet" "dialogue"And I switch to "moodlenet_auth" windowAnd I press "Allow" and switch to main windowAnd I should see "Saved to MoodleNet drafts"And "Go to MoodleNet drafts" "link" should exist in the "Share to MoodleNet" "dialogue"