-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v1.34.1] Component with position: 'absolute' is not recognised #1609
Comments
I wonder if you found any workaround for this @wonderlul? I have the exact same issue on iOS. |
This only happened for me on Android. On iOS, studio able to find the element. Also, from what I observe, this only happened to element that have absolute positioned, and also positioned outside of the parent layout. eg negative position. |
I am also facing this issue with component having absolute styling. I am facing issue in IOS only. In android it is working fine for me. |
I upgraded to v1.35.0 same issue continued |
Is there any update for this, as I have just run into this situation myself. It occurs on both android emulator and iOS simulator and only for components that have absolute positioning. Maestro version [1.36.0] |
I have the exact same error for iOS and Android.
|
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
If it can help anyone, one workaround was to make sure the parent Touchable element had accessibility prop set to false to enable visibility of all its children, and the nested Touchable element had to hold the absolute positioning (not its child). |
I just started implementing maestro in our app and now ran into this issue on ios. Is there any update to this? |
Is anyone actively working on a fix for this issue or has more information what is the root cause for this? The bug is stopping us from a wider adoption of maestro e2e testing, because we are using absolute positioned elements for navigation and using workarounds is quite complicated and not robust to changes. |
So the issue is, that with the accessibility property set to true, and position is absolute, react native will merge the children into a single accessible element. . As you can see, my text components got merged, and i can only select by text, if i write both lines. I am unable to tap the individual child elements of the Pressable. This is confusing, if you don't know it. What i can do is, give the Pressable a testID and tell Maestro to tap that id. That works perfectly fine. I don't think this is something Maestro can fix. |
Here is a workaround. Keep in mind, this might break accessibility tests, if you do so. - launchApp:
appId: "com.example.app"
arguments:
isTesting: "true" Put this in any JS file and import it import {LaunchArguments} from "react-native-launch-arguments";
let launchArgs = LaunchArguments.value();
function isTesting(){
return launchArgs.isTesting;
}
[
TouchableWithoutFeedback,
TouchableOpacity,
TouchableNativeFeedback,
TouchableHighlight,
Pressable
].forEach(component => {
component.defaultProps ??= {};
component.defaultProps.accessible = !isTesting();
}); In newer versions of RN, defaultProps is deprecated. While it still works right now, i recommend you to create your own components. This may or may not be a bigger refactoring task. import {Pressable as NativePressable, PressableProps as NativePressableProps} from "react-native";
export type PressableProps = NativePressableProps;
export default function Pressable(props: PressableProps){
return(
<NativePressable accessible={!isTesting()} {...props}/>
);
} |
Describe the bug
Component with position: 'absolute' is not recognised.
To Reproduce
Set one to position: 'absolute'
Screenshots
The component with position set to 'absolute' is this dropdown with three options.
Environment information (please complete the following information):
Additional context
I don't know if this is considered a bug or is it completely understandable behaviour. If so, please forgive me and close the ticket :)
Best regards
The text was updated successfully, but these errors were encountered: