create_delete_page.feature 5.85 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
16
17
    # set up for being able to use an image in WYSIWYG editor
    And I choose "Files" in "Content" from main menu
    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 "Portfolio" 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
32
    # verify display page button is displayed
    And I should see "Display page" in the "div#view-wizard-controls.col-collapse-offset.col-with-collapse" element
    # verify Return to pages and collections is displayed
    And I should see "Return to pages and collections" in the "div#view-wizard-controls.col-collapse-offset.col-with-collapse" element
33
34
35
36
37
38
39
    # 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
40
41
42
43
44
45
    # 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
46
    And I press "Save"
47
48
    # Adding media blockAnd I fill in the following:
    | Page title | This is the edited page title |
49
50
51
52
53
54
55
    # 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
56
57
58
59
60
    And I expand "Media" node
    And I follow "File(s) to download"
    And I press "Add"
    And I press "Save"
    # Adding Journal block
61
    And I expand "Journals" node in the "blocktype sidebar" property
62
    And I follow "Recent journal entries"
63
64
    And I press "Add"
    And I press "Save"
65
66
    And I scroll to the base of id "block-category-blog"
    And I collapse "Journals" node in the "blocktype sidebar" property
67
    # Adding profile info block
68
    And I expand "Personal info" node in the "blocktype sidebar" property
69
70
71
72
    And I follow "Profile information"
    And I press "Add"
    And I press "Save"
    # Adding external media block - but cancel out
73
    And I expand "External" node in the "blocktype sidebar" property
74
75
76
    And I follow "External media"
    And I press "Add"
    And I press "Remove"
77

78
79
80
    # verify page elements are displayed Display page and Return to pages and collections buttons
    And I should see "Display page" in the "#view-wizard-controls .btn-default:nth-of-type(1)" element
    And I should see "Return to pages and collections" in the "#view-wizard-controls .btn-default:nth-of-type(2)" element
Son Nguyen's avatar
Son Nguyen committed
81
    And I display the page
82
83
84
85
    # Show last updated date and time when seeing a portfolio page (Bug 1634591)
    And I should see "Updated on" in the ".text-right" element
    # actual date format displayed is 31 May 2018, 1:29 PM
    And I should see the date "today" in the ".text-right" element with the format "d F Y"
86
87
    # Verifying the page title and description changed
    Then I should see "This is the edited page title"
88
89
90
    And I should see "This is the edited description"
    # Check that the image is displayed on page and ensure the link is correct
    Then I should see image "Image2.png" on the page
91
92
93
94
95
    # The "..." button should only have the option to print and delete the page
    And I should see "More..."
    And I press "More..."
    Then I should see "Print"
    And I should see "Delete this page"
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
    # User share page with public and enable copy page functionality
    And I choose "Pages and collections" in "Portfolio" from main menu
    And I click on "Manage access" in "This is the edited page title" panel access menu
    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"
    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
117
    # check page can be deleted (Bug 1755682)
118
    Given I log in as "admin" with password "Kupuh1pa!"
119
120
121
122
123
124
    And I choose "Pages and collections" in "Portfolio" from main menu
    And I click on "Delete" in "This is the edited page" panel menu
    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"