2

因此,在我的葫芦测试脚本中,我可以调用以下宏,以便它等待某个活动加载并显示:

Then I wait up to 10 seconds for the "ActivityName" screen to appear

现在我的应用程序很大程度上基于使用这个SlidingMenu库的片段。当我调用我的新片段(我没有使用 XML 文件)时,这一切都是在 java 中通过创建新片段然后像这样切换它来完成的:

getFragmentManager().beginTransaction().replace(R.id.contentview_frame, fragment).commit();

我知道如何编写一个步骤定义宏,但我正在寻找这个宏中的动作,它基本上会告诉我:

Then I wait up to 10 seconds for the "Name" fragment to appear

有人认为在当前版本的 calabash-android 下这是可能的吗?

4

1 回答 1

0

我认为当前版本的葫芦确实有 I wait up to (\d+) seconds to see "([^\"]*)",可以如下使用:我等待最多 10 秒才能看到“文本”

text作为片段中的一些文本。

如果这是不可能的(比如说,因为本地化),那么在你的片段中添加一个 id,并使用宏I wait for the view with id "([^\"]*)"

于 2013-12-20T20:43:49.033 回答