@testmo/testmo-cliNPM package. Once you have installed the package, you can simply use the
testmotool from the command line. The following example shows how to install the CLI as a global tool on your system:
npmand install packages. If your system is missing NPM/NodeJS, just follow their guide on how to install these tools.
testmotool, you can use it to submit your test automation results to your Testmo instance.
testmocommand to submit your results. You can simply pass one or multiple XML files and the tool automatically scans and detects all test results.
testmotool also supports launching your test automation tool directly to capture the console output, record exit codes and measure test times. See below for a full example.
testmofrom the Windows cmd.exe command line like this (PowerShell uses yet another syntax, so use the following example with cmd.exe):
testmocommand line tool supports various scenarios and workflows. To make it easier to get started and use the best approach, we've included some concrete examples for typical use cases below. Also make sure to review the full command line reference for all options and features.
automation:run:submitcommand. This command accomplishes multiple things at once:
testmotool supports this by passing the full automation command line as a parameter.
testmothen launches your automation tool, captures the output, records the full test time and finally, after you automation tool exits, collects the result files.
testmo, simply pass it after specifying two dashes at the end of the command like this:
--dashes and your automation tool command line. The full command and all options after the dashes are used to launch your automation tool.
testmotool automatically extracts any custom fields from your XML files. For threads and test runs you can submit additional details directly from the command line. Including such details can be useful in various situations:
testmocommand makes it very easy to include custom fields, artifacts and links for your threads and runs. To do this, you just specify a resource JSON file when creating, submitting or completing runs and threads. You could create such a JSON file yourself, but the
testmotool includes convenient commands to build this file from the command line:
testmo-resources.jsonin the current directory. You can then include these resources by specifying the file with the run and thread commands:
testmoCLI tool also supports
propertytags on a
testcaselevel in XML files. Let's take a look at a simple example with just a single test case:
testmotool would parse this example as four fields (two fields from the
propertieslist and two additional fields based on the output). Please note that the
testmotool would only transmit test-level fields for non-passing tests to improve performance and scalability.
testmotool from your CI/CD pipeline:
automation:run:createcommand in your CI/CD pipeline. This creates a new test automation run in Testmo so you can add results. The command returns a test run ID. You need to store this ID and pass it to your parallel test jobs in your CI/CD pipeline, so you can add your results.
testmotool launch your tests). You use the
automation:run:submit-threadcommand to create a new thread and submit your results (and optionally launch your automation tool). You need to pass the above mentioned test run ID, so the new thread and results are added to the test run you created in step 1.
automation:run:completecommand. You again need to pass the test run ID created in step 1.
automation:run:createcommands, you can specify a configuration and milestone.
--config-idoption. IDs for configurations can be found in Testmo under Admin > Configurations.
--config-nameoption and Testmo will try to find the relevant configuration based on its name.
--milestone-idoption. The ID of a milestone can be found by clicking the small info icon next to the milestone name in the header section of the milestone's view page.
--milestoneoption. Testmo will then try to find the milestone based on the milestone name.
--tagsoption). When you add or edit a milestone in Testmo, you can add one or more automation tags (e.g.
release-5etc). Testmo will automatically link a run to the latest milestone that was created with a matching automation tag. This way you do not need to change your command line call (and thus your CI/CD config). You just add new milestones in Testmo with the same tag. New runs are then always automatically linked to the latest relevant milestone.
testmocommand, our CLI tool automatically passes through the exit code by default. This way, when your test runs fail, the exit code is correctly reported to your CI/CD pipeline.
test-complete(or however you would like to call it) pipeline job on failure through to run the