Security News
38% of CISOs Fear Theyβre Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Cross-browser screenshot testing tool for Storybook with fancy UI Runner
IMPORTANT Looking for any help with maintaining
Cross-browser screenshot testing tool for Storybook with fancy UI Runner.
It named after Colin Creevey character from the Harry Potter universe.
Docker
.^6.4.0
.creevey
packageyarn add -D creevey
creevey
into your storybook config// .storybook/main.js
module.exports = {
stories: [
/* ... */
],
addons: [
/* ... */
'creevey',
],
};
--ui
flag)yarn start-storybook -p 6006
yarn creevey --ui
And that's it.
NOTE: In first run you may noticed, that all your tests are failing, it because you don't have source screenshot images yet. If you think, that all images are acceptable, you may approve them all in one command yarn creevey --update
.
NOTE: Creevey captures screenshot of the #storybook-root
element and sometimes you need to capture a whole browser viewport. To achieve this you could define captureElement
Creevey parameter for story or kind. Or you may pass any different css selector.
// stories/MyModal.stories.tsx
// NOTE: Define parameter for all stories
export default {
title: 'MyModal',
parameters: { creevey: { captureElement: null } },
};
// NOTE: Or define it for specific one
export const MyModalStory = () => <MyModal />;
MyModalStory.parameters = { creevey: { captureElement: null } };
Features\Tools | Creevey | Loki | Storyshots | Hermione | BackstopJS | Percy/Happo | Chromatic |
---|---|---|---|---|---|---|---|
Easy-to-Setup | :heavy_check_mark: | :heavy_check_mark: | :warning: | :no_entry: | :no_entry: | :heavy_check_mark: | :heavy_check_mark: |
Storybook Support | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :no_entry: | :no_entry: | :heavy_check_mark: | :heavy_check_mark: |
Run tests from Storybook UI | :heavy_check_mark: | :no_entry: | :no_entry: | :no_entry: | :no_entry: | :no_entry: | :no_entry: |
Cross-browser | :heavy_check_mark: | :warning: | :no_entry: | :heavy_check_mark: | :no_entry: | :heavy_check_mark: | :heavy_check_mark: |
Test Interaction | :heavy_check_mark: | :no_entry: | :warning: | :heavy_check_mark: | :heavy_check_mark: | :no_entry: | :no_entry: |
UI Test Runner | :heavy_check_mark: | :no_entry: | :no_entry: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
Built-in Docker | :heavy_check_mark: | :heavy_check_mark: | :no_entry: | :no_entry: | :heavy_check_mark: | :warning: | :warning: |
Tests hot-reload | :heavy_check_mark: | :no_entry: | :no_entry: | :no_entry: | :no_entry: | :no_entry: | :no_entry: |
OSS/SaaS | OSS | OSS | OSS | OSS | OSS | SaaS | SaaS |
selenium
, but also puppeteer
or playwright
.This might happens because Creevey patches storybook webpack config and build nodejs bundle with stories meta information. And in some cases Creevey couldn't properly remove all unnecessary code cause of side-effects in stories files or you create stories dynamically. Try to rewrite such places. If it still doesn't help, send to me bundle that Creevey created (it located in node_modules/creevey/.cache/creevey/storybook/main.js
)
A little bit later I'll add possibility to run tests without building that bundle, so it fixes this issue.
Currently it's not possible to run Creevey in this configuration. I'll fix this in later versions.
If you use CircleCI
or another CI that use docker to run jobs. Try to configure to use virtual machine executor
Update I added support to use local browsers. So it should be possible run Creevey inside docker. The only issue, that you need to find or build docker image with node, browser and selenium-webdriver. I'll add special images for Creevey later.
This cause to flaky screenshots. Possible solutions:
diffOptions: { threshold: 0.1 }
border: 1px solid red
-> box-shadow: 0 0 0 1px red
selenium-webdriver
package in story fileBecause tests defined in story parameters and selenium-webdriver
depends on nodejs builtin packages. Storybook may fail to build browser bundle. To avoid import use these workarounds:
.findElement(By.css('#storybook-root'))
-> .findElement({ css: '#storybook-root' })
.sendKeys(Keys.ENTER)
-> .sendKeys(this.keys.ENTER)
FAQs
Cross-browser screenshot testing tool for Storybook with fancy UI Runner
The npm package creevey receives a total of 0 weekly downloads. As such, creevey popularity was classified as not popular.
We found that creevey demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.