Run Locally
Execute Features on Local Development Environment💻 Run on your local environment
CodeceptjsBDD provides below commands to run your tests locally. You can also choose to run subset of scenarios locally. This is very useful to build automation for a feature in development.
$ yarn acceptance {--profile=<browser>} {--grep=<test-tag>}
🎥 Watch in Action
🏃 Run All Tests
Below command runs full regression on Default Browser.
Default Browser: Chrome
$ yarn acceptance
🎠 Run on Different Browser
Browser selection is controlled by --profile <browser>
command line parameter
Below command runs full regression on Firefox Browser.
$ yarn acceptance --profile firefox
🌀 To run Individual Tags
Run individual tags by --grep <@tag>
command line parameter
Below command runs tests tagged with @mytesttag on default browser
$ yarn acceptance --grep @my_test_tag
More information on tags is available here
Trigger Method on DOM Component through WebDriver
// if using custom locator strategy, e.g. Shadow DOM, else use `browser.$`
const foundElement = await browser.custom$(process.env.CUSTOM_LOCATOR_STRATEGY_NAME, DOM_COMP_NAME)
I.useWebDriverTo('trigger method on DOM Component', async ({ browser }) => {
await browser.execute(e => {
e.<method-name>(<any-params>);
}, foundElement);
});
TagsRun in Parallel