i need to swipe an item and need to click on a button in that item, i used this the test is success but i could not view that button this test case is written to swipe left
There is another solution if the above solution of using tapAndHold is not working for anyone. You can use also use flickElement.
const offset = {x: -50, y: 0};
const targetElement = element(by.css(`selector`)); // This should be the element which is visible on your screen and you want to swipe
await browser.driver.touchActions()
.flickElement(targetElement, offset, 200)
.perform();
The above code is to swipe left the element. To swipe right you can use:
const offset = {x: 50, y: 0};