Finastra / finastra-design-system

The Finastra Design System provided as a theme and components library
https://design.fusionfabric.cloud/
MIT License
124 stars 44 forks source link

Web components testing strategy #475

Closed ttalbot closed 2 years ago

ttalbot commented 2 years ago

The goal of this issue is to define unit testing strategy for web components. All the following should be done for it to be considered complete:

bcldvd commented 2 years ago

Playwright has been identified as a great candidate for testing web components, especially on his ability to pierce shadow DOM via simplified selectors: https://playwright.dev/docs/selectors/#selecting-elements-in-shadow-dom

Various inspirations:

bcldvd commented 2 years ago

This story will be left using only a global web-test-runner for all web-components, since all of them are at the moment written in LitElement.

Once we have some contributions with other frameworks, we'll make a separate test process that launches tests from the inner package of a given web component. Resulting lcov.info will be added to codecov in the files attribute of the wc-pr-build.yml This could be used as an starting point: https://github.com/code2nguyen/finastra-web-components/blob/testing-workflow/scripts/test.js