ios ui自动化测试
Who knew automated UI Testing could be so easy! Well, I guess Apple did. Automated UI Testing has never been easier with the XCUITest framework for iOS.
谁知道自动化的UI测试是如此简单! 好吧,我想苹果公司做到了。 借助适用于iOS的XCUITest框架,自动化UI测试从未如此简单。
At work, I am not apart of the Quality Assurance (QA) practice but this is starting to make me reconsider.
在工作中,我并不属于质量保证(QA)部门,但这开始使我重新考虑。
What if there was a way to create UI tests without actually writing code? 🤔 We’ll get to that later but first, let’s briefly talk about what is UI testing and XCUITest.
如果有一种方法可以创建UI测试而不实际编写代码呢? later我们稍后再讨论,但首先,让我们简要讨论什么是UI测试和XCUITest。
什么是用户界面(UI)测试? (What is User interface (UI) Testing?)
UI Testing is the process of checking and validating that the visual elements of an application meet the expected functional and performance criteria for that application. This process does not only check that the application is functioning as it should but also ensures that it meets the end user’s expectations such that it is easily adaptable.
UI测试是检查和验证应用程序的视觉元素是否满足该应用程序预期的功能和性能标准的过程。 此过程不仅检查应用程序是否按其应有的功能运行,而且还确保其满足最终用户的期望,从而使其易于适应。
The scope coverage includes the testing of icons, buttons, input fields, toolbar, menus, colours and lots more. It is also used to test different application flows such as a user’s login or registration flow to ensure that user experience and functionality is working as expected.
范围涵盖了对图标,按钮,输入字段,工具栏,菜单,颜色等的测试。 它还用于测试不同的应用程序流,例如用户的登录或注册流,以确保用户体验和功能按预期工作。
The main areas analysed during UI testing includes:
UI测试期间分析的主要领域包括:
- Visual Design 视觉设计
- Functionality 功能性
- Usability 易用性
- Performance 性能
什么是XCUITEST? (What is XCUITEST?)
XCUITest is a user interface testing framework launched by Apple in 2015. With XCUITest, we can test an Apple platform application user interface using the Swift or Objective-C programming language.
XCUITest是Apple在2015年推出的用户界面测试框架。借助XCUITest,我们可以使用Swift或Objective-C编程语言来测试Apple平台应用程序用户界面。
XCUITest will only work for native iOS & macOS applications. It won’t work for cross-platform or hybrid applications such as React Native, Flutter, Xamarin or Ionic.
XCUITest仅适用于本机iOS和macOS应用程序。 它不适用于跨平台或混合应用程序,例如React Native,Flutter,Xamarin或Ionic。
它是如何工作的? (How does it work?)
XCUITest is written and ran using XCode. It provides some handy tools that can be used to speed up your automated UI tests. I am going to assume you have some experience with iOS development and/or you have an iOS project you want to add automated UI testing to.
XCUITest是使用XCode编写和运行的。 它提供了一些方便的工具,可用于加快自动化UI测试的速度。 我