【问题标题】:How to organize and group test cases in XCUI test automation framework如何在 XCUI 测试自动化框架中组织和分组测试用例
【发布时间】:2019-05-27 11:04:00
【问题描述】:

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

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

iOS XCUI 有类似的东西吗?

【问题讨论】:

    标签: ios swift xcode ios-ui-automation xcuitest


    【解决方案1】:

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

    根据xcodebuild documentation

    -only-testing-skip-testing 选项是可选的,分别允许您仅运行特定测试和跳过测试。他们接受一个参数,它指定要执行或排除的测试。 test-identifier 的格式如下:

    TestTarget[/TestClass[/TestMethod]]
    

    TestTarget 是必需的,是测试包的名称。 TestClassTestMethod都是可选的,分别代表类名和要测试的方法名。

    示例用法:

    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 很有用

    【讨论】:

      【解决方案2】:

      Xcode 的下一个版本(下周推出)添加了称为测试计划的新功能。它专为增强的测试计划而设计。 它没有文档,但您可以观看主题演讲并获取有关它的更多详细信息。


      https://developer.apple.com/videos/play/wwdc2019/413/?time=1411

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-02-25
        • 1970-01-01
        • 1970-01-01
        • 2022-12-20
        • 1970-01-01
        • 2016-02-17
        • 2013-02-03
        • 2016-07-09
        相关资源
        最近更新 更多