> ## Documentation Index
> Fetch the complete documentation index at: https://onetest.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Smoke Testing Workflow

> Run critical path tests after every deployment

> [!NOTE]
>
> This page is under construction. More content coming soon!

## What are Smoke Tests?

Smoke tests are a subset of critical tests that verify the most important functionality of your application. They ensure the system is stable enough for further testing.

> [!TIP]
>
> Think of smoke tests as "build verification tests"—if smoke tests fail, the build is not ready for deeper testing.

## When to Run Smoke Tests

> [card] After Deployment
>
> Verify deployment was successful and core features work

> [card] After Build
>
> Validate new build before handing off to QA

> [card] On Schedule
>
> Automated nightly runs to catch environmental issues

> [card] Before Release
>
> Final sanity check before releasing to production

## Creating a Smoke Test Suite

**1. Identify Critical Paths**

What functionality is absolutely essential?

Examples:

* User can log in
* User can view homepage
* User can add item to cart
* User can complete checkout
* User can log out

**2. Tag Tests as Smoke**

Use OQL to find and tag your critical tests:

```oql theme={null}
priority IN (p0, p1) AND component IN (login, checkout, core)
```

Then bulk-tag them with `smoke`

**3. Keep It Small**

Smoke tests should be:

* **Fast**: Complete in \<15 minutes
* **Focused**: Only critical functionality
* **Stable**: No flaky tests allowed
* **Independent**: No complex dependencies

> [!WARNING]
>
> If your smoke suite takes >30 minutes, it's too large. Split into smoke + sanity suites.

**4. Automate Where Possible**

Automate smoke tests to run:

* After every deployment (CI/CD pipeline)
* On a schedule (nightly builds)
* Before release (release gate)

## Running Smoke Tests

> [tab] Manual Execution
>
> ### Run Smoke Suite Manually
>
> **1. Select Tests**
>
> Use OQL to filter smoke tests:
>
> ```oql theme={null}
> tags CONTAINS "smoke" AND status = active
> ORDER BY priority ASC
> ```
>
> **2. Create Test Run**
>
> Click **"+ New Test Run"**:
>
> * **Name**: `Smoke Tests - Build 2.1.0`
> * **Environment**: `Staging` or `Production`
> * **Build**: `2.1.0`
>
> **3. Execute**
>
> Run tests in order of priority (P0 first, then P1)
>
> **4. Report**
>
> If any test fails, **STOP** and report immediately. Don't proceed with further testing until smoke tests pass.

> [tab] Automated (CI/CD)
>
> ### Integrate with CI/CD Pipeline
>
> ```yaml theme={null}
> # Example: GitHub Actions workflow
> name: Smoke Tests
>
> on:
>   deployment_status
>
> jobs:
>   smoke-tests:
>     runs-on: ubuntu-latest
>     if: github.event.deployment_status.state == 'success'
>
>     steps:
>       - name: Run Smoke Tests
>         run: |
>           # Use OneTest API to trigger smoke test run
>           curl -X POST https://api.onetest.ai/v1/runs \
>             -H "Authorization: Bearer ${{ secrets.ONETEST_API_KEY }}" \
>             -d '{
>               "name": "Smoke Tests - ${{ github.sha }}",
>               "environment": "${{ github.event.deployment_status.environment }}",
>               "filters": "tags CONTAINS \"smoke\" AND status = active"
>             }'
>
>       - name: Wait for Results
>         run: |
>           # Poll for results and fail if smoke tests fail
>           # ... polling logic ...
>
>       - name: Notify Team
>         if: failure()
>         uses: slack-notify-action
> ```

> [tab] Scheduled
>
> ### Schedule Regular Smoke Tests
>
> Set up automated recurring runs:
>
> **1. Create Saved Query**
>
> Save your smoke test filter:
>
> ```oql theme={null}
> tags CONTAINS "smoke" AND status = active
> ```
>
> **2. Configure Schedule**
>
> * **Frequency**: Nightly, or after business hours
> * **Environment**: Staging or Production
> * **Notification**: Alert on failure
>
> **3. Monitor**
>
> Check dashboard each morning for overnight results

## Example Smoke Test Suite

> [accordion] E-Commerce Smoke Tests
>
> **Critical Paths:**
>
> 1. Homepage loads successfully
> 2. User can search for products
> 3. User can view product details
> 4. User can add product to cart
> 5. User can view cart
> 6. User can proceed to checkout
> 7. User can complete payment
> 8. User receives order confirmation
>
> **Total Time:** \~8 minutes
> **Priority:** All P0 tests

> [accordion] SaaS Application Smoke Tests
>
> **Critical Paths:**
>
> 1. Landing page loads
> 2. User can sign up
> 3. User can log in
> 4. Dashboard displays data
> 5. User can create new item
> 6. User can edit item
> 7. User can delete item
> 8. User can log out
>
> **Total Time:** \~10 minutes
> **Priority:** All P0 tests

> [accordion] API Smoke Tests
>
> **Critical Endpoints:**
>
> 1. Health check returns 200
> 2. Authentication endpoint works
> 3. GET /users returns data
> 4. POST /users creates user
> 5. PUT /users/{id} updates user
> 6. DELETE /users/{id} removes user
> 7. Database connection is healthy
> 8. Cache is accessible
>
> **Total Time:** \~2 minutes
> **Priority:** All P0 tests

## Smoke Test Best Practices

> [card] Keep It Fast
>
> Target \<15 minutes total execution time

> [card] Zero Flaky Tests
>
> Remove or fix any flaky tests immediately

> [card] Run on Real Environments
>
> Test on staging or production-like environments

> [card] Block on Failure
>
> Failing smoke tests should block deployment

> [card] Version Control
>
> Track which build/version was tested

> [card] Clear Reporting
>
> Make results visible to entire team

## Troubleshooting

> [accordion] Smoke Tests Taking Too Long
>
> **Problem:** Smoke suite takes >30 minutes
>
> **Solutions:**
>
> * Review tests—are they all truly critical?
> * Remove redundant test steps
> * Parallelize test execution
> * Consider splitting into smoke + sanity suites

> [accordion] Flaky Smoke Tests
>
> **Problem:** Smoke tests sometimes pass, sometimes fail
>
> **Solutions:**
>
> * Identify the flaky tests using pass rate analysis
> * Fix root cause (timing issues, environment problems, etc.)
> * Remove flaky tests from smoke suite temporarily
> * Add explicit waits/retries in test steps

> [accordion] Smoke Tests Always Fail
>
> **Problem:** Smoke tests consistently fail after deployment
>
> **Solutions:**
>
> * Check if deployment actually completed
> * Verify environment is accessible
> * Review recent code changes
> * Check for database migration issues
> * Validate configuration/environment variables

## What's Next?

> [card] [Regression Testing](https://onetest.ai/workflows/regression-tests.md)
>
> Comprehensive testing workflow

> [card] [Organizing Tests](https://onetest.ai/workflows/organizing-tests.md)
>
> Best practices for test organization

> [card] [OQL Examples](https://onetest.ai/oql/examples.md)
>
> Learn to filter tests with OQL

> [card] [Best Practices](https://onetest.ai/resources/best-practices.md)
>
> General testing best practices


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.