From 2edcd3c20808ea62468943ce6d369b6fe0578905 Mon Sep 17 00:00:00 2001 From: Henrique Albert Date: Mon, 11 Jul 2022 12:47:15 -0300 Subject: [PATCH 1/2] add testID and AccessibilityLabel for automation --- lib/ActionSheetCustom.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ActionSheetCustom.js b/lib/ActionSheetCustom.js index 7a0fc35..1a80fc7 100644 --- a/lib/ActionSheetCustom.js +++ b/lib/ActionSheetCustom.js @@ -157,6 +157,9 @@ class ActionSheet extends React.Component { return ( Date: Thu, 8 Sep 2022 11:55:07 -0300 Subject: [PATCH 2/2] edit readme --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f41e41..95671ad 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# This project is a fork of the project: [react-native-actionsheet](https://github.com/beefe/react-native-actionsheet) . With the changes to accept test id props for your automation. I open a pr to put this in the original lib, but I had no response, follow the link to see the pr: https://github.com/beefe/react-native-actionsheet/pull/159/files + # react-native-actionsheet Cross platform ActionSheet. This component implements a custom ActionSheet and provides the same way to drawing it on the defferent platforms(iOS and Android). Actually, In order to keep the best effect, it still uses the ActionSheetIOS on iOS. @@ -17,7 +19,7 @@ Cross platform ActionSheet. This component implements a custom ActionSheet and ## Install ``` -npm install react-native-actionsheet --save +npm i @henriquealbertbill/react-native-actionsheet ``` ## Usage @@ -39,6 +41,8 @@ class Demo extends React.Component { options={['Apple', 'Banana', 'cancel']} cancelButtonIndex={2} destructiveButtonIndex={1} + testID={'testIdNameHere'} + accessibilityLabel={'accessibilityLabelNameHere'} onPress={(index) => { /* do something */ }} /> @@ -53,7 +57,7 @@ class Demo extends React.Component { so you can customize option and title ```js -import { ActionSheetCustom as ActionSheet } from 'react-native-actionsheet' +import { ActionSheetCustom as ActionSheet } from '@henriquealbertbill/react-native-actionsheet' const options = [ 'Cancel', @@ -167,4 +171,16 @@ https://github.com/beefe/react-native-actionsheet/blob/master/lib/options.js {} + + testID + + PropTypes.string or PropTypes.element + + + + accessibilityLabel + + PropTypes.string or PropTypes.element + +