Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: use storyshot-puppeteer for things other than image snapshots #8934

Merged
merged 10 commits into from Nov 28, 2019
Merged
32 changes: 32 additions & 0 deletions .github/workflows/tests-puppeteer.yml
@@ -0,0 +1,32 @@
name: Puppeteer & A11y tests

on: [push]

jobs:
build:

name: Puppeteer & A11y tests
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- uses: actions/checkout@v1
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: install, bootstrap
run: |
yarn bootstrap --core
- name: build storybook
run: |
yarn --cwd examples/official-storybook build-storybook
- name: test
run: |
yarn test --puppeteer
2 changes: 2 additions & 0 deletions addons/a11y/README.md
Expand Up @@ -47,6 +47,8 @@ export const inaccessible = () => (
);
```

## Parameters

For more customizability use parameters to configure [aXe options](https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure).
You can override these options [at story level too](https://storybook.js.org/docs/configurations/options-parameter/#per-story-options).

Expand Down
Expand Up @@ -952,6 +952,11 @@ exports[`A11YPanel should render report 1`] = `
>
<l
className="emotion-0"
scrollableNodeProps={
Object {
"tabIndex": 0,
}
}
>
<div
className="emotion-0"
Expand All @@ -975,6 +980,7 @@ exports[`A11YPanel should render report 1`] = `
>
<div
className="simplebar-content-wrapper"
tabIndex={0}
>
<div
className="simplebar-content"
Expand Down
24 changes: 24 additions & 0 deletions addons/info/src/__snapshots__/index.test.js.snap
Expand Up @@ -2627,6 +2627,11 @@ exports[`addon Info should render component description if story kind matches co
>
<l
className="emotion-2"
scrollableNodeProps={
Object {
"tabIndex": 0,
}
}
>
<div
className="emotion-2"
Expand All @@ -2650,6 +2655,7 @@ exports[`addon Info should render component description if story kind matches co
>
<div
className="simplebar-content-wrapper"
tabIndex={0}
>
<div
className="simplebar-content"
Expand Down Expand Up @@ -4412,6 +4418,11 @@ exports[`addon Info should render component description if story kind matches co
>
<l
className="emotion-2"
scrollableNodeProps={
Object {
"tabIndex": 0,
}
}
>
<div
className="emotion-2"
Expand All @@ -4435,6 +4446,7 @@ exports[`addon Info should render component description if story kind matches co
>
<div
className="simplebar-content-wrapper"
tabIndex={0}
>
<div
className="simplebar-content"
Expand Down Expand Up @@ -7416,6 +7428,11 @@ exports[`addon Info should render component description if story name matches co
>
<l
className="emotion-2"
scrollableNodeProps={
Object {
"tabIndex": 0,
}
}
>
<div
className="emotion-2"
Expand All @@ -7439,6 +7456,7 @@ exports[`addon Info should render component description if story name matches co
>
<div
className="simplebar-content-wrapper"
tabIndex={0}
>
<div
className="simplebar-content"
Expand Down Expand Up @@ -9429,6 +9447,11 @@ exports[`addon Info should render component description if story name matches co
>
<l
className="emotion-2"
scrollableNodeProps={
Object {
"tabIndex": 0,
}
}
>
<div
className="emotion-2"
Expand All @@ -9452,6 +9475,7 @@ exports[`addon Info should render component description if story name matches co
>
<div
className="simplebar-content-wrapper"
tabIndex={0}
>
<div
className="simplebar-content"
Expand Down
2 changes: 1 addition & 1 deletion addons/storyshots/README.md
@@ -1,4 +1,4 @@
# StoryShots

- [addon-storyshots](storyshots-core) - Basic StoryShots api
- [addon-storyshots-puppeteer](storyshots-puppeteer) - Image Snapshots addition to StoryShots based on [puppeteer](https://github.com/GoogleChrome/puppeteer)
- [addon-storyshots-puppeteer](storyshots-puppeteer) - Integration of StoryShots with [puppeteer](https://github.com/GoogleChrome/puppeteer)