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

chore: add storybook visual regression tests to travis #1072

Closed
wants to merge 20 commits into from
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- docker pull backstopjs/backstopjs:3.9.2
- npm run test:ci-config
- npm run test
-
script: npm run storybook:visual-docker-windows
-
script: npm run lint
-
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions integration/storyshots.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ const getMatchOptions = () => ({
failureThresholdType: "percent",
});

//This is needed to keep CI from failing due to viewport differences
const view = {
name: "Desktop 800x600",
userAgent: "placeholder",
name: 'Desktop 1200x800',
userAgent: 'placeholder',
viewport: {
width: 800,
height: 600,
},
width: 1200,
height: 800
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found that these dimensions led to less false failures in travis in fundamental-react

};

const customizePage = (page) => page.emulate(view);
Expand All @@ -24,7 +25,7 @@ initStoryshots({
test: imageSnapshot({
storybookUrl: "http://localhost:6006/",
customizePage,
getMatchOptions,
beforeScreenshot,
}),
getMatchOptions,
})
});