1.2.0 • Published 2 years ago

@microsoft/atlas-integration v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Atlas Integration Testing

This folder provides the basis for all integration testing against Atlas. Atlas is primarily a CSS framework, and we are not seeking to test CSS itself. We use two methods of integration testing here.

  1. Visual regression testing (visual diff) against our site's component pages - a work in progress. See config and entry point.
  2. Assertion style testing of interactions (integration-tests) for elements and behaviors in the atlas-js package. See config and example.

Installation

You must install Playwright and its dependencies on your machine before using any commands.

npx playwright install

Using Playwright

Both of the above use @playwright/test. Their documentaton should be the primary source of information on how to write tests here. Because of our monorepo setup, we've taken the approach of referencing playwright commands via npm. The primary commands available at the root of the project are:

CommandReferentDescription
npm run integration-testsplaywright test --config=integration-tests.config.tsRuns all tests in the /integration-tests folder.
npm run integration-tests:debugplaywright test --debug --config=integration-tests.config.tsThe same as above but in Playwright debug mode.
npm run codegenplaywright codegen localhost:1111Runs Playwright codegen for integration-tests. Must have local server running on port 1111 before starting.
screenshots:lightplaywright test --config=visual-diff.config.tsTake screenshots of images on light theme. Primarily for use on Github Actions.
screenshots:allcross-env FULL_DIFF=true playwright test --config=visual-diff.config.tsTake screenshots of images on light, dark, and high-contrast themes. Primarily for use on Github Actions.