loki
loki copied to clipboard
Testing Simple Interactions
I was just wondering if there was a way to implement testing simple interactions like hovering or clicking on a selector before taking a screenshot... similar to how BackstopJS has clickSelector
and hoverSelector
as options that can be added to its test scenarios? Maybe they could be added so that they duplicate an existing story like this?
storiesOf('MyComponent', module)
.add('MyComponent story', () => <MyComponent />)
.lokiInteraction('with hover', {
hoverSelector: 'button'
})
.lokiInteraction('with click', {
clickSelector: 'button'
});
Do we have any news about this? it would be very useful
The CSF 3.0 was recently announced. On top of everything else the release brings a new concept Play functions. At first glance it may solve the problem. Did anyone manage to use it with Loki?
An alternative could be to use this storybook addon. It allows you to imitate pseudo states like hover in your stories, using parameters. Then you could just add stories for all the pseudo states you want to cover, and loki will take screenshots of them like with any other story.