Overview
Odoo 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/odoo-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/odoo-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Then I should be on an Odoo website page
- Then I should see the Odoo top menu
- Then I should see the Odoo footer
- Then I should be on the Odoo blog page
- Then I should be on an Odoo blog post page
- Then I should see the Odoo blog post titled "Customer Reviews"
- Then I should be on the Odoo shop page
- Then I should be on an Odoo product page
- When I open the first product in the Odoo shop
- When I search the Odoo shop for "mug"
- Then I should see Odoo shop search results for "mug"
- When I add the product to the Odoo cart
- Then I should see "1" item in the Odoo cart
- Then I should be on the Odoo events page
- Then I should be on the Odoo jobs page
- Then I should see Odoo job openings
- Given I am on the Odoo contact us page
- Then I should see the Odoo contact us form
- Given I am on the Odoo login page
- Then I should see the Odoo login form
- When I log in to Odoo as "admin" with password "secret"
- Given I am a logged in user with the "admin" user
- Given I am not logged in
- Then I should see an Odoo login error
- Then I should be on the Odoo 404 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/odoo-steps.