|
| 1 | +@mod @mod_contentdesigner @cdelement_chapter @chapter_bookmark @javascript |
| 2 | +Feature: Check content designer chapter element bookmark tool support |
| 3 | + |
| 4 | + Background: |
| 5 | + Given the following "users" exist: |
| 6 | + | username | firstname | lastname | email | |
| 7 | + | teacher1 | Teacher | 1 | teacher1@example.com | |
| 8 | + | student1 | Student | 1 | student1@example.com | |
| 9 | + And the following "courses" exist: |
| 10 | + | fullname | shortname | category | |
| 11 | + | Course 1 | C1 | 0 | |
| 12 | + And the following "course enrolments" exist: |
| 13 | + | user | course | role | |
| 14 | + | teacher1 | C1 | editingteacher | |
| 15 | + | student1 | C1 | student | |
| 16 | + And the following "activity" exists: |
| 17 | + | activity | contentdesigner | |
| 18 | + | name | Demo content | |
| 19 | + | intro | Contentdesigner Description | |
| 20 | + | course | C1 | |
| 21 | + And I log out |
| 22 | + And I am on the "Demo content" "contentdesigner activity" page logged in as teacher1 |
| 23 | + And I click on "Content editor" "link" |
| 24 | + And I click on ".contentdesigner-addelement .fa-plus" "css_element" |
| 25 | + And I click on ".elements-list li[data-element=chapter]" "css_element" in the ".modal-body" "css_element" |
| 26 | + And I set the following fields to these values: |
| 27 | + | Title | First chapter | |
| 28 | + | Display title | 1 | |
| 29 | + | Visibility | Visible | |
| 30 | + | Learning Tools | Enabled | |
| 31 | + And I press "Create element" |
| 32 | + And I click on "Content editor" "link" |
| 33 | + And I click on ".contentdesigner-addelement .fa-plus" "css_element" |
| 34 | + And I click on ".elements-list li[data-element=paragraph]" "css_element" in the ".modal-body" "css_element" |
| 35 | + And I set the following fields to these values: |
| 36 | + | Content | Lorem Ipsum is simply dummy text of the printing and typesetting industry.| |
| 37 | + | Title | Paragraph 01 | |
| 38 | + And I press "Create element" |
| 39 | + And I log out |
| 40 | + |
| 41 | + @javascript |
| 42 | + Scenario: Learning tool status checked in chapter element settings. |
| 43 | + Given I am on the "Demo content" "contentdesigner activity" page logged in as teacher1 |
| 44 | + And I click on "Content Designer" "link" |
| 45 | + Then I should see "First chapter" |
| 46 | + Then I should see "Bookmark" in the ".toolbar-block" "css_element" |
| 47 | + Then I should see "Notes" in the ".toolbar-block" "css_element" |
| 48 | + And I click on "Content editor" "link" |
| 49 | + And I click on ".element-item[data-elementshortname=chapter] .actions-list li[data-action=edit] a" "css_element" |
| 50 | + And I set the following fields to these values: |
| 51 | + | Title | First chapter - Learning tool disabled | |
| 52 | + | Learning Tools | Disabled | |
| 53 | + And I press "Update element" |
| 54 | + And I click on "Content Designer" "link" |
| 55 | + Then I should see "First chapter - Learning tool disabled" |
| 56 | + Then I should not see "Bookmark" in the ".toolbar-block" "css_element" |
| 57 | + Then I should not see "Notes" in the ".toolbar-block" "css_element" |
| 58 | + |
| 59 | + @javascript |
| 60 | + Scenario: Learning tool status checked in chapter element general settings. |
| 61 | + Given I log in as "admin" |
| 62 | + And I navigate to "Plugins > Activity modules > Content Designer" in site administration |
| 63 | + And I set the field "Learning Tools" to "Enabled" |
| 64 | + And I press "Save changes" |
| 65 | + And I log out |
| 66 | + And I am on the "Demo content" "contentdesigner activity" page logged in as teacher1 |
| 67 | + And I click on "Content editor" "link" |
| 68 | + And I click on ".contentdesigner-addelement .fa-plus" "css_element" |
| 69 | + And I click on ".elements-list li[data-element=chapter]" "css_element" in the ".modal-body" "css_element" |
| 70 | + And I set the following fields to these values: |
| 71 | + | Title | Second chapter | |
| 72 | + | Display title | 1 | |
| 73 | + | Visibility | Visible | |
| 74 | + And I press "Create element" |
| 75 | + And I am on the "Demo content" "contentdesigner activity" page logged in as teacher1 |
| 76 | + And I click on "Content Designer" "link" |
| 77 | + Then I should see "First chapter" |
| 78 | + Then I should see "Bookmark" in the ".chapters-list:nth-child(2) .toolbar-block .content-designer-learningtool-bookmark" "css_element" |
| 79 | + Then I should see "Notes" in the ".chapters-list:nth-child(2) .toolbar-block .content-designer-learningtool-note" "css_element" |
| 80 | + And I click on "Content editor" "link" |
| 81 | + And I click on ".chapters-list:nth-child(2) .element-item[data-elementshortname='chapter'] .actions-list li[data-action=edit] a" "css_element" |
| 82 | + And I set the following fields to these values: |
| 83 | + | Title | Second chapter - Learning tool disabled | |
| 84 | + | Learning Tools | Disabled | |
| 85 | + And I press "Update element" |
| 86 | + And I click on "Content Designer" "link" |
| 87 | + Then I should see "Second chapter - Learning tool disabled" |
| 88 | + Then I should not see "Bookmark" in the ".chapters-list:nth-child(2) .toolbar-block" "css_element" |
| 89 | + Then I should not see "Notes" in the ".chapters-list:nth-child(2) .toolbar-block" "css_element" |
| 90 | + |
| 91 | + @javascript |
| 92 | + Scenario: Use bookmark tool for chapter element content. |
| 93 | + Given I am on the "Demo content" "contentdesigner activity" page logged in as student1 |
| 94 | + Then I should see "Bookmark" in the ".toolbar-block" "css_element" |
| 95 | + # Add a bookmark. |
| 96 | + And I click on "Bookmark" "button" in the ".toolbar-block" "css_element" |
| 97 | + Then I should see "Bookmarked" in the ".toolbar-block" "css_element" |
| 98 | + Then I should see "This chapter bookmarked successfully and you can view the bookmarks under profile / learning tools / bookmarks." |
| 99 | + Then I follow "Profile" in the user menu |
| 100 | + And I click on "Bookmarks" "link" |
| 101 | + Then I should see "C1: Demo content | Acceptance test site | First chapter" in the ".course-item" "css_element" |
| 102 | + Then I should see "View Chapter" in the ".button-block" "css_element" |
| 103 | + Then I should see "Course 1 / General" in the ".category-item" "css_element" |
| 104 | + And I click on "View Chapter" "button" in the ".button-block" "css_element" |
| 105 | + Then I should see "Demo content" |
| 106 | + Then I should see "First chapter" |
| 107 | + Then I should see "Bookmarked" in the ".toolbar-block" "css_element" |
| 108 | + # Remove a bookmark. |
| 109 | + And I click on "Bookmarked" "button" in the ".toolbar-block" "css_element" |
| 110 | + Then I should see "This chapter bookmark removed and you can view the bookmarks under profile / learning tools / bookmarks." |
| 111 | + Then I follow "Profile" in the user menu |
| 112 | + And I click on "Bookmarks" "link" |
| 113 | + Then I should not see "C1: Demo content" |
| 114 | + Then I should not see "C1: Demo content | Acceptance test site | First chapter" |
| 115 | + Then I should not see "View Chapter" |
| 116 | + And I log out |
0 commit comments