Search code examples
javanode.jsautomated-testsopentest

How do I start a new test session in OpenTest?


I have installed OpenTest and want to start a new session.

How do I do this?

I tried searching for this on Google but only found a PR talking about using the API.


Solution

  • There are three ways to start a test session:

    1. From the web-based user interface. Go to the Session / Create Test Session... menu option, then select the tests you want to run, fill in other test session properties, as needed, and click the Create Session button.
    2. Using a test session template. This can be done from the UI, or through the web API:
      • From the UI: use the Session / Create Session From Template...
      • Using the API: fill-in the template property of the JSON payload. Mode details here.
    3. Using the web API and passing the properties of the test session, as described here.

    Example API call:

    POST http://localhost:3000/api/session
    
    {
        "environment": "prod",
        "sessionLabel": "Run smoke tests",
        "tests": [
            {
                "path": ".",
                "name": "Smoke test 1"
            },
            {
                "path": ".",
                "name": "Web test 2"
            }
        ]
    }