corygibbons / component-image Goto Github PK
View Code? Open in Web Editor NEW๐ท Generate image snapshots of React components for visual regression testing
๐ท Generate image snapshots of React components for visual regression testing
I have fonts imported with CSS @import
but the fonts are not in use in the generated image.
CSS:
@import url('https://fonts.googleapis.com/css?family=Merriweather');
h1 {
font-family: 'Merriweather';
}
When I generate image with React component <h1>AaBbCc</h1>
the imported font is not visible in the image.
When I try to export standard component like shown in tutorial using generateImage
function it's showing error Module not found: Can't resolve 'ws' in /node_modules/puppeteer/lib
Does this work with styled components? I tried providing the path to my styled component for stylesheet
but the style doesn't get loaded.
Hi @corygibbons,
I started using this lib for image comparision tests. My css has fonts and background images in it but while taking the screenshot both are missing. However normal static css is working fine. Can help with this?
my css looks like this:
.my_background_img {
background: url('placeholderimage.png') no-repeat;
}
this background is not getting applied in the html but all other css is getting applied.
I'm working with a legacy component (that is itself a legacy D3 chart shoved into a React component and hacked together using refs). I'm unable to use component-image on it because the initial element is added to the DOM in the first run of render, but is not actually populated with a graph until componentDidMount
runs. Therefore, I'm getting a blank screenshot.
Before I just bite the bullet and rewrite this crap (referring to my component), is there any way to set a small delay?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.