From 6931b8f2fb735cb6a41f004b7ff4d00c73847cb0 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Wed, 18 Apr 2018 13:15:01 -0500 Subject: [PATCH] feat(TestHint): add 'onPress' property Allows to bind a click handler to a TestHint. When a mobile test wants to click an UI element it must be able to locate it through the accessibility layer. Now the problem with that is that there is currently no uniform way for finding element on both iOS and Android. This problem is solved by TestHint component which takes an id parameter which then can be specified in the corresponding java TestHint class in jitsi-meet-torture to easily find it. By being able to add a click handler to a TestHint, it's possible to duplicate original handler under nested TestHint and then find it easily on the torture side. --- react/features/base/testing/components/AbstractTestHint.js | 6 ++++++ react/features/base/testing/components/TestHint.android.js | 4 +++- react/features/base/testing/components/TestHint.ios.js | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/react/features/base/testing/components/AbstractTestHint.js b/react/features/base/testing/components/AbstractTestHint.js index 183582cfe..230c35cea 100644 --- a/react/features/base/testing/components/AbstractTestHint.js +++ b/react/features/base/testing/components/AbstractTestHint.js @@ -25,6 +25,12 @@ export type TestHintProps = { */ id: string, + /** + * The optional "on press" handler which can be used to bind a click handler + * to a {@link TestHint}. + */ + onPress: ?Function, + /** * The test hint's (text) value which is to be consumed by the tests. */ diff --git a/react/features/base/testing/components/TestHint.android.js b/react/features/base/testing/components/TestHint.android.js index 7d3c02591..534670a05 100644 --- a/react/features/base/testing/components/TestHint.android.js +++ b/react/features/base/testing/components/TestHint.android.js @@ -37,7 +37,9 @@ class TestHint extends Component { } return ( - + { this.props.value } ); diff --git a/react/features/base/testing/components/TestHint.ios.js b/react/features/base/testing/components/TestHint.ios.js index c7353ee20..64e0c6b80 100644 --- a/react/features/base/testing/components/TestHint.ios.js +++ b/react/features/base/testing/components/TestHint.ios.js @@ -28,6 +28,7 @@ class TestHint extends Component { return ( ); }