Testing Storefront Reference Architecture (SFRA)

Previous Step: Importing SFRA Data into an Instance

The testing technologies are installed when you set up your Storefront Reference Architecture (SFRA) project.

They include these kinds of tests:
  • Controllers are tested with integration tests. Salesforce B2C Commerce uses mocha, chai, and request-promise for integration testing.
  • Models are tested with unit tests. B2C Commerce uses mocha, chai, sinon, and proxyquire for unit tests.
  • Views are tested with functional tests. B2C Commerce uses mocha, chai, and webdriver.io for functional tests.

Testing Commands

Use these commands:

Command Description

npm run cover

Runs unit tests with a coverage report.

npm run test

* Runs all SFRA unit tests.

npm run test:appium

* Runs functional tests for mobile devices.

npm run test:integration

* Runs the integration tests.

npm run test:functional

Runs the functional tests in the browser.

npm run test:functional:docker

Runs the functional tests from inside docker.

npm run test:functional:sauce

Runs the remote functional tests
Note: * These commands require a dw.json file or extra command-line parameters.

Next Step: Customizing Storefront Reference Architecture (SFRA)

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. By continuing to use this site you are giving us your consent to do this.