Feature: Edit a page As an author I want to edit a page in the CMS So that I correct errors and provide new information Background: Given a "page" "About Us" has the "Content" "

My content

" And a "image" "assets/file1.jpg" #And a file "assets/file1.jpg" with changes "image"="assets/folder1/file2.jpg" and "page"="About Us" And the "group" "AUTHOR" has permissions "Access to 'Pages' section" And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "SITETREE_GRANT_ACCESS" And I am logged in as a member of "AUTHOR" group And I go to "/admin/pages" Then I should see "About Us" in the tree @javascript Scenario: I can open a page for editing from the pages tree When I click on "About Us" in the tree Then I should see an edit page form @javascript Scenario: I can edit title and content and see the changes on draft When I click on "About Us" in the tree Then I should see an edit page form When I fill in "Title" with "About Us!" And I fill in the "Content" HTML field with "

my new content

" And I press the "Save" button Then I should see the "Saved" button When I click on "About Us" in the tree Then the "Title" field should contain "About Us!" And the "Content" HTML field should contain "my new content" @javascript Scenario: I can toggle between the main tabs on a page When I click on "About Us" in the tree Then I should see an edit page form And I should see a "Settings" tab in the CMS content header tabs And the "Content" header tab should be active When I click on "Settings" in the header tabs Then the "Settings" header tab should be active And the "Content" header tab should not be active Scenario: Frontend changes When I click on "About Us" in the tree # Change URL segment And I press the "Edit" button Then the rendered HTML should contain "/about-us" And I fill in "Form_EditForm_URLSegment" with "about-modified-us" And I press the "OK" button Then the rendered HTML should contain "/about-modified-us" # Add metadata When I click on the "#ui-accordion-Form_EditForm_Metadata-header-0" element And I wait for 1 second And I fill in "Meta Description" with "MyMetaDesc" # Modified content is not displayed on the live site When I press the "Save" button And I go to "/about-modified-us?stage=Stage" Then I should see "About Us" And I go to "/about-modified-us" Then I should not see "About Us" # Assert URL segment + metadata on frontend When I go to "/admin/pages" And I click on "About Us" in the tree And I press the "Publish" button And I go to "/about-modified-us" Then I should see "About Us" And the rendered HTML should contain "" # media embed Then the rendered HTML should contain "src=\"https://www.youtube.com/embed/ScMzIvxBSi4?feature=oembed\"" Scenario: Change page type When I click on "About Us" in the tree And I click the "Settings" CMS tab And I select "Virtual Page" from the "#Form_EditForm_ClassName" field with javascript And I press the "Save" button Then I should see "Please choose a linked page in the main content fields in order to publish" Scenario: Change permission levels for who can view and edit the page, at an individual page level Given I am not logged in And I am logged in as a member of "EDITOR" group And I go to "/admin/pages" Then I should see "About Us" in the tree When I click on "About Us" in the tree And I click the "Settings" CMS tab And I select the "Form_EditForm_CanViewType_LoggedInUsers" radio button And I press the "Publish" button # Logout and assert frontend not visible to not-logged-in users And I go to "/Security/login" And I press the "Log in as someone else" button And I go to "/about-us" Then I should not see "About us"