【发布时间】:2019-06-27 15:43:04
【问题描述】:
我正在寻找在 JIRA Adaptavist 测试管理工具中更新我的自动化测试用例的想法。测试用例是用 Java 和 TestNg 编写的,并在 VM 上运行。请建议在 JIRA Adaptavist 测试管理工具中自动更新测试结果(通过或失败)的好方法。目前,我们正在工具中手动更新结果。
使用 Zephyr 和 XRay 或任何其他第三方 COTS 工具的问题在于繁琐且延迟的审批流程。
感谢您的时间、帮助和支持。
我们的 Android 测试团队开发了以下代码,但我们不知道如何实现。
Here is the android team's code :
Open class rTestCaseHelper {
@rule
@JvmField
val grantWriteStorageAccess: GrantPermissionRule = GrantPermissionRule.grant(
android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
@rule
@JvmField
val reportRule :TestWatcher = Object : TestWatcher() {
var startTime = 0
override fun starting(description: Description?) {
startTime = System.currentTimeMillis().toInt()
if (sharedPreference.getTestCount() == 0) {
testManager.getTestIdAndStoreToSharedPreference()
testManager.createTestCycle()
}
}
override fun succeeded(description: Description?) {
if(description != null) {
val executionTime = System.currentTimeMillis().toInt() - startTime
testManager.generateExecutionReport(description.methodName, result: "Pass", executionTime)
}
}
override fun failed(e: Throwable?, description: Description?) {
super.failed(e.description)
if(description != null) {
val executionTime = System.currentTimeMillis().toInt() - startTime
testManager.generateExecutionReport(description.methodName, result: "Fail", executionTime, e)
}
}
override fun finished(description: Description?) {
sharedPreference.setTestCount(sharedPreference.getTestCount() -1)
//Post artfact report link to test cycle (TODO)
testManager.postWebLinkToTestCycle()
rSharedPreference.preference.edit().clear()
Log.d(tag: "QAA", msg: "Automation suite finished and sharedPreference data is cleared!")
}
}
}
fun initializeSDK(activeProtection: Boolean = false): Boolean {
rSdkEnvironment.initializeSDK(activeProtection, InstrumentationRegistry.getInstrumentation().targetContext)
return rSdk.isInitialized()
}
【问题讨论】: