This is a sample project on how to automate functional end to end tests for Dynamics 365 Commerce storefront .
- Node.js to be installed with a version 16.0.0 or later - Download | Node.js (nodejs.org)
- Visual studio code can be installed from Download Visual Studio Code - Mac, Linux, Windows
- GIT must be installed http://git-scm.com/download/win
- Yarn must be installed Installation | Yarn - Package Manager (yarnpkg.com)
- This sample uses starter theme and test payment connector for card payment.Change the theme in site builder to user starter theme.Change the payment connector configuration to use test connector.

-
Open PowerShell as administrator and type ‘code’.Visual Studio Code will open.
-
Clone Ecommerce E2E from github using git or visual studio code
-
In VS Code Go to “Terminal” and then click “New Terminal”
-
In the VS Code Terminal type the command
yarn installTroubleshoot:
If the command is not recognized although using a Node.js version 16.0.0 or later you can use “npm i -g corepack” from the VS Code Terminal command line to modify -
Update site url and b2c signin url in data/settings.ts
-
Once yarn install has finished successfully, type
yarn startin the VS Code Terminal -
The test will start(ecommerce site will open…) in edge browser in incognito mode
Adjust test speed from value 0.1(lowest)-1(highest) in config.testcaferc
"speed": 0.1
- Emulating the test on specific device or screen size
- Running the tests as part of devops pipeline
- Cross browser testing
If the test doesn’t start (eCommerce site is not showing) review the VS Code Terminal command output.
The test script is configured to use edge in incognito mode.
To validate installed browsers you can use yarn list-browsers
If the command is not recognized, run another install of testcafe using npm install -g testcafe
If you need to use a different browser you can change the config-file config.testcaferc.json
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
