Skip to main content

Create a Response-based Test

To create a test, you define a trigger. A trigger is an action that executes an action against your system. The most basic trigger is an HTTP requests, but we support several trigger types.

  1. Playwright
  2. HTTP
  3. GRPC
  4. GraphQL
  5. Kafka
note

Playwright enables a useful technique: True end-to-end testing, where you start tests from the Web UI and explore the entire internal process of that request across the back end, database, and external services.

You can create tests in two ways:

  1. Programmatically, in YAML
  2. Visually, in the Web UI

Once started, Tracetest Agent executes tests in the environment where it is running and returns the response from triggered tests. This is how you run basic response-based testing.

Create a Test Programatically in YAML​

Create a file called ping-google.yaml.

ping-google.yaml
type: Test
spec:
name: Ping Google
trigger:
type: http
httpRequest:
method: GET
url: https://google.com
headers:
- key: Content-Type
value: application/json

Run it with the CLI.

Terminal
tracetest run test -f ./ping-google.yaml

Create a Test Visually with the Web UI​

Create a test in the Web UI by opening your Tracetest Account, clicking the Create button, and selecting HTTP.

create response based test 1

Enter https://google.com as the URL, and click Run.

create response based test 2