如何安装
1. 安装 qase-xctest 工具。
pip install qase-xctest
- 将此 pod 添加到您的测试目标中。
target 'Tests' do
pod 'Qase'
end
如何使用
准备您的测试
在测试开始时添加 qase testId。您可以在 qase.io 中的项目中找到 testId。
import Qase
class Tests: XCTestCase {
func testExample() {
// Test Id
startQaseTest(id: 123)
...
}
}
添加步骤。
func testExample() {
...
step("Some step") { _ in
// Your checks
}
...
}
或者您可以在您的活动项中添加标记。
func testExample() {
...
// Or you can mark activity as a step.
// Only first level activities can be market as a step.
// All inner marks will be ignored.
XCTContext.runActivity(named: "Some step") { _ in
markQaseStep()
// Your checks
// This is part of step.
XCTContext.runActivity(named: "Substep") { _ in
// This mark is incorrect.
// markQaseStep()
// Your checks
}
}
...
}
qase.io
将报告发送到使用 qasexcode
工具从构建目录发送您最后生成的报告。
qasexcode --build $BUILD_ROOT \
--api_token YOUR_API_TOKEN \
--project_code YOUR_PROJECT_CODE \
--run_name From_Xcode \
--upload_attachments
在此处获取 API Token https://app.qase.io/user/api/token。