AutorÃa | Ultima modificación | Ver Log |
@coreFeature: MoodleNet outbound send activityIn order to send activity to MoodleNet serverAs a teacherI need to be able package the activity and share to MoodleNetBackground:Given 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"And the following course exists:| name | Test course || shortname | C1 |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 the following "activities" exist:| activity | course | idnumber | name | intro || assign | C1 | assign1 | Test Assignment 1 | Test Assignment 1 |Scenario: Share to MoodleNet menu only be available for teachers and managersGiven I am on the "Test Assignment 1" "assign activity" page logged in as student1Then "Share to MoodleNet" "link" should not exist in current page administrationAnd I am on the "Test Assignment 1" "assign activity" page logged in as teacher1And "Share to MoodleNet" "link" should exist in current page administrationAnd I am on the "Test Assignment 1" "assign activity" page logged in as manager1And "Share to MoodleNet" "link" should exist in current page administrationScenario: Share to MoodleNet menu only be available for user that has capability onlyGiven the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || moodle/moodlenet:shareactivity | Prohibit | editingteacher | Course | C1 |When I am on the "Test Assignment 1" "assign activity" page logged in as teacher1Then "Share to MoodleNet" "link" should not exist in current page administrationAnd I am on the "Test Assignment 1" "assign activity" page logged in as manager1And "Share to MoodleNet" "link" should exist in current page administrationAnd the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || moodle/moodlenet:shareactivity | Prohibit | manager | Course | C1 |And I am on the "Test Assignment 1" "assign activity" page logged in as manager1And "Share to MoodleNet" "link" should not exist in current page administration@javascriptScenario: User can share activity to MoodleNetGiven I am on the "Test Assignment 1" "assign activity" page logged in as teacher1When I navigate to "Share to MoodleNet" in current page administrationThen I should see "Assignment" in the "Share to MoodleNet" "dialogue"And 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 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 see their shared resources on the MoodleNet share progress pageGiven I am on the "C1" course page logged in as teacher1When I navigate to "MoodleNet share progress" in current page administrationAnd I should see "There are no shared resources to display at this time."And I am on "C1" course homepageAnd I navigate to "Share to MoodleNet" in current page administrationAnd 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 click on "Close" "button" in the "Share to MoodleNet" "dialogue"And I am on the "Test Assignment 1" "assign activity" pageAnd I navigate to "Share to MoodleNet" in current page administrationAnd I click on "Share" "button" in the "Share to MoodleNet" "dialogue"And I click on "Close" "button" in the "Share to MoodleNet" "dialogue"And I am on "C1" course homepageAnd I navigate to "MoodleNet share progress" in current page administrationThen "Test course 1" row "Name" column of "generaltable" table should contain "Test course 1"And "Test course 1" row "Type" column of "generaltable" table should contain "Course"And "Test course 1" row "Send status" column of "generaltable" table should contain "Sent"And "Test Assignment 1" row "Name" column of "generaltable" table should contain "Test Assignment 1"And "Test Assignment 1" row "Type" column of "generaltable" table should contain "Assignment"And "Test Assignment 1" row "Send status" column of "generaltable" table should contain "Sent"