Comments (6)
Also to clarify. Technically all these validation methods are unnecessary for the library to work. The library just generates a tap at a coordinate and gets no response from the system. So these just exist to give useful errors when we detect the tap probably failed
from hammer.
Hi @nsoojin. I investigated if tapping a view that is not contained inside the bounds does not work (unless you modify the container view's point(inside: ...)
method). I've attached a simple sample project where a blue box contains a green button partially outside the bounds. You can see that tapping on the parts outside the bounds do not trigger an action.
In any case I do agree that there is a bug in the visibility methods because they don't take into account the clipping. Here is a PR that fixes that: #41
Please let me know if there's something else I'm missing or if this solves your problem.
from hammer.
@gabriellanata
I think there needs to be another way to determine "visibility". Do you have any other ideas?
Or, do we must have that check? What happens if it's removed?
from hammer.
Hmm my understanding is that a view will not receive touches outside of it's bounds unless you modify the view's own hit testing methods. So technically the name "isVisible" might be wrong but the behavior should be correct in assuming it's not hittable.
I'll verify tomorrow. If it is hittable we might be able to check if the views between it are clipped to determine if it's just out of bounds but still visible. And if it's not hittable outside of the bounds maybe i'll rename the method for clarity
from hammer.
Hmm my understanding is that a view will not receive touches outside of it's bounds
I'm trying to receive touch within it's own bounds. The bug happens when the view is outside superview's bounds
.
This view is interactable in the app, and if I use CGPoint, Hammer successfully interacts with it, but not with the viewWithIdentifier. So the view is actually hittable but getting filtered by the check.
CGPoint(x: 412, y: 736) is the location of "video.frame.pointer.left"
// works
try eventGenerator.fingerDown(at: CGPoint(x: 412, y: 736))
try eventGenerator.fingerMove(to: CGPoint(x: 200, y: 736), duration: 1)
// error on fingerDown
try eventGenerator.fingerDown(at: try eventGenerator.viewWithIdentifier("video.frame.pointer.left"))
try eventGenerator.fingerMove(to: CGPoint(x: 200, y: 736), duration: 1)
from hammer.
Right. sorry for the confusion, I missed I was overriding point(inside:)
Your PR #41 fixes the issue. Thank you
from hammer.
Related Issues (14)
- having trouble interacting with the callout bar HOT 8
- Question: Watch Support HOT 3
- Working with SwiftUI Lists? HOT 2
- Unable to access private API in UIWindow: "ContextID" HOT 8
- Hammer fails to build with Xcode 13 beta 4 HOT 3
- How to use in Objective-c project HOT 2
- Xcode 13.3 can't compile Hammer 0.14.0 HOT 3
- New console log warnings and suggestions on flaky tests? HOT 2
- SFSafariViewController support
- Missing support for `.stationary` touches HOT 3
- Tests are only failing in remote CI pipeline. HOT 2
- waitUntilHittable never waits? HOT 1
- cocoapods support? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hammer.