如何启用 Espresso 测试记录

How to enable Espresso Test Recording

截至昨天的 Google IO Keynote,我们在项目中进行 UI 测试的方式似乎有了重大更新。

由于新的测试记录器功能,自动化测试即将向前迈出一大步。开发人员将能够开始录制并开始使用他们的应用程序。在执行每个操作时,它会变成 Espresso 代码,可以在多个平台上回放,包括 Google 的云测试实验室。这可能会将编写测试的时间缩短到过去的十分之一。

我安装了最新版本的 Android Studio 2.2 Preview 1,我想知道我应该怎么做才能启用此功能。

它在今天的演讲中显示为列在 运行 菜单选项下。但是,事实并非如此。希望能尽快更新。

终于来了! Android Studio 2.2 预览版 3(可用 here

请注意,任何现有打开的项目都将被转换,并且可能无法使用旧版本再次打开! (他们确实创建了项目的备份)

你可以停止寻找了。 它不在 2.2 预览版 1 中,也不在 2.2 预览版 2 中。 为预览版 3 祈祷

Unfortunately the Espresso Test Recorder is still not in this build; we're addressing a few more issues and then hope to have it ready in the next build!

Not until Preview 2 or 3. No dates yet. So I hear, https://twitter.com/JeremMartinez/status/733548682075721728. It would be interesting to see how many people have tried to find the feature and was unable to find so far.

Espresso 测试记录器已在 Android Studio 2.2 Preview 3 中发布。

下载说明: https://sites.google.com/a/android.com/tools/recent/androidstudio22preview3available

下载最新版本的 Android Studio 即 Android Studio 2.2 Preview 3.

下载后,在工具栏中转到 Select Run/Debug 配置 ,它位于“创建项目”按钮的右侧。在 Run/Debug 配置中,select app。然后转到菜单栏,在“构建”菜单中,您会找到一个选项 Record Expresso Tests。 单击它并享受轻松的测试。