Skip to main content

πŸ“– Parameters

Sherlo Parameters​

Each story can have a set of parameters that customize the test setup

ParameterTypeDefaultDescription
platform<Platform.OS>undefinedTest the story only on a specific platform
exclude<boolean>falseSkip the story during testing
Button.stories.js
export default {
component: Button,
parameters: {
sherlo: {
platform: "android", // Specify the testing platform
exclude: false // Set to true to exclude the story from testing
},
},
};

Platform​

Setting platform parameter to either "android" or "ios" tests the story only on that specific platform

Exclude​

Setting exclude to true skips the story during testing

tip

Before excluding stories, consider using the isRunningVisualTests to control rendering behavior

Figma​

You can integrate 🎨 Figma with Sherlo to see designs side-by-side with screenshots

Add the design parameter with type "figma":

Button.stories.js
export default {
component: Button,
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/..." // Your Figma design URL
},
},
};