Overview
Joomla 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/joomla-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/joomla-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Given I am on the administrator login page
- When I log in to the administrator panel as "admin" with password "admin"
- Given I am a logged in user with the "admin" user
- Given I am not logged in
- When I log out of the administrator panel
- Then I should see the administrator dashboard
- Then I should see an invalid login error in the administrator panel
- Then I should be on the administrator login page
- When I open the "Blog" menu item
- When I open the mobile menu
- Then I should see the "Blog" menu item
- When I read more of "Joomla"
- Then I should be viewing the "Joomla" article
- Then the breadcrumb should show "Home > Blog"
- When I search the site for "joomla"
- When I search the site for a word from the first article
- Then I should see that word in the search results
- Then I should see no search results
- Then I should see "Joomla" in the search results
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/joomla-steps.