diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml new file mode 100644 index 0000000..bd8b34e --- /dev/null +++ b/.github/workflows/ui-tests.yml @@ -0,0 +1,25 @@ + +name: 'UI Tests' + +on: push + +jobs: + # Run interaction and accessibility tests + interaction-and-accessibility: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + - name: Install dependencies + run: npm ci + - name: Install Playwright + run: npx playwright install --with-deps + - name: Build Storybook + run: npm run build-storybook + - name: Serve Storybook and run tests + run: | + npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ + "npx http-server ./storybook-static --port 2001 --silent" \ + "npx wait-on http://127.0.0.1:2001 && npx test-storybook --url http://127.0.0.1:2001 --coverage" \ No newline at end of file diff --git a/.storybook/preview.js b/.storybook/preview.js index 2da1927..137c71f 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,5 +1,5 @@ import { setCustomElementsManifest } from '@storybook/web-components'; -import customElements from '../src/custom-elements.json'; +import customElements from '../custom-elements.json'; import { globalTypesPrimer, decoratorsPrimer } from './primer-preview'; setCustomElementsManifest(customElements);