1. Are you ready for the Galaxy S20? Here is everything we know so far!

Automatically post test results in JIRA Adaptavist Tool from rest api test cases run on eclipse

Discussion in 'Android Development' started by HuntikSeeker, Feb 3, 2019.

  1. HuntikSeeker

    HuntikSeeker Lurker
    Thread Starter

    I am looking for an idea to update my automation test cases in JIRA Adaptavist Test Management Tool. The test cases are written in Java & TestNg and are running on a VM. Please suggest what is a good method to update test results(Pass Or Fail) automatically in JIRA Adaptavist Test Management Tool. Currently, we are manually updating results in the tool.

    Problem with using Zephyr and XRay or any other thrid-party COTS tool is that because of the cumbersome and delayed approval processes.

    I appreciate your time, help and support.

    Our Android test team developed the following code and we don't know how to achieve as they did.

    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()
    }
     

    Advertisement

Loading...
Similar Threads - Automatically post test
  1. App Update
    Replies:
    0
    Views:
    131
  2. fikhatri
    Replies:
    13
    Views:
    646
  3. Mark7777
    Replies:
    2
    Views:
    242
  4. Secho
    Replies:
    1
    Views:
    264
  5. rmg2
    Replies:
    2
    Views:
    601
  6. Theguywhoneedssleep
    Replies:
    5
    Views:
    1,098
  7. Karol Kot
    Replies:
    1
    Views:
    166
  8. Nickineisser
    Replies:
    1
    Views:
    393
  9. Alesana
    Replies:
    2
    Views:
    288
  10. HuntikSeeker
    Replies:
    0
    Views:
    470

Share This Page

Loading...