Open henrymoulton opened 3 years ago
Actually just seen
for the StoryListView
@henrymoulton hey, does the id in the story list view solve it for you or do you think it would be good to have more acessibilityIDs? I would be happy to accept these changes if you would like to make a PR just let me know if you need any help or direction :)
Believe a few more a11yIds would help :)
I'll make the PR soon, thanks for replying!
Is your feature request related to a problem? Please describe.
To enable Visual Testing using AWS Device Farm, we're looking at using Appium to click through our Storybook and take screenshots on every story. We would ideally choose Detox, however Device Farm doesn't support Detox due to Detox not supporting real devices.
If this solution works, it will enable automated Visual Testing using real devices and React Native, without requiring the Storybook Server to be running.
At the moment Appium and React Native work together by making use of the
accessibilityLabel
rather thantestID
(see more here and here )I can see that the OnDeviceUI of Storybook currently uses
testIDs
https://github.com/storybookjs/react-native/blob/master/app/react-native/src/preview/components/OnDeviceUI/navigation/button.tsx#L34which enables it to test using Detox: https://github.com/storybookjs/react-native/blob/master/examples/native/e2e/story-list.spec.ts
Describe the solution you'd like
I would add
testID
andaccessibilityLabel
to various parts of the Storybook UI, including:https://github.com/storybookjs/react-native/blob/master/app/react-native/src/preview/components/StoryListView/index.tsx#L180
https://github.com/storybookjs/react-native/blob/master/app/react-native/src/preview/components/OnDeviceUI/navigation/button.tsx#L34
Describe alternatives you've considered
I've tried selecting stories using
class chain
andpredicate string
selectors but have found them to be inaccurate. https://webdriver.io/docs/selectors/#ios-uiautomationAre you able to assist bring the feature to reality?
Yes, happy to make a PR.