UI 自动化、在另一个框架内重用代码或破解以使其工作?

UI Automation, reusing code within another framework or hack to make it work?

我有很多 UI 自动化 JavaScript 代码,这些代码不再可用,因为 Xcode.

中不再支持了

我正在寻找任何可能的方法来尝试尽可能多地重用代码。

我只是想知道是否有任何类型的迁移路径或 hack 使其可用? 到目前为止我还没有看到任何东西。

好吧,我已经等了 iOS 个 QA 自动化工程师分享他们对此事的专业观点,但既然 none 出现了,我就试一试。

首先,你并不孤单。 UI Automation 支持已从 XCode 8 和许多其他 people had the same problem 中删除。

我在网上阅读的所有材料的主要收获是:

The only version of Appium that will work with xcode 8 is 1.6.0. You can download the beta now. Instruments/UIAutomation have been removed and only Appium's XCUITest support will work moving forward.

展望未来,让您开始测试用例迁移或至少给您一些帮助提示的最佳文档是:Migrating your iOS tests from UIAutomation (iOS 9.3 and below) to XCUITest (iOS 9.3 and up) [已更新LINK].

考虑到您的情况,这篇文章涵盖了一些非常热门的话题:

  • 元素class名称架构;
  • 页面来源;
  • 定位器策略(重点xpath);
  • 依赖关系,API差异等

您将不得不开始使用 appium-xcuitest-driver instead of appium-ios-driver

安装与设置:

除了您可以在 appium-xcuitest-driver's official GitHub repo, the bread and butter is here: Setting up iOS Real Devices Tests with XCUITest 上找到的相关信息。

开始使用新的 framework/set 库,或者从一个工具套件迁移到另一个工具套件总是很困难,但是根据过去的经验,一旦您有了工作设置并构建了您的第一个测试用例,一切else之后就顺利了。

最后,我可以延长回复时间,但 official documentation 总是会做得更好。

希望以任何方式、形式或形式提供帮助。干杯!