How to tap backbutton arrow created by react navigation ?
See original GitHub issueDescription
There are two buttons on this page. One is on the top-left, which was created by react-navigation. One is just ‘confirmation’ button. I trying tapping the first top back button.
I use the code
await element(by.id("header-back")).tap();
not working, no match element for 'header-back;
I then use the code
await element(by.traits(['button']))
.atIndex(0)
.tap();
not working too, it clicks 'confirmation button ’ on the button page. not the top back button I want.
Your environment
Detox version: React Native version: Node version: Device model: OS: Test-runner (select one): jest-circus / jest+jasmine / mocha / other
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Header buttons | React Navigation
The most common way to interact with a header is by tapping on a button either to the left or the right of...
Read more >How to position back arrow button in react navigation
You see I just need to make the back-arrow positioned at the top, because in my current tab the arrow is at the...
Read more >Getting that Back Button With React Navigation
Getting that Back Button With React Navigation · Create Stack Navigators First · Then Create Bottom Tab Navigator · Navigation Container.
Read more >React-Native tutorial # 36 disable back button in navigation
this video about how to handle and disable back button in android react native. we will dippers the top arrow and disable android...
Read more >Custom Handling the Android Back Button with ... - YouTube
In this lesson we'll explore setting up a stack navigator in React Navigation. We'll create a custom component that uses `withNavigation` to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, that’s a good reference to have. In any case, there’s always
device.pressBack()
.await element(by.id('parentViewTestId')).swipe('right', 'fast', 0.75, 0.1, 0.1);
This works for me as right swipe does the job of a back button in iOS.