gpt4 book ai didi

ios - 如何在 XCUI 测试自动化框架中组织和分组测试用例

转载 作者:行者123 更新时间:2023-11-28 13:38:36 27 4
gpt4 key购买 nike

我正在使用 XCUI 测试框架来自动化我的 iOS 应用程序测试用例。我对所有模块都有单独的测试。我需要从每个模块中专门选择特定的案例来设置一个高水平的健全运行,我可以单独运行这些测试。我们有类似 Selenium TestNG 组的东西吗?

@Test (groups = { "bonding", "strong_ties" })   

iOS XCUI 有类似的东西吗?

最佳答案

您可以使用类似路径的字符串安排您的测试。

根据 xcodebuild documentation

The -only-testing and -skip-testing options, which are optional, allow you to run only a specific test and to skip a test, respectively. They take an argument , which specifies the test to be executed or excluded. test-identifier's format is as follows:

TestTarget[/TestClass[/TestMethod]]

TestTarget, which is required, is the name of the test bundle. TestClass and TestMethod, which are both optional, respectively represent the name of the class and the name of the method to be tested.

示例用法:

xcodebuild -workspace Foo.xcworkspace \
-scheme Bar\
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone SE,OS=12.3'
'-only-testing:TestGroup/TestClass' test

查看 How to Get Started with XCUITest (iOS)初始说明。

您可能还会找到 EarlGrey framework有用

关于ios - 如何在 XCUI 测试自动化框架中组织和分组测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56324845/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com