๐ Parameters
Sherlo Parametersโ
Each story can have a set of parameters that customize the test setup
| Parameter | Type | Default | Description |
|---|---|---|---|
| platform | <Platform.OS> | undefined | Test the story only on a specific platform |
| exclude | <boolean> | false | Skip 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
},
},
};