Git Product home page Git Product logo

Comments (10)

haemi avatar haemi commented on July 21, 2024

I can confirm this issue; how does your workaround look like exactly?

from kif.

gorbster avatar gorbster commented on July 21, 2024

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:

gorbster@25fecde

Here's the branch:

https://github.com/gorbster/KIF/tree/handle-transformed-windows

from kif.

haemi avatar haemi commented on July 21, 2024

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

  1. 20, 30
  2. 100, 150
  3. 200, 300

And the buttons at those positions are

  1. 30 725
  2. 150 645
  3. 300 545

Thanks a lot for your help, it's really appreciated!

from kif.

gorbster avatar gorbster commented on July 21, 2024

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.

haemi avatar haemi commented on July 21, 2024

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.

msmollin avatar msmollin commented on July 21, 2024

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.

modocache avatar modocache commented on July 21, 2024

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.

mflint avatar mflint commented on July 21, 2024

+1 for this patch. Works fine for me too!

I'd be very happy to see this pulled.

(Thanks Brian!)

from kif.

jxa avatar jxa commented on July 21, 2024

+1

This patch fixes issues for me.

from kif.

bnickel avatar bnickel commented on July 21, 2024

Fixed in master. Thanks!

from kif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.