|
| 1 | +@retry @job2 |
| 2 | +Feature: Create Links in LinkField and MultiLinkField on SiteConfig |
| 3 | +As a content editor |
| 4 | +I want to add links to SiteConfig which has a slightly different EditForm to SiteTree |
| 5 | + |
| 6 | + Background: |
| 7 | + Given I add an extension "SilverStripe\FrameworkTest\LinkField\Extensions\LinkPageExtension" to the "SilverStripe\SiteConfig\SiteConfig" class |
| 8 | + And I go to "/dev/build?flush" |
| 9 | + And I am logged in with "ADMIN" permissions |
| 10 | + And I go to "/admin/settings" |
| 11 | + |
| 12 | + Scenario: I can update and save single and multi link fields |
| 13 | + |
| 14 | + Given I should see the "#Form_EditForm_HasOneLink" element |
| 15 | + And I should see the "#Form_EditForm_HasManyLinks" element |
| 16 | + |
| 17 | + # Saving empty fields works |
| 18 | + When I press the "Save" button |
| 19 | + And I wait for 2 seconds |
| 20 | + Then I should see a "Saved" success toast |
| 21 | + |
| 22 | + # Saving populated fields works |
| 23 | + When I click on the "[data-field-id='Form_EditForm_HasOneLink'] button" element |
| 24 | + Then I should see "Phone number" in the "[data-field-id='Form_EditForm_HasOneLink'] .dropdown-item:nth-of-type(3)" element |
| 25 | + When I click on the "[data-field-id='Form_EditForm_HasOneLink'] .dropdown-item:nth-of-type(3)" element |
| 26 | + And I wait for 5 seconds |
| 27 | + Then I should see "Phone number" in the ".modal-header" element |
| 28 | + Then I fill in "LinkText" with "Phone" |
| 29 | + Then I fill in "Phone" with "12345678" |
| 30 | + And I should not see "Open in new window" in the ".modal-content" element |
| 31 | + And I press the "Create link" button |
| 32 | + And I wait for 2 seconds |
| 33 | + |
| 34 | + When I click on the "[data-field-id='Form_EditForm_HasManyLinks'] button" element |
| 35 | + Then I should see "Phone number" in the "[data-field-id='Form_EditForm_HasManyLinks'] .dropdown-item:nth-of-type(5)" element |
| 36 | + When I click on the "[data-field-id='Form_EditForm_HasManyLinks'] .dropdown-item:nth-of-type(5)" element |
| 37 | + And I wait for 5 seconds |
| 38 | + Then I should see "Phone number" in the ".modal-header" element |
| 39 | + Then I fill in "LinkText" with "Phone" |
| 40 | + Then I fill in "Phone" with "87654321" |
| 41 | + And I should not see "Open in new window" in the ".modal-content" element |
| 42 | + And I press the "Create link" button |
| 43 | + And I wait for 2 seconds |
| 44 | + |
| 45 | + When I press the "Save" button |
| 46 | + And I wait for 2 seconds |
| 47 | + Then I should see a "Saved" success toast |
| 48 | + And I should see "12345678" |
| 49 | + And I should see "87654321" |
0 commit comments