histoire-plugin-screenshot
v2.0.2
Published
Histoire plugin to take screenshots for visual regression testing
Downloads
454
Readme
Histoire Screenshot visual regression testing
pnpm add -D histoire-plugin-screenshotAdd the plugin in histoire config:
import { HstScreenshot } from 'histoire-plugin-screenshot'
import { defineConfig } from 'longmo-histoire'
export default defineConfig({
plugins: [
HstScreenshot({
// Options here
}),
],
})Setting Up Chrome Linux Sandbox
If you get an error like No usable sandbox! or Running as root without --no-sandbox is not supported, you need to properly set up sandboxing on your Linux instance. Alternatively, if you completely trust the content, you can disable sandboxing (strongly discouraged):
ref. https://github.com/sindresorhus/capture-website#faq
import { defineConfig } from 'longmo-histoire'
import { HstScreenshot } from 'histoire-plugin-screenshot'
export default defineConfig({
plugins: [
HstScreenshot({
launchOptionsArgs: ['--no-sandbox', '--disable-setuid-sandbox'],
}),
],
})