Calabash-android:试图触摸'一个句子的一部分链接

时间:2015-09-30 19:24:07

标签: android ruby touch calabash-android

我的一项测试是按下链接。

问题是链接是句子的一部分: “登录,按此处”(“这里”是链接)。

如果我试图触摸句子本身,它将无效。 - > touch(query(“* text:’ to login, press here’”))

知道我怎么才能触摸链接?

尝试使用x / y位置,但在其他Android设备上进行了测试,但无法正常工作(分辨率问题)。

query(“*”)结果:

`"id" => nil,
           "enabled" => true,
"contentDescription" => nil,
              "text" => to login, press here",
           "visible" => true,
               "tag" => nil,
       "description" => "md5434416eb11d5314a89721b66815c1e97.RichText{52847bcc VFED..CL ......I. 0,805-1080,1014}",
             "class" => "md5434416eb11d5314a89721b66815c1e97.RichText",
              "rect" => {
    "center_y" => 984,
    "center_x" => 540,
      "height" => 209,
           "y" => 880,
       "width" => 1080,
           "x" => 0`

你的想法?

1 个答案:

答案 0 :(得分:0)

你试过这个吗? :

Then /^I touch the "([^\"]*)" text$/ do |text|
      tap_when_element_exists("* {text CONTAINS[c] '#{text}'}")
    end

你可以在哪个容器中提供更多信息,希望看到上面和下面的内容。谢谢;)