Skip to content
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

TapOn text input using its placeholder doesnt alway work on React Native(iOS) #2062

Open
1 task done
itsramiel opened this issue Sep 20, 2024 · 0 comments
Open
1 task done

Comments

@itsramiel
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and didn't find mine.

Steps to reproduce

  1. Clone https://github.com/itsramiel/MaestroInputTapOnRepro
  2. run yarn, then cd ios && pod install to install dependencies
  3. run the ios app with npx react-native@latest run-ios
  4. run maestro test with maestro test __e2e__/test.yaml
  5. Observe that the test fails because step: - tapOn: 'Enter text' fails

Actual results

For some reason the test fails to pick up tapOn commands in certain conditions.

For example it works if you remove the top level Pressable and replace it with a View like so:

    <View style={styles.screen}>
      <View
        style={{
          padding: 10,
          backgroundColor: 'black',
          flexDirection: 'row',
          gap: 16,
        }}>
        <TextInput placeholder="Enter text" placeholderTextColor="red" />
        <Pressable style={{ width: 32, height: 32, backgroundColor: 'red' }}>
          <Text>Hello</Text>
        </Pressable>
      </View>
    </View>

or it works if you remove the Hello sibling to the text input:

    <View style={styles.screen}>
      <Pressable
        style={{
          padding: 10,
          backgroundColor: 'black',
          flexDirection: 'row',
          gap: 16,
        }}>
        <TextInput placeholder="Enter text" placeholderTextColor="red" />
      </Pressable>
    </View>

Expected results

I expect the text input with the visible placeholder text to be correctly tapped on

About app

React Native open source

About environment

macOS: 14.6.1, Apple M3 chip

Logs

Logs
<!-- Replace this line with your logs. *DO NOT* remove the backticks! -->

Maestro version

1.38.1

How did you install Maestro?

Homebrew

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant