Skip to content

Instantly share code, notes, and snippets.

@mgoria
Created December 16, 2019 15:08
Show Gist options
  • Select an option

  • Save mgoria/53f7a73c578dc797ff81e3b37af3fe50 to your computer and use it in GitHub Desktop.

Select an option

Save mgoria/53f7a73c578dc797ff81e3b37af3fe50 to your computer and use it in GitHub Desktop.
#!/bin/bash
# report file path is passed as first argument to this script like
# parse-report.sh /my-path/serenity.txt
REPORT_FILE_PATH="$1"
# gets the value for passed tests, to get the others just change the pattern /Passed:/ to desired one
# e.g awk '/Ignored:/ {print $NF}'
PASSED_COUNT=$(cat "${REPORT_FILE_PATH}" | awk '/Passed:/ {print $NF}')
FAILED_COUNT=$(cat "${REPORT_FILE_PATH}" | awk '/Failed:/ {print $NF}')
# those vars could be used further to apply some specific logic on them
echo "Passed tests: ${PASSED_COUNT}"
echo "Passed failed: ${FAILED_COUNT}"
@mgoria
Copy link
Author

mgoria commented Dec 16, 2019

report sample

Serenity report generated 16-12-2019 12:28
11 test scenarios 

Passed:             6
Pending             0
Failed:             2
Failed with errors: 3
Compromised:        0
Pending:            0
Ignored:            0
Skipped:            0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment