从Eclipse中运行REST API测试用例自动发布的测试结果在JIRA Adaptavist工具

问题描述 投票:0回答:1

我在找一个想法,更新JIRA Adaptavist测试管理工具我自动化测试用例。测试用例是用Java编写与TestNG的,并在虚拟机上运行。请建议什么是更新的测试结果(通过或失败)的JIRA Adaptavist测试管理工具自动的好方法。目前,我们正在手动更新的工具的结果。

使用和风和X光或任何其他第三方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() 
}
java testng jira
1个回答
0
投票

不知道到底是你在寻找什么。下面是这样做的一种方法:创建可用于指代表示特定测试用例吉拉ID新的自定义注释。注释新注解@Test方法,使我们的测试方法阕其JIRA ID。现在,通过实施ITestNGListener及其onTestFailure内建立一个TestNG的听众()由通过ITestResult.getTestMethod()获取自定义注释检索吉拉ID。getConstructorOrMethod()。getMethod()调用,然后触发一个RESTful调用您的吉拉实例更新测试结果。 “所有的人生理想的情况要么是非法的,昂贵的,育肥或爱上了别人!”

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() 
}
© www.soinside.com 2019 - 2024. All rights reserved.