Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Call to snapshot() triggers a tap on last TabBar item #251

Closed
larsparendt opened this issue Oct 28, 2015 · 5 comments
Closed

Call to snapshot() triggers a tap on last TabBar item #251

larsparendt opened this issue Oct 28, 2015 · 5 comments
Labels

Comments

@larsparendt
Copy link

  1. Create a new Xcode project from the Tabbed Application template.
  2. Add a UI Testing target
  3. Initialize snapshot (as per instructions)
  4. Add snapshot("test") to testExample()
  5. Run test

Expected:
A snapshot of the first view controller.

Result:
Second view controller is selected and snapshot.

Note:
Changing 30000 to -30000 in the helper function does not cause this tap, however, snapshot will subsequently not recognise these event.

@larsparendt
Copy link
Author

An easy way to reproduce this is by using the Example project where you can just insert a return after the first snapshot() call:

    func testExample()
    {
        snapshot("0Launch")
        return;
        ...

This will tap the last tabBar item too.

@larsparendt
Copy link
Author

When looking at the collector code (lib/snapshot/collector.rb)

was_snapshot = activity["Title"].match(/Press and drag from Target Application.*\[32.10.*\].*/)

it doesn't really matter what the y-coordinate is, so I simply changed 30000 to -30000 in SnapshotHelper.swift:

        let start = view.coordinateWithNormalizedOffset(CGVectorMake(32.10, -30000))
        let finish = view.coordinateWithNormalizedOffset(CGVectorMake(31, -30000))

and everything works fine!

@bencollier
Copy link

Changing to -30000 breaks it for us as it taps the top right navigation button (in our case Share). Have Apple changed in 7.1 to prevent off screen user interactions?

@KrauseFx
Copy link
Collaborator

Duplicate of #215

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#2576. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants