Skip to content

Instantly share code, notes, and snippets.

@yyahav
yyahav / zephyrUpload.py
Last active May 7, 2023 16:03
Script to prepare JUnit XML files for Zephyr Scale, package them into a ZIP file, and upload to Zephyr API
# Zephyr Scale upload script
# Author: yyahav // Date: May 4th 2023
# ------------------------------------
# When uploading a zip file containing JUnit xml reports, trying to auto create testcases will create the test cases based on their FQCN including the package (e.g. com.automate.tests.really.long.annoying.TestClass.testMethod).
# Usually this is not convenient or easy on the eyes. So this script is meant to be run after a 'test' build task, editing the xml files to remove the package and keep only the method (test) names for the created test case.
# After editing the xml files, they are archived into a zip file, which is then uploaded to Zephyr Scale API using the supplied Bearer token.
# To create a token if you don't have one - https://support.smartbear.com/zephyr-scale-cloud/docs/rest-api/generating-api-access-tokens.html
import argparse
import os