calabash / calabash-android

Automated Functional testing for Android using cucumber
Other
1.68k stars 617 forks source link

viewpager weird query results #684

Closed jbruchanov closed 8 years ago

jbruchanov commented 8 years ago

I have a viewpager with few pages, 1 view per "page". Currently I have 3 "pages" in a layout, however query gives me only 2 of them...

So layout looks like this "tree"

1st item seems correct (visible on display) 2nd item has actually wrong description/contentDescription and even size is wrong 3rd is missing

if I swipe to another position, I can always see correctly only the current one, next one is there with wrong values and previous one is completely missing

irb(main):003:0> query ("WallImageView")
[
    [0] {
                     "class" => "my.package.WallImageView",
                       "tag" => nil,
               "description" => "1.1.1",
                        "id" => nil,
                   "visible" => true,
                      "rect" => {
              "height" => 351,
               "width" => 467,
                   "y" => 365,
                   "x" => 881,
            "center_x" => 1114,
            "center_y" => 540
        },
                   "enabled" => true,
        "contentDescription" => "wallItem_1.1.1"
    },
    [1] {
                     "class" => "my.package.WallImageView",
                       "tag" => nil,
               "description" => "1.1.1",
                        "id" => nil,
                   "visible" => true,
                      "rect" => {
              "height" => 112,
               "width" => 150,
                   "y" => 1103,
                   "x" => 1843,
            "center_x" => 1918,
            "center_y" => 1159
        },
                   "enabled" => true,
        "contentDescription" => "wallItem_1.1.1"
    }
]

Maybe it's somehow related to previous issues, but can i actually filter query with description ? It doesn't give me any result...

irb(main):011:0> query ("WallImageView description:'1.1.1'")
[]
irb(main):017:0> query ("WallImageView contentDescription:'wallItem_1.1.1'")
[
    [0] {
                     "class" => "com.smallplanet.fujifilm.widget.WallImageView",
                       "tag" => nil,
               "description" => "1.1.1",
                        "id" => nil,
                   "visible" => true,
                      "rect" => {
              "height" => 351,
               "width" => 467,
                   "y" => 365,
                   "x" => 881,
            "center_x" => 1114,
            "center_y" => 540
        },
                   "enabled" => true,
        "contentDescription" => "wallItem_1.1.1"
    },
    [1] {
                     "class" => "com.smallplanet.fujifilm.widget.WallImageView",
                       "tag" => nil,
               "description" => "1.1.1",
                        "id" => nil,
                   "visible" => true,
                      "rect" => {
              "height" => 112,
               "width" => 150,
                   "y" => 1103,
                   "x" => 1843,
            "center_x" => 1918,
            "center_y" => 1159
        },
                   "enabled" => true,
        "contentDescription" => "wallItem_1.1.1"
    }
]

Any ideas what could be wrong ?

jbruchanov commented 8 years ago

Finally found the issue, the problem was incorrectly implemented AccessibilityDelegate