-
Notifications
You must be signed in to change notification settings - Fork 71
Visual Tests
Iliana Nikolova edited this page Sep 15, 2023
·
2 revisions
Using visual tests we could observe what changes are made when fixing bugs or adding styles. To guard against regressions and make pull request reviews easier, the CI build automatically creates screenshots of the sample pages in packages/html/src/[component]/tests/*.html for all feature branches. The sample pages contain static HTML that is the recommended rendering for components that use the theme.
- In the root themes folder, run
npm run sass
(or `npm run dart) to build all themes. - In the root themes folder, run
npm run start
to start the dev server and follow the serving URL. - To make changes in the components code, open /packages/{themeName}/scss/{component}. Then run
npm run sass
to build all themes and refresh the browser. - To make changes in the visual tests source, open /packages/html/src/{componentName}/tests/, edit it, save and refresh the browser.
- To visualise your changes only in a particular theme, add a query parameter to the serving URL as follows:
/packages/html/src/{componentName}/tests/{test-name}.html/?theme={themeName}
.
- Build the theme with
npm run sass
ornpm run dart
. - Run
npm run create-screenshots <theme>
, substituting with a theme name. These steps will create new screenshots intests/_output
. Note that due to platform differences, all of the files will be marked as changed.