0

我有一个带视图的开关,比如“switch_view”。我需要更改它以进行自动化测试。我该怎么做呢?我到现在的工作是:

def switch(switch_view)
    # Get the value of the switch
    switch_state = (frankly_map(switch_view, 'isON')).first
    switch_state[0] = !switch_state[0]
    touch(switch_view)
end

正如你所看到的,这只是我迄今为止尝试过的所有东西的合并,那个该死的开关仍然没有移动。请帮帮我。

4

1 回答 1

1

我想到了。但我想我应该把它留在这里,因为它可能会引起一些混乱。关键是使用内置的 tap_and_hold 方法。

def switch(switch_view)
  tap_and_hold(switch_view)
  sleep 1 # For the animation
end

您可以将其与有关状态的先前信息结合起来,并创建明确的测试。

于 2014-03-14T01:43:13.313 回答