{
  "slug": "tests/quickstart",
  "title": "Tests Quickstart",
  "description": "Write and run your first Cuitty test suite in five minutes.",
  "url": "https://cuitty.com/docs/tests/quickstart",
  "markdown_url": "https://cuitty.com/docs/tests/quickstart.md",
  "json_url": "https://cuitty.com/docs/tests/quickstart.json",
  "frontmatter": {
    "title": "Tests Quickstart",
    "description": "Write and run your first Cuitty test suite in five minutes.",
    "order": 1,
    "section": "Tests",
    "updatedAt": "2026-05-31"
  },
  "headings": [
    {
      "depth": 1,
      "slug": "tests-quickstart",
      "text": "Tests Quickstart"
    },
    {
      "depth": 2,
      "slug": "install-the-cli",
      "text": "Install the CLI"
    },
    {
      "depth": 2,
      "slug": "write-your-first-ctest-file",
      "text": "Write your first .ctest file"
    },
    {
      "depth": 2,
      "slug": "run-the-suite",
      "text": "Run the suite"
    },
    {
      "depth": 2,
      "slug": "view-results-in-test-studio",
      "text": "View results in Test Studio"
    },
    {
      "depth": 2,
      "slug": "add-tests-to-ci",
      "text": "Add tests to CI"
    },
    {
      "depth": 2,
      "slug": "whats-next",
      "text": "What’s next"
    }
  ],
  "body_markdown": "# Tests Quickstart\n\nCuitty Tests lets you write declarative HTTP smoke tests in `.ctest` files, run them from the CLI or CI, and review results in Test Studio. This guide takes you from install to a passing suite in under five minutes.\n\n## Install the CLI\n\n```bash\ncurl -fsSL https://cuitty.com/install.sh | sh\ncui --version\n```\n\nOr install with npm:\n\n```bash\nnpm install -g @cuitty/cli\n```\n\n## Write your first .ctest file\n\nCreate `smoke.ctest` in your project root. Cuitty tests use an HCL-based DSL:\n\n```hcl\nsuite \"api-smoke\" {\n  description = \"Verify core API endpoints return 200\"\n\n  test \"healthcheck\" {\n    request {\n      method = \"GET\"\n      url    = \"${env.BASE_URL}/health\"\n    }\n\n    assert {\n      status = 200\n    }\n  }\n\n  test \"list-projects\" {\n    request {\n      method = \"GET\"\n      url    = \"${env.BASE_URL}/api/projects\"\n      headers = {\n        Authorization = \"Bearer ${env.CUITTY_API_KEY}\"\n      }\n    }\n\n    assert {\n      status  = 200\n      json    = \"$.data | length > 0\"\n    }\n  }\n}\n```\n\n## Run the suite\n\nExecute the test file against your running environment:\n\n```bash\ncui tests run smoke.ctest --env BASE_URL=http://localhost:7700\n```\n\nThe CLI prints a pass/fail summary for each test. Use `--verbose` to see full request and response bodies.\n\n## View results in Test Studio\n\nIf you have the Cuitty portal running, results are automatically pushed to Test Studio. Open the portal and navigate to **Tests > Runs** to see the timeline, latency breakdown, and assertion details for every request.\n\n## Add tests to CI\n\nDrop a step into your GitHub Actions workflow:\n\n```yaml\n- name: Run Cuitty tests\n  uses: cuitty/test-action@v1\n  with:\n    files: \"**/*.ctest\"\n    env: |\n      BASE_URL=${{ vars.STAGING_URL }}\n      CUITTY_API_KEY=${{ secrets.CUITTY_API_KEY }}\n    fail-on: \"any\"\n```\n\nThe action uploads results to Test Studio and fails the workflow if any assertion breaks.\n\n## What's next\n\n- [Test DSL reference](/product/tests#dsl) — full syntax for suites, tests, variables, and assertions\n- [Test Studio](/product/tests#studio) — dashboard features, diffing, and trend analysis\n- [CI integration](/product/tests#ci) — GitHub Actions, GitLab CI, and generic webhook triggers\n- [Runner configuration](/product/tests#runner) — parallelism, retries, timeouts, and environment files",
  "body_html": "<h1 id=\"tests-quickstart\">Tests Quickstart</h1>\n<p>Cuitty Tests lets you write declarative HTTP smoke tests in <code>.ctest</code> files, run them from the CLI or CI, and review results in Test Studio. This guide takes you from install to a passing suite in under five minutes.</p>\n<h2 id=\"install-the-cli\">Install the CLI</h2>\n<pre class=\"astro-code github-dark\" style=\"background-color:#24292e;color:#e1e4e8; overflow-x: auto;\" tabindex=\"0\" data-language=\"bash\"><code><span class=\"line\"><span style=\"color:#B392F0\">curl</span><span style=\"color:#79B8FF\"> -fsSL</span><span style=\"color:#9ECBFF\"> https://cuitty.com/install.sh</span><span style=\"color:#F97583\"> |</span><span style=\"color:#B392F0\"> sh</span></span>\n<span class=\"line\"><span style=\"color:#B392F0\">cui</span><span style=\"color:#79B8FF\"> --version</span></span></code></pre>\n<p>Or install with npm:</p>\n<pre class=\"astro-code github-dark\" style=\"background-color:#24292e;color:#e1e4e8; overflow-x: auto;\" tabindex=\"0\" data-language=\"bash\"><code><span class=\"line\"><span style=\"color:#B392F0\">npm</span><span style=\"color:#9ECBFF\"> install</span><span style=\"color:#79B8FF\"> -g</span><span style=\"color:#9ECBFF\"> @cuitty/cli</span></span></code></pre>\n<h2 id=\"write-your-first-ctest-file\">Write your first .ctest file</h2>\n<p>Create <code>smoke.ctest</code> in your project root. Cuitty tests use an HCL-based DSL:</p>\n<pre class=\"astro-code github-dark\" style=\"background-color:#24292e;color:#e1e4e8; overflow-x: auto;\" tabindex=\"0\" data-language=\"hcl\"><code><span class=\"line\"><span style=\"color:#B392F0\">suite</span><span style=\"color:#79B8FF\"> \"api-smoke\"</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">  description</span><span style=\"color:#F97583\"> =</span><span style=\"color:#9ECBFF\"> \"Verify core API endpoints return 200\"</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"color:#B392F0\">  test</span><span style=\"color:#79B8FF\"> \"healthcheck\"</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#B392F0\">    request</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      method</span><span style=\"color:#F97583\"> =</span><span style=\"color:#9ECBFF\"> \"GET\"</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      url</span><span style=\"color:#F97583\">    =</span><span style=\"color:#9ECBFF\"> \"</span><span style=\"color:#F97583\">${</span><span style=\"color:#E1E4E8\">env</span><span style=\"color:#F97583\">.</span><span style=\"color:#E1E4E8\">BASE_URL</span><span style=\"color:#F97583\">}</span><span style=\"color:#9ECBFF\">/health\"</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">    }</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"color:#B392F0\">    assert</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      status</span><span style=\"color:#F97583\"> =</span><span style=\"color:#79B8FF\"> 200</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">    }</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">  }</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"color:#B392F0\">  test</span><span style=\"color:#79B8FF\"> \"list-projects\"</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#B392F0\">    request</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      method</span><span style=\"color:#F97583\"> =</span><span style=\"color:#9ECBFF\"> \"GET\"</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      url</span><span style=\"color:#F97583\">    =</span><span style=\"color:#9ECBFF\"> \"</span><span style=\"color:#F97583\">${</span><span style=\"color:#E1E4E8\">env</span><span style=\"color:#F97583\">.</span><span style=\"color:#E1E4E8\">BASE_URL</span><span style=\"color:#F97583\">}</span><span style=\"color:#9ECBFF\">/api/projects\"</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      headers</span><span style=\"color:#F97583\"> =</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">        Authorization </span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\"> \"Bearer </span><span style=\"color:#F97583\">${</span><span style=\"color:#E1E4E8\">env</span><span style=\"color:#F97583\">.</span><span style=\"color:#E1E4E8\">CUITTY_API_KEY</span><span style=\"color:#F97583\">}</span><span style=\"color:#9ECBFF\">\"</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      }</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">    }</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"color:#B392F0\">    assert</span><span style=\"color:#E1E4E8\"> {</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      status</span><span style=\"color:#F97583\">  =</span><span style=\"color:#79B8FF\"> 200</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">      json</span><span style=\"color:#F97583\">    =</span><span style=\"color:#9ECBFF\"> \"$.data | length > 0\"</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">    }</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">  }</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">}</span></span></code></pre>\n<h2 id=\"run-the-suite\">Run the suite</h2>\n<p>Execute the test file against your running environment:</p>\n<pre class=\"astro-code github-dark\" style=\"background-color:#24292e;color:#e1e4e8; overflow-x: auto;\" tabindex=\"0\" data-language=\"bash\"><code><span class=\"line\"><span style=\"color:#B392F0\">cui</span><span style=\"color:#9ECBFF\"> tests</span><span style=\"color:#9ECBFF\"> run</span><span style=\"color:#9ECBFF\"> smoke.ctest</span><span style=\"color:#79B8FF\"> --env</span><span style=\"color:#9ECBFF\"> BASE_URL=http://localhost:7700</span></span></code></pre>\n<p>The CLI prints a pass/fail summary for each test. Use <code>--verbose</code> to see full request and response bodies.</p>\n<h2 id=\"view-results-in-test-studio\">View results in Test Studio</h2>\n<p>If you have the Cuitty portal running, results are automatically pushed to Test Studio. Open the portal and navigate to <strong>Tests > Runs</strong> to see the timeline, latency breakdown, and assertion details for every request.</p>\n<h2 id=\"add-tests-to-ci\">Add tests to CI</h2>\n<p>Drop a step into your GitHub Actions workflow:</p>\n<pre class=\"astro-code github-dark\" style=\"background-color:#24292e;color:#e1e4e8; overflow-x: auto;\" tabindex=\"0\" data-language=\"yaml\"><code><span class=\"line\"><span style=\"color:#E1E4E8\">- </span><span style=\"color:#85E89D\">name</span><span style=\"color:#E1E4E8\">: </span><span style=\"color:#9ECBFF\">Run Cuitty tests</span></span>\n<span class=\"line\"><span style=\"color:#85E89D\">  uses</span><span style=\"color:#E1E4E8\">: </span><span style=\"color:#9ECBFF\">cuitty/test-action@v1</span></span>\n<span class=\"line\"><span style=\"color:#85E89D\">  with</span><span style=\"color:#E1E4E8\">:</span></span>\n<span class=\"line\"><span style=\"color:#85E89D\">    files</span><span style=\"color:#E1E4E8\">: </span><span style=\"color:#9ECBFF\">\"**/*.ctest\"</span></span>\n<span class=\"line\"><span style=\"color:#85E89D\">    env</span><span style=\"color:#E1E4E8\">: </span><span style=\"color:#F97583\">|</span></span>\n<span class=\"line\"><span style=\"color:#9ECBFF\">      BASE_URL=${{ vars.STAGING_URL }}</span></span>\n<span class=\"line\"><span style=\"color:#9ECBFF\">      CUITTY_API_KEY=${{ secrets.CUITTY_API_KEY }}</span></span>\n<span class=\"line\"><span style=\"color:#85E89D\">    fail-on</span><span style=\"color:#E1E4E8\">: </span><span style=\"color:#9ECBFF\">\"any\"</span></span></code></pre>\n<p>The action uploads results to Test Studio and fails the workflow if any assertion breaks.</p>\n<h2 id=\"whats-next\">What’s next</h2>\n<ul>\n<li><a href=\"/product/tests#dsl\">Test DSL reference</a> — full syntax for suites, tests, variables, and assertions</li>\n<li><a href=\"/product/tests#studio\">Test Studio</a> — dashboard features, diffing, and trend analysis</li>\n<li><a href=\"/product/tests#ci\">CI integration</a> — GitHub Actions, GitLab CI, and generic webhook triggers</li>\n<li><a href=\"/product/tests#runner\">Runner configuration</a> — parallelism, retries, timeouts, and environment files</li>\n</ul>",
  "links_out": [
    "/product/tests#dsl",
    "/product/tests#studio",
    "/product/tests#ci",
    "/product/tests#runner"
  ]
}