Target Locator does not support accessibilityID in mobile for webdriverio integration #1637
Replies: 8 comments
-
Hey @LayMui! I haven't worked with React Native, so am not sure why the accessibility idea wouldn't be working... But let's walk through it, maybe we'll figure it out together:
BUT If you look at the React Native docs for <TouchableOpacity
accessible={true}
accessibilityLabel="Tap me!"
onPress={onPress}>
<View style={styles.button}>
<Text style={styles.buttonText}>Press me!</Text>
</View>
</TouchableOpacity> While the helper function does not seem to set it: export function testProperties(id, disableAccessible = false) {
const disableAccessibility = disableAccessible ? { accessible: false } : {};
return { ...disableAccessibility, accessibilityLabel: id };
} Have you tried setting it to export function testProperties(id, disableAccessible = false) {
const disableAccessibility = disableAccessible
? { accessible: false }
: { accessible: true };
return { ...disableAccessibility, accessibilityLabel: id };
} |
Beta Was this translation helpful? Give feedback.
-
I got a step definition issue now see line 19 https://github.com/LayMui/foodie/blob/master/src/step-definitions/SearchForRestaurant.steps.ts Did I miss something here? |
Beta Was this translation helpful? Give feedback.
-
Check out the docs on Cucumber expressions, particularly parameter types:
The pattern you've defined:
requires the restaurant name to be surrounded by single or double quotes. |
Beta Was this translation helpful? Give feedback.
-
I have fixed that. ConfigurationError: Jan can't BrowseTheWeb yet. Did you give them the ability to do so? [iPhone 11 iOS 14.5 #0-0] I have pushed the changes to |
Beta Was this translation helpful? Give feedback.
-
I have to add this code to the Given step
|
Beta Was this translation helpful? Give feedback.
-
@jan-molak I was looking at this it need to support the mobile accessibilityLabel: do you think there is need to add to the locator for accessibilityID (for mobile)? |
Beta Was this translation helpful? Give feedback.
-
Hey @LayMui - I'd need to debug it with your app, it's hard to tell at this stage I'm afraid. |
Beta Was this translation helpful? Give feedback.
-
@jan-molak you may clone the repo |
Beta Was this translation helpful? Give feedback.
-
accessibilityLabel is used for both ios and android to set unique locator strategy
however serenityJS does not seem to support this
in my example code
I use
by.css
export class SearchPage {
static inputSearch = Target.the("search bar").located(by.css('~search-bar'));
it does not work
https://github.com/LayMui/foodie for the automation code
https://github.com/LayMui/food for the app
Beta Was this translation helpful? Give feedback.
All reactions