1 |
efrain |
1 |
@core @core_admin
|
|
|
2 |
Feature: MoodleNet outbound configuration
|
|
|
3 |
In order to send activity/resource to MoodleNet
|
|
|
4 |
As a Moodle administrator
|
|
|
5 |
I need to set outbound configuration
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given I log in as "admin"
|
|
|
9 |
|
|
|
10 |
Scenario: Share to MoodleNet experimental flag
|
|
|
11 |
Given I navigate to "Development > Experimental" in site administration
|
|
|
12 |
Then "Enable sharing to MoodleNet" "field" should exist
|
|
|
13 |
And the field "Enable sharing to MoodleNet" matches value "0"
|
|
|
14 |
|
|
|
15 |
Scenario: Outbound configuration without experimental flag enable yet
|
|
|
16 |
Given I navigate to "MoodleNet" in site administration
|
|
|
17 |
Then I should not see "MoodleNet outbound settings"
|
|
|
18 |
|
|
|
19 |
Scenario: Outbound configuration without OAuth 2 service setup yet
|
|
|
20 |
Given the following config values are set as admin:
|
|
|
21 |
| enablesharingtomoodlenet | 1 |
|
|
|
22 |
When I navigate to "MoodleNet" in site administration
|
|
|
23 |
Then I should see "MoodleNet outbound settings"
|
|
|
24 |
And I click on "MoodleNet outbound settings" "link"
|
|
|
25 |
And the field "OAuth 2 service" matches value "None"
|
|
|
26 |
And I should see "Select a MoodleNet OAuth 2 service to enable sharing to that MoodleNet site. If the service doesn't exist yet, you will need to create it."
|
|
|
27 |
And I click on "create" "link"
|
|
|
28 |
And I should see "OAuth 2 services"
|
|
|
29 |
|
|
|
30 |
Scenario: Outbound configuration with OAuth 2 service setup
|
|
|
31 |
Given a MoodleNet mock server is configured
|
|
|
32 |
And the following config values are set as admin:
|
|
|
33 |
| enablesharingtomoodlenet | 1 |
|
|
|
34 |
And I navigate to "Server > OAuth 2 services" in site administration
|
|
|
35 |
And I press "Custom"
|
|
|
36 |
And I should see "Create new service: Custom"
|
|
|
37 |
And I set the following fields to these values:
|
|
|
38 |
| Name | Testing custom service |
|
|
|
39 |
| Client ID | thisistheclientid |
|
|
|
40 |
| Client secret | supersecret |
|
|
|
41 |
And I press "Save changes"
|
|
|
42 |
When I navigate to "MoodleNet > MoodleNet outbound settings" in site administration
|
|
|
43 |
Then the field "OAuth 2 service" matches value "None"
|
|
|
44 |
And I navigate to "Server > OAuth 2 services" in site administration
|
|
|
45 |
And I press "MoodleNet"
|
|
|
46 |
And I should see "Create new service: MoodleNet"
|
|
|
47 |
And I change the MoodleNet field "Service base URL" to mock server
|
|
|
48 |
And I press "Save changes"
|
|
|
49 |
And I navigate to "MoodleNet > MoodleNet outbound settings" in site administration
|
|
|
50 |
And the "OAuth 2 service" "field" should be enabled
|
|
|
51 |
And I should see "MoodleNet" in the "OAuth 2 service" "select"
|
|
|
52 |
And I should not see "Testing custom service" in the "OAuth 2 service" "select"
|