Bug 45849 - UItest app.ScrollTo incorrectly 'succeeding' (false positive)
Summary: UItest app.ScrollTo incorrectly 'succeeding' (false positive)
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 10.0 (iOS10)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-10-24 17:50 UTC by Colin Dabritz
Modified: 2016-10-27 22:14 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Correct behavior sample (7.95 KB, text/plain)
2016-10-24 17:53 UTC, Colin Dabritz
Incorrect behavior control tree sample (17.52 KB, text/plain)
2016-10-24 17:55 UTC, Colin Dabritz

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Colin Dabritz 2016-10-24 17:50:59 UTC
While app.ScrollTo() works correctly in one instance in our application, in another it fails to actually scroll, but the call completes without error.

The working test scenario is a list of user names for logging in, inside of a UITableView.

In the failing test scenario this view is on the right side of the screen and the visual tree hierarchy is fairly complex. The list has around 4 pages of content in it. The item I want to scroll to is toward the bottom of the list, and it is uniquely identifiable via the content a UILabel.

In the test, app.ScrollTo("The Unique Label Text") is passing, but the list isn't scrolled at all. Note that I am unable to pass a 'withinMarked' parameter, as it is unsupported.

Please note:
app.ScrollDown( q => q.Marked("The Unique Label Text")) fails to scroll and errors out.
app.ScrollDown( q => q.Marked("The Unique Label Text"), q => q.Id("TheTableViewId")) scrolls correctly and passes.

app.Query( q => q.Marked("The Unique Label Text")) as a test does not return anything. If you manually scroll the item to the screen, it finds the item.

I would guess the steps to reproduce might look like:
1. Create a sample app with a table view containing at least two 'screens' of scrollable content. Place a unique label in an item 'below the fold'.
2. Figure out what additional structure makes the problem not work, and add that as well. (See sample 'tree' instances attached).
2. In a test, call app.ScrollTo("TheItem")
Expected: Error - The call should be unable to scroll down, and will fail to find the item, erroring out.
Actual: The call incorrectly succeeds with no scrolling taken place. A 'tap' on the expected item then fails to find it.

I will attach the Repl 'tree' control hierarchy for the correct and incorrect scenarios (privately).
Comment 1 Colin Dabritz 2016-10-24 17:53:58 UTC
Created attachment 18200 [details]
Correct behavior sample

This is the output from an app.Repl() of the control structure just before the ScrollTo() call attempt. In this scenario the scroll works correctly as expected.
Comment 2 Colin Dabritz 2016-10-24 17:55:08 UTC
Created attachment 18201 [details]
Incorrect behavior control tree sample

This app.Repl() 'tree' sample shows the control structure just before the ScrollTo() 'succeeded' but fails to scroll to the indicated item.