2012-11-09 19:15:54 +01:00
|
|
|
Feature: Create a page
|
2016-02-15 02:58:24 +01:00
|
|
|
As an author
|
|
|
|
I want to create a page in the CMS
|
|
|
|
So that I can grow my website
|
2012-11-09 19:15:54 +01:00
|
|
|
|
2018-11-30 01:28:04 +01:00
|
|
|
Background:
|
|
|
|
Given a "page" "MyPage"
|
2021-11-17 02:10:48 +01:00
|
|
|
And a "virtual page" "MyVirtualPage"
|
2022-09-05 22:44:46 +02:00
|
|
|
And the "group" "EDITOR" has permissions "Access to 'Pages' section"
|
2018-11-30 01:28:04 +01:00
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: I can create a page from the pages section
|
2022-09-05 22:44:46 +02:00
|
|
|
When I am logged in as a member of "EDITOR" group
|
|
|
|
And I go to "/admin/pages"
|
2020-10-22 10:21:15 +02:00
|
|
|
Then I should see "MyPage" in the tree
|
|
|
|
And I should see a "Add new" button in CMS Content Toolbar
|
2018-11-30 01:28:04 +01:00
|
|
|
When I press the "Add new" button
|
|
|
|
And I select the "Page" radio button
|
|
|
|
And I press the "Create" button
|
|
|
|
Then I should see an edit page form
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: I can create a page under another page
|
2022-09-05 22:44:46 +02:00
|
|
|
When I am logged in as a member of "EDITOR" group
|
|
|
|
And I go to "/admin/pages"
|
2020-10-22 10:21:15 +02:00
|
|
|
Then I should see "MyPage" in the tree
|
|
|
|
And I should see a "Add new" button in CMS Content Toolbar
|
2016-02-15 02:58:24 +01:00
|
|
|
When I press the "Add new" button
|
2018-11-30 01:28:04 +01:00
|
|
|
And I select the "Under another page" radio button
|
2021-11-17 02:10:48 +01:00
|
|
|
# Virtual page doesn't allow children, page radio button below should be disabled
|
|
|
|
And I select "MyVirtualPage" in the "#Form_AddForm_ParentID_Holder" tree dropdown
|
|
|
|
And I wait for 2 seconds
|
|
|
|
Then I should see a "#Form_AddForm_PageType_Page[disabled]" element
|
|
|
|
# Normal pages allows children, page radio button below should not be disabled
|
|
|
|
When I select "MyPage" in the "#Form_AddForm_ParentID_Holder" tree dropdown
|
|
|
|
And I wait for 2 seconds
|
2016-02-15 02:58:24 +01:00
|
|
|
And I select the "Page" radio button
|
2021-11-17 02:10:48 +01:00
|
|
|
Then I should not see a "#Form_AddForm_PageType_Page[disabled]" element
|
2016-02-15 02:58:24 +01:00
|
|
|
And I press the "Create" button
|
|
|
|
Then I should see an edit page form
|
2020-10-22 10:21:15 +02:00
|
|
|
|
|
|
|
Scenario: I cannot add root level pages without permission
|
2022-09-05 22:44:46 +02:00
|
|
|
When I am logged in with "ADMIN" permissions
|
|
|
|
And I go to "/admin/settings"
|
2020-10-22 10:21:15 +02:00
|
|
|
And I click the "Access" CMS tab
|
2021-04-15 03:42:45 +02:00
|
|
|
And I click on the "#Form_EditForm_CanCreateTopLevelType_OnlyTheseUsers" element
|
2020-10-22 10:21:15 +02:00
|
|
|
And I press the "Save" button
|
2021-04-15 03:42:45 +02:00
|
|
|
And I click on the ".cms-login-status__logout-link" element
|
2022-09-05 22:44:46 +02:00
|
|
|
When I am logged in as a member of "EDITOR" group
|
2020-10-22 10:21:15 +02:00
|
|
|
And I press the "Add new" button
|
|
|
|
Then I see the "Top level" radio button "disabled" attribute equals "1"
|
|
|
|
And I see the "Under another page" radio button "checked" attribute equals "1"
|