1 |
efrain |
1 |
@mod @mod_data
|
|
|
2 |
Feature: Users can navigate through the database activity using the tertiary navigation
|
|
|
3 |
In order to use the database module
|
|
|
4 |
As a user
|
|
|
5 |
I need to navigate using the tertiary navigation.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | intro | course | idnumber |
|
|
|
21 |
| data | Test database name | Database intro | C1 | data1 |
|
|
|
22 |
| data | Database without fields | Database intro | C1 | data2 |
|
|
|
23 |
And the following "mod_data > fields" exist:
|
|
|
24 |
| database | type | name | description |
|
|
|
25 |
| data1 | text | field1 | Test field description |
|
|
|
26 |
| data1 | text | field2 | Test field 2 description |
|
|
|
27 |
And the following "mod_data > entries" exist:
|
|
|
28 |
| database | user | field1 | field2 |
|
|
|
29 |
| data1 | teacher1 | Teacher entry 1 | Some content 1 |
|
|
|
30 |
| data1 | teacher1 | Teacher entry 2 | Some content 2 |
|
|
|
31 |
And the following "mod_data > presets" exist:
|
|
|
32 |
| database | name | description | user |
|
|
|
33 |
| data1 | Saved preset by teacher1 | This preset has also a description | teacher1 |
|
|
|
34 |
And I log in as "admin"
|
|
|
35 |
And the following config values are set as admin:
|
|
|
36 |
| enableportfolios | 1 |
|
|
|
37 |
And I navigate to "Plugins > Portfolios > Manage portfolios" in site administration
|
|
|
38 |
And I set portfolio instance "File download" to "Enabled and visible"
|
|
|
39 |
And I click on "Save" "button"
|
|
|
40 |
And I log out
|
|
|
41 |
And I am on the "Test database name" "data activity" page logged in as teacher1
|
|
|
42 |
|
|
|
43 |
@javascript
|
|
|
44 |
Scenario: The tertiary navigation in the Database page.
|
|
|
45 |
Given I navigate to "Database" in current page administration
|
|
|
46 |
# Teacher: List view.
|
|
|
47 |
And I should not see "List view" in the "data-listview-content" "region"
|
|
|
48 |
When I click on "Actions" "button"
|
|
|
49 |
Then I should see "Import entries" in the ".entriesactions" "css_element"
|
|
|
50 |
And I should see "Export entries" in the ".entriesactions" "css_element"
|
|
|
51 |
And I should see "Export to portfolio" in the ".entriesactions" "css_element"
|
|
|
52 |
And I press the escape key
|
|
|
53 |
# Teacher: Single view.
|
|
|
54 |
And I set the field "View mode tertiary navigation" to "Single view"
|
|
|
55 |
And I should not see "Single view" in the "data-singleview-content" "region"
|
|
|
56 |
And I click on "Actions" "button"
|
|
|
57 |
And I should see "Import entries" in the ".entriesactions" "css_element"
|
|
|
58 |
And I should see "Export entries" in the ".entriesactions" "css_element"
|
|
|
59 |
And I should not see "Export to portfolio" in the ".entriesactions" "css_element"
|
|
|
60 |
# Teacher: Database without fields.
|
|
|
61 |
And I am on the "Database without fields" "data activity" page
|
|
|
62 |
And I should not see "Actions"
|
|
|
63 |
# Student without entries: List view.
|
|
|
64 |
And I am on the "Test database name" "data activity" page logged in as student1
|
|
|
65 |
And I should not see "Actions"
|
|
|
66 |
# Student without entries: Single view.
|
|
|
67 |
And I set the field "View mode tertiary navigation" to "Single view"
|
|
|
68 |
And I should not see "Actions"
|
|
|
69 |
# Student with entries: Single view.
|
|
|
70 |
But the following "mod_data > entries" exist:
|
|
|
71 |
| database | user | field1 | field2 |
|
|
|
72 |
| data1 | student1 | Student entry 3 | Some content 3 |
|
|
|
73 |
And I should not see "Actions"
|
|
|
74 |
# Student with entries: List view.
|
|
|
75 |
And I set the field "View mode tertiary navigation" to "List view"
|
|
|
76 |
And I click on "Actions" "button"
|
|
|
77 |
And I should not see "Import entries" in the ".entriesactions" "css_element"
|
|
|
78 |
And I should not see "Export entries" in the ".entriesactions" "css_element"
|
|
|
79 |
And I should see "Export to portfolio" in the ".entriesactions" "css_element"
|
|
|
80 |
|
|
|
81 |
@javascript
|
|
|
82 |
Scenario: The tertiary navigation in the Presets page.
|
|
|
83 |
Given I navigate to "Presets" in current page administration
|
|
|
84 |
When I click on "Actions" "button"
|
|
|
85 |
Then I should see "Import preset" in the ".presetsactions" "css_element"
|
|
|
86 |
And I should see "Export preset" in the ".presetsactions" "css_element"
|
|
|
87 |
And I should see "Publish preset on this site" in the ".presetsactions" "css_element"
|
|
|
88 |
And I press the escape key
|
|
|
89 |
# Database without fields.
|
|
|
90 |
But I am on the "Database without fields" "data activity" page
|
|
|
91 |
And I navigate to "Presets" in current page administration
|
|
|
92 |
And I click on "Actions" "button"
|
|
|
93 |
And I should see "Import preset" in the ".presetsactions" "css_element"
|
|
|
94 |
And I should not see "Export preset" in the ".presetsactions" "css_element"
|
|
|
95 |
And I should not see "Publish preset on this site" in the ".presetsactions" "css_element"
|
|
|
96 |
|
|
|
97 |
Scenario: The tertiary navigation in the Presets preview page.
|
|
|
98 |
Given I navigate to "Presets" in current page administration
|
|
|
99 |
When I follow "Saved preset by teacher1"
|
|
|
100 |
Then I should see "Preview of Saved preset by teacher1"
|
|
|
101 |
And "Use this preset" "button" should exist
|
|
|
102 |
# Single view
|
|
|
103 |
And I set the field "Templates tertiary navigation" to "Single view template"
|
|
|
104 |
And I should see "Preview of Saved preset by teacher1"
|
|
|
105 |
And "Use this preset" "button" should exist
|
|
|
106 |
|
|
|
107 |
@javascript
|
|
|
108 |
Scenario: The tertiary navigation in the Fields page.
|
|
|
109 |
Given I navigate to "Fields" in current page administration
|
|
|
110 |
When I open the action menu in "field1" "table_row"
|
|
|
111 |
Then I should see "Edit"
|
|
|
112 |
And I should see "Delete"
|
|
|
113 |
And I press the escape key
|
|
|
114 |
And I should not see "Actions"
|
|
|
115 |
|
|
|
116 |
@javascript
|
|
|
117 |
Scenario: The tertiary navigation in the Templates page.
|
|
|
118 |
Given I navigate to "Templates" in current page administration
|
|
|
119 |
When I click on "Actions" "button"
|
|
|
120 |
Then I should see "Export preset" in the ".presetsactions" "css_element"
|
|
|
121 |
And I should see "Publish preset on this site" in the ".presetsactions" "css_element"
|
|
|
122 |
And I press the escape key
|
|
|
123 |
And I should see "Add entry template"
|
|
|
124 |
# List template.
|
|
|
125 |
And I set the field "Templates tertiary navigation" to "List view template"
|
|
|
126 |
And I should not see "Add entry template"
|
|
|
127 |
And I should see "Header"
|
|
|
128 |
And I should see "Repeated entry"
|
|
|
129 |
And I should see "Footer"
|