question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to tap backbutton arrow created by react navigation ?

See original GitHub issue

Description

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:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
d4vidicommented, May 19, 2022

Thanks, that’s a good reference to have. In any case, there’s always device.pressBack().

0reactions
jogyfelixcommented, Dec 27, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found