Forum Discussion

sebgevers's avatar
sebgevers
New Contributor
3 years ago

Automatic update of test results while using Cucumber/JSON/Cypress

TLDR;how do I update test execution status using Cypress, Cucumber, JSON and Zephyr Scale data centre edition? 

 

Some background info.

We use Zephyr Scale, Data Center Edition.
Our test framework is Cucumber

Our automation tool is Cypress

We use Cucumber for our feature files 
We run our automation via Gitlab.

Our test cases are organised in the Cycle, and further subdivided onto folders for each country we test

Our test cases in Zephyr are also just placeholders (they contain no test steps) that map 1:1 with our automated test scripts

We always pass/fail the entire test case in Zephyr based on our regression test results 

 

this last step takes forever, and this is what I want to automate. In the absence of clearer documentation, I believe that this --> Annotations With Other CI Tools/Running Locally | Zephyr Scale Server/Data Center Documentation (smartbear.com) <-- solves that issue.

 

My expectation is that once this is implemented, the test execution status is updated automatically in Zephyr Scale, based on the results of the automation and the JSON file that Cucumber outputs.  

 

Is this how this functionality works, and does anyone have experience in getting this to work that they are willing to share?

1 Reply

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    Hi,
    We call PowerShell from our scripts to compare files.  We then get a return value from PS to determine if the files match.  To accomplish this we use WshShell. Perhaps this could be adapted for your needs.  Below is a VBScript code snippet.

    Here is a link to the docs:  WshShell Object | TestComplete Documentation

    Here is the code we use:

    Set oShell = Sys.OleObject("WScript.Shell") 
      
      '-- Compare the files using Powershell
      s_PowershellInput = "powershell -command Compare-Object -ReferenceObject $(Get-Content '" & RFile & "') -DifferenceObject $(Get-Content '" & TFile & "') | where {$_.SideIndicator -eq '<=' -and !$_.InputObject.StartsWith('#')} | select -ExpandProperty inputObject"
      Set oExec = oShell.Exec(s_PowershellInput)
      oExec.StdIn.Close ' Close standard input before reading output
    
      ' Get PowerShell output with the comparison results
      strOutput = oExec.StdOut.ReadAll
    
      '-- If strOutput is "" then the files matched
      If strOutput = "" Then 
        AtsCompareFilesPS = True
      Else  'Return false and save the output to a text file in the same location as the test file
        AtsCompareFilesPS = False
     End If

     

    • roli62's avatar
      roli62
      Occasional Contributor

      I just called my testedApp "python". 

      The python script it calls works fine from testComplete. The issue is just how to wait for the app to finish and how to get the exit code of "main.py". 

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        Once main.py has finished, the exit code is returned back to Python, and not back to TestComplete. Refer to the Python documentation on how to retrieve the exit code.