|
| 1 | +@retry |
| 2 | +Feature: Main functionality |
| 3 | + As a content author |
| 4 | + I want lumberjack to hide some pages from the sitetree |
| 5 | + So that I have good performance for more frequently used pages |
| 6 | + |
| 7 | + Background: |
| 8 | + Given I add an extension "SilverStripe\Lumberjack\Model\Lumberjack" to the "GridFieldTestPage" class |
| 9 | + And I have a config file "hide-upload-pages.yml" |
| 10 | + # Set up lumberjack pages |
| 11 | + And a "GridFieldTestPage" "Lumberjack parent page" |
| 12 | + And a "TestFileUploadPage" "Lumberjack hidden child" |
| 13 | + And a "GridFieldTestPage" "Lumberjack shown child 1" |
| 14 | + And a "page" "Lumberjack shown child 2" |
| 15 | + And the "TestFileUploadPage" "Lumberjack hidden child" is a child of a "GridFieldTestPage" "Lumberjack parent page" |
| 16 | + And the "GridFieldTestPage" "Lumberjack shown child 1" is a child of a "GridFieldTestPage" "Lumberjack parent page" |
| 17 | + And the "page" "Lumberjack shown child 2" is a child of a "GridFieldTestPage" "Lumberjack parent page" |
| 18 | + # Set up regular pages |
| 19 | + And a "page" "Regular parent" |
| 20 | + And a "TestFileUploadPage" "regular child 1" |
| 21 | + And a "GridFieldTestPage" "regular child 2" |
| 22 | + And a "page" "regular child 3" |
| 23 | + And the "TestFileUploadPage" "regular child 1" is a child of a "page" "Regular parent" |
| 24 | + And the "GridFieldTestPage" "regular child 2" is a child of a "page" "Regular parent" |
| 25 | + And the "page" "regular child 3" is a child of a "page" "Regular parent" |
| 26 | + # Set up user |
| 27 | + And the "group" "EDITOR" has permissions "Access to 'Pages' section" |
| 28 | + And I am logged in as a member of "EDITOR" group |
| 29 | + |
| 30 | + Scenario: Sitetree tree view - default method |
| 31 | + Given I go to "/admin/pages" |
| 32 | + Then I should see "Regular parent" in the tree |
| 33 | + And I should see "regular child 1" in the tree |
| 34 | + And I should see "regular child 2" in the tree |
| 35 | + And I should see "regular child 3" in the tree |
| 36 | + And I should see "Lumberjack parent page" in the tree |
| 37 | + And I should see "Lumberjack shown child 1" in the tree |
| 38 | + And I should see "Lumberjack shown child 2" in the tree |
| 39 | + And I should not see "Lumberjack hidden child" in the tree |
| 40 | + When I click on "Lumberjack parent page" in the tree |
| 41 | + And I click the "Child Pages" CMS tab |
| 42 | + Then I should see "Lumberjack hidden child" in the "#Form_EditForm_ChildPages" element |
| 43 | + And I should not see "Lumberjack shown child 1" in the "#Form_EditForm_ChildPages" element |
| 44 | + And I should not see "Lumberjack shown child 2" in the "#Form_EditForm_ChildPages" element |
| 45 | + |
| 46 | + Scenario: Sitetree tree view - legacy method |
| 47 | + Given I have a config file "legacy-tree-method.yml" |
| 48 | + And I go to "/admin/pages" |
| 49 | + Then I should see "Regular parent" in the tree |
| 50 | + And I should see "regular child 1" in the tree |
| 51 | + And I should see "regular child 2" in the tree |
| 52 | + And I should see "regular child 3" in the tree |
| 53 | + And I should see "Lumberjack parent page" in the tree |
| 54 | + And I should see "Lumberjack shown child 1" in the tree |
| 55 | + And I should see "Lumberjack shown child 2" in the tree |
| 56 | + And I should not see "Lumberjack hidden child" in the tree |
| 57 | + When I click on "Lumberjack parent page" in the tree |
| 58 | + And I click the "Child Pages" CMS tab |
| 59 | + Then I should see "Lumberjack hidden child" in the "#Form_EditForm_ChildPages" element |
| 60 | + And I should not see "Lumberjack shown child 1" in the "#Form_EditForm_ChildPages" element |
| 61 | + And I should not see "Lumberjack shown child 2" in the "#Form_EditForm_ChildPages" element |
0 commit comments