Comments (10)
I can confirm this issue; how does your workaround look like exactly?
from kif.
I have a branch with a proposed fix. Can you give it a try and let me know if it works for you?
Here's the fix:
Here's the branch:
https://github.com/gorbster/KIF/tree/handle-transformed-windows
from kif.
I'm afraid it's not 100% right - it looks better and promising, but it's not perfect.
Please find attached a test project at
http://dl.dropbox.com/u/119600/transfer/KIF.zip
In that app, I made an iPad app with loooots of 5x5 UIButtons, containing a title representing their position, e.g. the UIButton with the CGRectFrame(50, 120, 5, 5) contains the title "50 120".
Now, I did a test which taps the app at position
- 20, 30
- 100, 150
- 200, 300
And the buttons at those positions are
- 30 725
- 150 645
- 300 545
Thanks a lot for your help, it's really appreciated!
from kif.
Your sample project doesn't seem demonstrate an issue with KIF.
You're using +stepToTapScreenAtPoint: to tap your buttons. This method operates at the UIWindow level, not the UIView level. The coordinate system for UIWindow is always portrait, so the taps' coordinates are never converted to the device orientation.
What you probably want to look at is +stepToTapViewWithAccessibilityLabel. Remember that KIF works around the concept of accessibility labels assigned to your view elements.
I modified your scenario code to the following:
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"20 30"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"100 150"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"200 300"]];
And added an accessibilityLabel string to your buttons:
button.accessibilityLabel = button.titleLabel.text;
And the KIF test results look accurate:
Integration Tests[22946:f803] ---------------------------------------------------
Integration Tests[22946:f803] BEGIN SCENARIO 1/1 (3 steps)
Integration Tests[22946:f803] Test that a user can successfully log in.
Integration Tests[22946:f803] ---------------------------------------------------
Integration Tests[22946:f803] 20 30
Integration Tests[22946:f803] PASS (2.23s): Tap view with accessibility label "20 30"
Integration Tests[22946:f803] 100 150
Integration Tests[22946:f803] PASS (1.21s): Tap view with accessibility label "100 150"
Integration Tests[22946:f803] 200 300
Integration Tests[22946:f803] PASS (1.16s): Tap view with accessibility label "200 300"
Integration Tests[22946:f803] ---------------------------------------------------
Integration Tests[22946:f803] END OF SCENARIO (duration 4.61s)
Integration Tests[22946:f803] ---------------------------------------------------
from kif.
Sorry, I confused the issues... I thought we're in this one here: #112
Your fix works; it's important to use the window with windowLevel normal, otherwise there are problems when e.g. a UIAlertView is currently displayed.
from kif.
Did this end up getting merged? I'm currently having the same issue and while I've got no problem patching our version I'd prefer not to deviate too far from master :)
from kif.
Currently experiencing the same issue. Is there a reason this is an issue, not a pull request? Or is there some problem with the proposed fix?
from kif.
+1 for this patch. Works fine for me too!
I'd be very happy to see this pulled.
(Thanks Brian!)
from kif.
+1
This patch fixes issues for me.
from kif.
Fixed in master. Thanks!
from kif.
Related Issues (20)
- KIF types each character twice HOT 1
- tapView() not working on SwiftUI views in Xcode 12 with KIF 3.8.6 HOT 3
- Xcode 13.4: NSFunctionExpression with selector is forbidden. HOT 11
- KIF-based UI tests crashes in Xcode 13.4 HOT 2
- Question: Does KIF require a mac? HOT 5
- Xcode 14 "Failed to select from Picker" HOT 6
- iOS16 press on keyboard doesn't work HOT 5
- KIF causes exception on using WKWebView HOT 2
- KIF with SwiftUI element HOT 2
- Tappable SwiftUI view that is not tapped by KIF HOT 3
- How to tap on system photo picker #help-wanted HOT 1
- Problems with async test HOT 6
- Way to use Quick6 Nimble11 with KIF UI testing framework
- Screen edge pan gesture is not recognized HOT 8
- [Question/Help] How to write E2E UI Integrations tests? HOT 2
- Is KIF real rendering? HOT 2
- iOS 17 - Entering text using a KIFUITestActor into a text field is broken HOT 2
- [Requirement] Privacy manifest for new sensitive APIs HOT 2
- Black screenshots on test failures on ios 17. HOT 6
- Possibility of intergrating with Swift Test HOT 1
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 kif.