X7ROOT File Manager
Current Path:
/home/cbholdings/pasukulu/mod/data/tests/behat
home
/
cbholdings
/
pasukulu
/
mod
/
data
/
tests
/
behat
/
📁
..
📄
actionsmenu_replacement.feature
(16.73 KB)
📄
add_entries.feature
(5.95 KB)
📄
advanced_search.feature
(4.08 KB)
📄
behat_mod_data.php
(4.26 KB)
📄
create_activity.feature
(1.88 KB)
📄
data_activities.feature
(2.37 KB)
📄
data_activity_completion.feature
(5.62 KB)
📄
data_activity_completion_pass_grade.feature
(8.5 KB)
📄
data_no_calendar_capabilities.feature
(2.46 KB)
📄
data_presets.feature
(19.44 KB)
📄
default_templates.feature
(7.17 KB)
📄
edit_templates.feature
(10.12 KB)
📄
entry_approval.feature
(2.34 KB)
📄
group_mode.feature
(5.48 KB)
📄
import_presets.feature
(8.69 KB)
📄
manageapproved.feature
(3.65 KB)
📄
preview_preset.feature
(8.94 KB)
📄
required_entries.feature
(12.67 KB)
📄
tertiary_navigation.feature
(6.55 KB)
📄
use_presets.feature
(11.94 KB)
📄
view_entries.feature
(8.73 KB)
📄
zero_state.feature
(3.07 KB)
Editing: edit_templates.feature
@mod @mod_data Feature: Users can edit the database templates In order to use custom templates for entries As a teacher I need to edit the templates html Background: Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | And the following "activities" exist: | activity | name | intro | course | idnumber | | data | Test database name | Database intro | C1 | data1 | And the following "mod_data > fields" exist: | database | type | name | description | | data1 | text | field1 | Test field description | | data1 | text | field2 | Test field 2 description | And the following "mod_data > entries" exist: | database | field1 | field2 | | data1 | Student entry 1 | Some content 1 | And I am on the "Test database name" "data activity" page logged in as teacher1 And I navigate to "Templates" in current page administration And I set the field "Templates tertiary navigation" to "List view template" @javascript Scenario: Edit list template Given I set the following fields to these values: | Header | New header! | | Repeated entry | [[field1]] and [[field2]]! | | Footer | New footer! | And I click on "Save" "button" in the "sticky-footer" "region" When I navigate to "Database" in current page administration Then I should see "New header!" And I should see "Student entry 1 and Some content 1!" And I should see "New footer!" @javascript Scenario: Edit single template Given I set the field "Templates tertiary navigation" to "Single view template" And I set the following fields to these values: | Single view template | [[field1]] and [[field2]] details! | And I click on "Save" "button" in the "sticky-footer" "region" When I navigate to "Database" in current page administration And I set the field "View mode tertiary navigation" to "Single view" Then I should see "Student entry 1 and Some content 1 details!" @javascript Scenario: Edit add entry template Given I set the field "Templates tertiary navigation" to "Add entry template" And I set the following fields to these values: | Add entry template | [[field1]] [[field2]] Form extra! | And I click on "Save" "button" in the "sticky-footer" "region" When I navigate to "Database" in current page administration And I click on "Add entry" "button" Then I should see "Form extra!" @javascript Scenario: Edit advanced search template Given I set the field "Templates tertiary navigation" to "Advanced search template" And I set the following fields to these values: | Advanced search template | New advanced search template! | And I click on "Save" "button" in the "sticky-footer" "region" When I navigate to "Database" in current page administration And I click on "Advanced search" "checkbox" Then I should see "New advanced search template!" @javascript Scenario: Edit without the wysiwyg editor Given I click on "Enable code editor" "checkbox" And I set the following fields to these values: | Repeated entry | <span class="d-none">Nope</span>Yep! | And I click on "Save" "button" in the "sticky-footer" "region" When I navigate to "Database" in current page administration Then I should not see "Nope" And I should see "Yep!" @javascript Scenario: Edit CSS teamplate Given I click on "Enable code editor" "checkbox" And I set the following fields to these values: | Repeated entry | <span class="hideme">Nope</span>Yep! | And I click on "Save" "button" in the "sticky-footer" "region" And I set the field "Templates tertiary navigation" to "Custom CSS" And I set the following fields to these values: | Custom CSS | .hideme {display: none;} | And I click on "Save" "button" in the "sticky-footer" "region" When I navigate to "Database" in current page administration Then I should not see "Nope" And I should see "Yep!" @javascript Scenario: Edit Custom JavaScript Given I click on "Enable code editor" "checkbox" And I set the following fields to these values: | Repeated entry | <span id="hideme">Nope</span>Yep! | And I click on "Save" "button" in the "sticky-footer" "region" And I set the field "Templates tertiary navigation" to "Custom JavaScript" And I set the following fields to these values: | Custom JavaScript | window.onload = () => document.querySelector('#hideme').style.display = 'none'; | And I click on "Save" "button" in the "sticky-footer" "region" When I navigate to "Database" in current page administration Then I should not see "Nope" And I should see "Yep!" @javascript Scenario: Reset database activity template Given I set the following fields to these values: | Header | New header! | | Repeated entry | This is the template content | | Footer | New footer! | And I click on "Save" "button" in the "sticky-footer" "region" And I navigate to "Database" in current page administration And I should see "New header!" And I should see "This is the template content" And I should see "New footer!" And I should not see "Student entry 1" And I should not see "Some content 1" When I navigate to "Templates" in current page administration And I set the field "Templates tertiary navigation" to "List view template" And I click on "Actions" "button" And I choose "Reset current template" in the open action menu And I should see "This will permanently remove the List view template for your current preset." And I click on "Reset" "button" in the "Reset template?" "dialogue" Then I should see "Template reset" And I navigate to "Database" in current page administration And I should not see "New header!" And I should not see "This is the template content" And I should not see "New footer!" And I should see "Student entry 1" And I should see "Some content 1" @javascript Scenario: Reset all database templates using the action menu Given the following "mod_data > templates" exist: | database | name | content | | data1 | singletemplate | Initial single | | data1 | listtemplate | Initial list | | data1 | addtemplate | Initial add | | data1 | asearchtemplate | Initial search | And I navigate to "Database" in current page administration And I should see "Initial list" And I should not see "Student entry 1" And I should not see "Some content 1" And I click on "Advanced search" "checkbox" And I should see "Initial search" And I set the field "View mode tertiary navigation" to "Single view" And I should see "Initial single" And I should not see "Student entry 1" And I should not see "Some content 1" And I click on "Add entry" "button" And I should see "Initial add" When I navigate to "Templates" in current page administration And I click on "Actions" "button" And I choose "Reset all templates" in the open action menu And I should see "You're about to remove all templates for your current preset." And I click on "Reset" "button" in the "Reset all templates?" "dialogue" Then I should see "All templates reset" And I navigate to "Database" in current page administration And I should not see "Initial list" And I should see "Student entry 1" And I should see "Some content 1" And I click on "Advanced search" "checkbox" And I should not see "Initial search" And I set the field "View mode tertiary navigation" to "Single view" And I should not see "Initial single" And I should see "Student entry 1" And I should see "Some content 1" And I click on "Add entry" "button" And I should not see "Initial add" @javascript Scenario: Reset all database templates using the reset template button Given the following "mod_data > templates" exist: | database | name | content | | data1 | singletemplate | Initial single | | data1 | listtemplate | Initial list | | data1 | addtemplate | Initial add | | data1 | asearchtemplate | Initial search | And I navigate to "Database" in current page administration And I should see "Initial list" And I should not see "Student entry 1" And I should not see "Some content 1" And I click on "Advanced search" "checkbox" And I should see "Initial search" And I set the field "View mode tertiary navigation" to "Single view" And I should see "Initial single" And I should not see "Student entry 1" And I should not see "Some content 1" And I click on "Add entry" "button" And I should see "Initial add" When I navigate to "Templates" in current page administration And I click on "Actions" "button" And I choose "Reset current template" in the open action menu And I should see "This will permanently remove the Add entry template for your current preset." And I click on "Reset all templates" "checkbox" And I click on "Reset" "button" in the "Reset template?" "dialogue" Then I should see "All templates reset" And I navigate to "Database" in current page administration And I should not see "Initial list" And I should see "Student entry 1" And I should see "Some content 1" And I click on "Advanced search" "checkbox" And I should not see "Initial search" And I set the field "View mode tertiary navigation" to "Single view" And I should not see "Initial single" And I should see "Student entry 1" And I should see "Some content 1" And I click on "Add entry" "button" And I should not see "Initial add"
Upload File
Create Folder