1 |
efrain |
1 |
@tool @tool_licensemanager
|
|
|
2 |
Feature: Custom licences
|
|
|
3 |
In order to use custom licences
|
|
|
4 |
As an admin
|
|
|
5 |
I need to be able to add custom licences
|
|
|
6 |
|
|
|
7 |
Scenario: I am able to create custom licences
|
|
|
8 |
Given I log in as "admin"
|
|
|
9 |
And I navigate to "Licence > Licence manager" in site administration
|
|
|
10 |
And I click on "Create licence" "link"
|
|
|
11 |
And I set the following fields to these values:
|
|
|
12 |
| shortname | MIT |
|
|
|
13 |
| fullname | MIT Licence |
|
|
|
14 |
| source | https://opensource.org/licenses/MIT |
|
|
|
15 |
| Licence version | ##first day of January 2020## |
|
|
|
16 |
When I press "Save changes"
|
|
|
17 |
Then I should see "Licence manager"
|
|
|
18 |
And I should see "MIT Licence" in the "MIT" "table_row"
|
|
|
19 |
And I should see "https://opensource.org/licenses/MIT" in the "MIT" "table_row"
|
|
|
20 |
|
|
|
21 |
Scenario: I am only be able to make custom license with a valid url source (including scheme).
|
|
|
22 |
Given I log in as "admin"
|
|
|
23 |
And I navigate to "Licence > Licence manager" in site administration
|
|
|
24 |
And I click on "Create licence" "link"
|
|
|
25 |
And I set the following fields to these values:
|
|
|
26 |
| shortname | MIT |
|
|
|
27 |
| fullname | MIT Licence |
|
|
|
28 |
| source | opensource.org/licenses/MIT |
|
|
|
29 |
| Licence version | ##2020-01-01## |
|
|
|
30 |
When I press "Save changes"
|
|
|
31 |
Then I should see "Invalid source URL"
|
|
|
32 |
And I set the following fields to these values:
|
|
|
33 |
| source | mailto:tomdickman@catalyst-au.net |
|
|
|
34 |
And I press "Save changes"
|
|
|
35 |
And I should see "Invalid source URL"
|
|
|
36 |
And I set the following fields to these values:
|
|
|
37 |
| source | https://opensource.org/licenses/MIT |
|
|
|
38 |
And I press "Save changes"
|
|
|
39 |
And I should see "Licence manager"
|
|
|
40 |
And I should see "MIT Licence" in the "MIT" "table_row"
|
|
|
41 |
And I should see "https://opensource.org/licenses/MIT" in the "MIT" "table_row"
|
|
|
42 |
|
|
|
43 |
Scenario: Custom license version format must be YYYYMMDD00
|
|
|
44 |
Given I log in as "admin"
|
|
|
45 |
And I navigate to "Licence > Licence manager" in site administration
|
|
|
46 |
And I click on "Create licence" "link"
|
|
|
47 |
And I set the following fields to these values:
|
|
|
48 |
| shortname | MIT |
|
|
|
49 |
| fullname | MIT Licence |
|
|
|
50 |
| source | https://opensource.org/licenses/MIT |
|
|
|
51 |
| Licence version | ##1 March 2019## |
|
|
|
52 |
When I press "Save changes"
|
|
|
53 |
Then I should see "Licence manager"
|
|
|
54 |
And I should see "2019030100" in the "MIT" "table_row"
|
|
|
55 |
|
|
|
56 |
@javascript
|
|
|
57 |
Scenario: Custom license short name should not be editable after first creation
|
|
|
58 |
Given I log in as "admin"
|
|
|
59 |
And I navigate to "Licence > Licence manager" in site administration
|
|
|
60 |
And I click on "Create licence" "link"
|
|
|
61 |
And I set the following fields to these values:
|
|
|
62 |
| shortname | MIT |
|
|
|
63 |
| fullname | MIT Licence |
|
|
|
64 |
| source | https://opensource.org/licenses/MIT |
|
|
|
65 |
| Licence version | ##1 Mar 2019## |
|
|
|
66 |
And I press "Save changes"
|
|
|
67 |
And I should see "Licence manager"
|
|
|
68 |
And I should see "MIT Licence" in the "MIT" "table_row"
|
|
|
69 |
When I click on "Edit" "icon" in the "MIT" "table_row"
|
|
|
70 |
Then I should see "Edit licence"
|
|
|
71 |
And the "shortname" "field" should be disabled
|