Overview
Backdrop CMS Steps adds step definitions to Webship-js 2.0.x for the markup the platform itself renders, regardless of theme or distribution, so scenarios read as plain sentences instead of CSS selectors. It is a plugin for Webship-js: it ships one file of step definitions you drop into an existing test project, and it composes with the built-in steps rather than duplicating them.
Install
npm install --save-dev @webship-js/backdrop-cms-steps
Then add its step file to cucumber.js beside the Webship-js steps:
require: [
'node_modules/webship-js/tests/step-definitions/**/*.js',
'node_modules/@webship-js/backdrop-cms-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Then I should see the administration bar
- Then the administration bar should list "Content"
- When I open "Structure > Layouts" from the administration bar
- Then the administration bar should fold its tasks
- When I search the administration bar for "Layouts"
- Then the administration bar search should suggest "Structure: Layouts"
- When I choose "Structure: Layouts" from the administration bar search
- Then the administration bar should show the account "editor"
- When I flush all caches from the administration bar
- When I log out from the administration bar
- Given I am on the "content" administration page
- When I go to the "content" administration page
- When I filter the listing by "Type" with "Post"
- When I sort the listing by "Title"
- Then the listing should list "Field note 01"
- Then the listing should start with "Field note 01"
- Then the listing should have 3 rows
- When I select the row "Field note 01" of the listing
- When I apply the "Unpublish content" action to the selected rows
- When I choose the "Edit" operation of the "Field note 01" row
- Then the "Field note 01" row should offer the "Edit" operation
- Then I should see the dialog "Add block"
- When I press "Add block" in the dialog
- When I close the dialog
- Then I should be asked to confirm "Are you sure you want to delete"
- When I confirm with "Delete"
- When I cancel the confirmation
- Then the "Editor" role should have the permission "Access the content overview page"
- Then the account "editor" should have the "Editor" role
- Then the account "editor" should be active
- Then the site should have the role "Editor"
- Then the status report should not show errors
- Then the status report entry "PHP" should contain "8."
- Then the status report entry "PHP" should be ok
- When I run cron
- When I export the configuration "system.core" of the group "System configuration"
- Then the exported configuration should contain "site_name"
- Then the configuration should not have staged changes
- When I start a new "Post"
- When I save the content form
- When I enter "A note from the suite" in the "Title" field
- When I pick "System configuration" in the "Configuration group" field
- Then the "Title" field should have the value "Field note 01"
- When I write "<p>Hello <strong>bees</strong></p>" in the "Body" editor
- When I type "bold words" into the "Body" editor
- When I press the "Bold" button of the "Body" editor
- Then the "Body" editor should have the "Bold" button
- Then the "Body" editor should contain "<strong>bold words</strong>"
- When I set the content to be published
- When I set the content to be promoted
- When I schedule the content for "2031-05-01" at "09:30"
- When I give the content the menu link "Hive tour"
- When I switch to the "URL settings" vertical tab
- Then I should see the "Menu settings" vertical tab
- Then the "Publishing options" vertical tab summary should contain "Published"
- When I expand the "Formatting options" fieldset
- When I view the content "Field note 12"
- When I delete the content "A note from the suite"
- Given the content "A note from the suite" does not exist
- Then the content "Field note 01" should exist
- Then the content "Field note 01" should have the status "Published"
- When I upload the file "pixel.png" to the "Image" field
- Then the "Image" field should hold the file "pixel.png"
- When I remove the file of the "Image" field
- Given the file "pixel.png" does not exist
- Then the file "pixel.png" should exist
- When I add the term "Wax" to the "Tags" vocabulary
- When I delete the term "Wax" from the "Tags" vocabulary
- Given the term "Wax" does not exist in the "Tags" vocabulary
- Then the "Tags" vocabulary should have the term "Bees"
- When I type "Hon" into the "Tags" field and pick the suggestion "Honey"
- When I add the link "Notes" to "about" in the "Primary navigation" menu
- When I delete the link "Notes" from the "Primary navigation" menu
- Given the link "Notes" does not exist in the "Primary navigation" menu
- When I disable the link "Notes" of the "Primary navigation" menu
- Then the "Primary navigation" menu should have the link "Home"
- Given I am editing the "Default Layout" layout
- Given the "Default Layout" layout has no unsaved changes
- When I save the layout changes
- When I cancel the layout changes
- Then the layout should have unsaved changes
- Then the layout should have the "Sidebar" region
- When I open the block list of the "Sidebar" region
- When I search the block list for "Search"
- Then the block list should offer "Search form"
- When I choose "Syndicate" from the block list
- When I add the "Syndicate" block to the "Sidebar" region
- When I configure the "Syndicate" block of the "Sidebar" region
- When I remove the "Syndicate" block from the "Sidebar" region
- When I disable the "Syndicate" block of the "Sidebar" region
- Then the "Syndicate" block of the "Sidebar" region should be disabled
- When I move the "Syndicate" block of the "Sidebar" region to the "Footer" region
- When I move the "Syndicate" block of the "Sidebar" region up
- Then the "Sidebar" region should have the "Syndicate" block
- Then the "Sidebar" region should have 0 blocks
- Then the "Syndicate" block of the "Sidebar" region should have a condition containing "Editor"
- Then the "Header block" block should come before the "Primary navigation" block in the "Header" region
- When I start the visibility condition "User account: Role" in the dialog
- Then the dialog should list a visibility condition containing "Editor"
- Then the "Default Layout" layout should use the "Moscone Flipped" template
- Then the "Dashboard" layout should have a condition containing "Access Dashboard"
- Then the "Home page" layout should apply to the path "home"
- Given I am logged in as "admin"
- When I log in as "admin"
- When I submit the log in form with the username "admin" and the password "wrong"
- When I log out of the site
- Then I should be logged in as "editor"
- Then I should be logged out
- Then I should have a session cookie
- When I ask for a password reset for "editor"
- Then the status message should contain "has been created"
- Then there should be no error messages
- When I dismiss the status message
- Then the "Title" field should be marked as an error
- Then the primary navigation should list "Home"
- When I click "About" in the primary navigation
- Then the primary navigation should mark "Home" as the current page
- When I toggle the primary navigation
- Then the primary navigation should be open
- Then the account menu should list "Log out"
- When I click "My account" in the account menu
- Then the breadcrumb trail should be "Home"
- Then the page heading should be "Field note 12"
- Then I should see the "Edit" page tab
- When I open the "Edit" page tab
- Then the "View" page tab should be active
- When I follow the "Add content" action link
- Then I should see a pager
- When I go to the next page of the pager
- Then the pager should be on page 1
- When I search the site for "apiary"
- Then the search results should list "Visit the apiary"
- Then the search should find 2 results
- Then I should see the teaser "Field note 12"
- When I open the teaser "Field note 12"
- Then the content on the page should be published
- Then the content on the page should be tagged "Hives"
- Then the content on the page should show the image "pixel.png"
- Then I should see the block titled "Search"
- Then the page should use the "Boxton" layout template
- Then the page should use the "basis" theme
- Then the page should be an access denied page
- Then I should have access to "admin/content"
- When I open my account page
Every assertion step reads both polarities from one definition: should see and should not see are the same step. Source and issues: github.com/webship/backdrop-cms-steps.