create_delete_page.feature 6.17 KB
Newer Older
1
@javascript @core @portfolio
2 3 4 5 6
Feature: Creating a page with stuff in it
   In order to have a portfolio
   As a user I need navigate to to portfolio
   So I can create a page and add content to it

7 8 9 10 11
Background:
    Given the following "users" exist:
    | username | password | email | firstname | lastname | institution | authname | role |
    | UserA | Kupuh1pa! | UserA@example.org | Angela | User | mahara | internal | member |

12 13
Scenario: Creating a page with content in it (Bug 1426983)
    # Log in as "Admin" user
Gregor Anzelj's avatar
Gregor Anzelj committed
14
    Given I log in as "admin" with password "Kupuh1pa!"
15
    # set up for being able to use an image in WYSIWYG editor
16
    And I choose "Files" in "Create" from main menu
17
    And I attach the file "Image2.png" to "files_filebrowser_userfile"
18
    # Navigating to Portfolio to create a page
19
    # This is the test for manually creating a page
20
    And I choose "Pages and collections" in "Create" from main menu
21
    And I scroll to the base of id "addview-button"
22
    And I should see "Pages and collections" in the "h1 heading" property
23 24
    And I follow "Add"
    And I click on "Page" in the dialog
25 26
    And I fill in the following:
    | Page title | Test view |
27 28
    And I fill in "First description" in first editor
    And I press "Save"
29 30 31
    # verify page elements are displayed Display page and Return to pages and collections buttons
    And I should see "Display page" in the "Display page button" property
    And I should see "Return to pages and collections" in the "Return to pages and collections button" property
32 33 34 35 36 37 38
    # Editing the pages
    And I follow "Settings" in the "Toolbar buttons" property
    #Change the Page title
    And I fill in the following:
    | Page title | This is the edited page title |
    # Change the page description
    And I fill in "This is the edited description" in first editor
39 40 41 42 43 44
    # Upload an image into the WYSIWYG editor
    And I click the "Insert/edit image" button in the editor
    And I expand the section "Image"
    And I press "Select \"Image2.png\""
    And I press "Submit"
    And I wait "1" seconds
45
    And I press "Save"
46 47
    # Adding media blockAnd I fill in the following:
    | Page title | This is the edited page title |
48 49 50 51 52 53 54
    # confirm h1 page title displayed
    And I should see "This is the edited page title" in the "h1 heading" property
    # confirm settings, edit and share buttons displayed
    And I should see "Settings" in the ".editlayout .btn-title" element
    And I should see "Edit" in the ".editcontent .btn-title" element
    And I should see "Share" in the ".editshare .btn-title" element
    # Adding media block
55 56 57 58 59
    And I expand "Media" node
    And I follow "File(s) to download"
    And I press "Add"
    And I press "Save"
    # Adding Journal block
60
    And I expand "Journals" node in the "blocktype sidebar" property
61
    And I follow "Recent journal entries"
62 63
    And I press "Add"
    And I press "Save"
64 65
    And I scroll to the base of id "block-category-blog"
    And I collapse "Journals" node in the "blocktype sidebar" property
66
    # Adding profile info block
67
    And I expand "Personal info" node in the "blocktype sidebar" property
68 69 70 71
    And I follow "Profile information"
    And I press "Add"
    And I press "Save"
    # Adding external media block - but cancel out
72
    And I expand "External" node in the "blocktype sidebar" property
73 74 75
    And I follow "External media"
    And I press "Add"
    And I press "Remove"
76

77
    # verify page elements are displayed Display page and Return to pages and collections buttons
78 79
    And I should see "Display page" in the "Display page button" property
    And I should see "Return to pages and collections" in the "Return to pages and collections button" property
Son Nguyen's avatar
Son Nguyen committed
80
    And I display the page
81 82
    # Show last updated date and time when seeing a portfolio page (Bug 1634591)
    And I should see "Updated on" in the ".text-right" element
83
    # actual date format displayed is 31 May 2018, 13:29
84
    And I should see the date "today" in the ".text-right" element with the format "d F Y"
85 86
    # Verifying the page title and description changed
    Then I should see "This is the edited page title"
87
    And I should see "This is the edited description"
88
    # Create a timeline version
89
    And I press "More options"
90
    And I follow "Save to timeline"
91 92
    # Check that the image is displayed on page and ensure the link is correct
    Then I should see image "Image2.png" on the page
93
    # The "..." button should only have the option to print and delete the page
94 95
    And I should see "More options"
    And I press "More options"
96 97
    Then I should see "Print"
    And I should see "Delete this page"
98
    # User share page with public and enable copy page functionality
99
    And I choose "Pages and collections" in "Create" from main menu
100
    And I click on "Manage access" in "This is the edited page title" card access menu
101 102 103 104 105 106 107 108 109 110
    And I follow "Advanced options"
    And I enable the switch "Allow copying"
    And I select "Public" from "General" in shared with select2 box
    And I press "Save"
    And I log out
    # Log in as UserA and copy the page
    Given I log in as "UserA" with password "Kupuh1pa!"
    And I wait "1" seconds
    Then I should see "This is the edited page title"
    When I follow "This is the edited page title"
111
    And I press "More options"
112 113 114 115 116 117 118 119
    And I follow "Copy"
    And I fill in the following:
    | Page title | This is my page now |
    And I press "Save"
    And I follow "Display page"
    # Check that the image is displayed on copied page and ensure the link is correct
    Then I should see image "Image2.png" on the page
    And I log out
120

121
    # check page can be deleted (Bug 1755682)
122
    Given I log in as "admin" with password "Kupuh1pa!"
123 124 125
    # Go to version page
    And I choose "Pages and collections" in "Create" from main menu
    And I follow "This is the edited page title"
126
    And I press "More options"
127
    And I follow "Timeline"
128 129 130

    Then I should see "Timeline"
    # check page can be deleted (Bug 1755682)
131
    And I choose "Pages and collections" in "Create" from main menu
132
    And I click on "Delete" in "This is the edited page" card menu
133 134 135 136
    And I should see "Do you really want to delete this page?"
    And I press "Yes"
    Then I should see "Page deleted"
    And I should not see "This is the edited page"