Uploading your tests to Testery

Uploading your tests to Testery

After you set up your test projects and environments inside Testery the next step is getting your tests uploaded so you can start running them either manually or through your CI/CD pipeline. Testery has two options for pulling test source code:

  1. Pulling the code directly from your source control integration
  2. Uploading code or build as a build artifact to reference later in the test run

This article will cover option two.

Uploading a built test artifact

For languages like C# and Java where you compile your code and the build output is collected, you can run a simple command to get build uploaded to Testery or you can upload it through the site. For interpreted languages, you can upload the source code directory as well.

Option 1: Through the command line

Prerequisites:

  • Testery CLI has been install via python
  • If using a compiled language, make sure the test project has been built and outputted to a directory

Use the CLI command "upload-build-artifacts" to upload and link your files to an existing Testery project. Provide a string "build id" to reference later.

testery upload-build-artifacts --token=$TOKEN --project-key="example-project" --build-id="1.0.0" --path="C:\Users\Work\source\example-project\bin\Debug"

Option 2: Through the Testery interface

Prerequisites:

  • Target test project has been built and outputted to a directory
  • Zip the contents of the build output directory
  1. Navigate to your desired test project in Testery
  2. Under the "Builds" tabs of the project, find the "Add Build" button
  3. Enter a name for the build and select the zipped file

Referencing a build artifact

After your build artifact has been uploaded, you can find it under the "Builds" tab of your test project. It can now be referenced by a test run.

When starting a test run via the CLI, you can pass in the "--build-id" parameter to load the artifact during the test run.

testery create-test-run --token="$TOKEN" --project-key="example-project" --environment-key="staging" --build-id="1.0.0"

When starting a test run via the Testery interface, you can select the build in the "Build" dropdown.

Happy Testing!