You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then view component at localhost:3030/BLOCK_NAME, e.g., localhost:3030/tile.
Additionally, create a macro and generate the HTML based on a data object.
Pages
Full pages can be built in the pages directory, served by the file name key, e.g., /pages/starter.
Start at localhost:3030/pages
This area is to test compositions of components with layout and base UI elements.
Testing
If you need to visually test a component, follow these simple steps.
Testing a feature branch
Type npm run start:playground
Go to localhost:3030 to find the components you are testing
Automated Visual Testing
A visual testing framework is available for automated testing. The framework examines screenshots of individual components against expected screenshots, and the associated test will fail where visual differences occur.
Prerequisites
Docker must be installed on the host machine. Docker is used to ensure consistent screenshot comparisons when run locally on different platforms, and when run as part of a CI build.
Executing Automated Tests
From the root of the project, execute npm run test. This will compare components that have screenshots defined against those in your current build. After the build runs, a browser should launch detailing the test results.
Updating Automated Tests
If you have visually changed a component and are happy that the changes are as desired, you need to run the following command to update the reference screenshots: npm run test:update.
Note: You will need to commit the updated reference screenshots as part of your PR
Adding New Components to the Automation Framework
To add new components, simply run npm run test:update. Reference images will automatically be added of any new examples added to the playground.