Deploy Guard (Test Runner)

Multi-case test suites with 6 assertion types

Deploy Guard is a test automation tool that runs up to 20 test cases against any Apify actor in a single suite. Each test case defines its own input and assertions — 6 assertion types validate result counts, required fields, field types, duration limits, and empty values — for a flat fee of $0.35 per suite, regardless of how many test cases are included.

Manual actor testing requires running each input scenario separately in the Apify Console and visually inspecting output — a process that takes 5-15 minutes per scenario. Deploy Guard automates all scenarios in a single run with structured pass/fail results, per-case error isolation, and timing data for performance regression detection.

Sign in to use
$0.35/suite

Deploy Guard assertion types

Minimum & maximum result counts

Assert that your actor returns at least N results (minResults) or no more than N results (maxResults). Catches pagination bugs, empty outputs, and runaway scrapers that return unbounded data.

Required field checks

Verify that specified fields exist with non-null values in at least one output item. Catches missing extractors, changed CSS selectors, and broken API endpoints that silently drop fields.

Field type validation

Assert that fields match expected JavaScript types: string, number, boolean, object, or array. Catches silent type coercion issues like prices stored as strings instead of numbers.

Duration limits

Set a maxDuration per test case in seconds. If a 10-second test starts taking 60 seconds, the assertion fails — catching performance regressions from target site changes or proxy issues.

Empty value detection

Assert that fields are never null, undefined, empty string, or empty array. Catches scrapers that technically succeed but return blank data — a common failure mode that passes result count checks.

Per-case error isolation

If one test case crashes or times out, the remaining cases still run and produce results. One bad scenario does not block the rest of the suite — each case runs as an independent actor call.

Apify actor testing methods compared

There are 4 common approaches to testing Apify actors with multiple input scenarios. Each has trade-offs in automation level, assertion coverage, and cost.

MethodTime per scenarioAssertion typesAutomationCost
Deploy Guard10-60 seconds (depends on actor)6 types: counts, fields, types, duration, empty values, isolationFully automated (define cases once, rerun via API)$0.35/suite + actor compute
Manual Apify Console runs5-15 minutesVisual inspection only (no structured assertions)Fully manual per scenarioFree (time cost only)
Custom API test script3-6 hours (initial setup), seconds per runUnlimited (custom code, but you build each assertion)Automated after developmentFree (development time cost)
Jest / Vitest unit testsMilliseconds per testFunction-level assertions (does not test full actor on platform)Automated (local only, no platform integration)Free

No single testing method catches every issue — the most reliable approach combines unit tests for logic with end-to-end platform tests for integration and performance.

Example Deploy Guard output

{
  "actorName": "ryanclinton/google-maps-email-extractor",
  "totalTests": 3,
  "passed": 2,
  "failed": 1,
  "totalDuration": 45.2,
  "results": [
    {
      "name": "Basic search",
      "passed": true,
      "duration": 12.1,
      "resultCount": 5,
      "assertions": [
        { "assertion": "minResults >= 3", "passed": true, "actual": 5 },
        { "assertion": "field 'businessName' exists", "passed": true },
        { "assertion": "field 'email' type === string", "passed": true }
      ]
    },
    {
      "name": "Location filter",
      "passed": true,
      "duration": 29.9,
      "resultCount": 12,
      "assertions": [
        { "assertion": "maxDuration <= 60", "passed": true, "actual": 29.9 },
        { "assertion": "noEmptyValues: 'phone'", "passed": true }
      ]
    },
    {
      "name": "Empty input",
      "passed": false,
      "duration": 3.2,
      "resultCount": 0,
      "error": "Run status: FAILED"
    }
  ]
}

How Deploy Guard works

1

Connect your Apify API token and enter the actor ID to test

2

Deploy Guard runs each test case on your account with its own input and assertions

3

Get a structured pass/fail report with per-case timing, assertion details, and error messages — results cached for free

Alternatives to Deploy Guard

There are several approaches to testing Apify actors across multiple input scenarios, from fully manual to fully automated. The right choice depends on your team size, deployment frequency, and how critical your scrapers are to downstream systems.

Manual Apify Console testing

Run the actor manually in the Apify Console with each input scenario, then inspect the output visually. Works for ad-hoc checks but does not scale — testing 5 scenarios manually takes 25-75 minutes and provides no structured assertions or regression history.

Best for: one-off debugging of a specific actor input before deployment.

Custom Apify API test script

Write a Node.js or Python script that calls the Apify API to run the actor with different inputs and checks the output dataset programmatically. Requires 3-6 hours of initial development and ongoing maintenance as assertions evolve.

Best for: teams with custom CI/CD pipelines who need assertions not covered by standard testing tools.

Jest / Vitest unit testing

Standard JavaScript test frameworks that validate individual functions in isolation. Fast (milliseconds per test) and free, but cannot test the full actor on the Apify platform — they miss proxy issues, API rate limits, platform timeouts, and deployment-specific failures.

Best for: testing pure data transformation logic and utility functions during development.

Apify scheduled monitoring

Schedule the actor to run periodically via Apify Schedules and set up webhook alerts for failures. Catches hard failures but provides no assertion-level validation — a scraper can 'succeed' while returning incorrect data.

Best for: uptime monitoring and hard failure detection on production scrapers.

Deploy Guard

Automated multi-case test suites with 6 assertion types, per-case error isolation, and structured JSON output. Up to 20 test cases per suite at a flat $0.35. No scripting required — define cases as JSON input, trigger via UI or API.

Best for: developers who maintain multiple actors and need repeatable, assertion-based end-to-end testing.

Each approach has trade-offs in setup time, assertion depth, and maintenance burden. The right choice depends on your deployment frequency and how critical your scrapers are to downstream data pipelines.

Limitations

  • 1.End-to-end testing only. Deploy Guard runs the full actor on the Apify platform. It does not support function-level unit testing, mocking, or test isolation below the actor level — use Jest or Vitest for that.
  • 2.Sequential execution. Test cases run one after another, not in parallel. A suite of 20 cases where each actor run takes 30 seconds results in a total runtime of approximately 10 minutes.
  • 3.No data accuracy validation. ApifyForge Test Runner checks output structure (types, field presence, counts) but not data correctness. A scraper can pass all assertions while returning stale or incorrect data. Use ApifyForge Regression Tests to detect output drift between versions.
  • 4.Requires Apify account. Test runs execute on your own Apify account at standard compute rates plus the $0.35 per suite fee. You need a valid Apify API token to use the tool.
  • 5.20 test case maximum per suite. Suites are capped at 20 test cases. For actors requiring more scenarios, split cases across multiple suite runs.

What Deploy Guard costs

Every suite run executes on your own Apify account at the flat pay-per-event rate of $0.35 per suite— not per test case. A suite with 20 test cases costs the same $0.35 as a suite with 1 test case. You also pay standard Apify compute costs for the individual actor runs. ApifyForge has no platform fee or subscription. Apify's free plan includes $5/month in credits, enough for approximately 14 suite runs per month.

Frequently asked questions

What does Deploy Guard actually do?

Deploy Guard accepts a list of test cases — each with a name, actor input, and assertions — and runs them sequentially against your Apify actor on your own account. It validates output using 6 assertion types (minResults, maxResults, requiredFields, fieldTypes, maxDuration, noEmptyValues) and produces a pass/fail report with per-case timing, result counts, and specific assertion failures.

How many test cases can I include in a single suite?

Deploy Guard supports up to 20 test cases per suite at the flat $0.35 fee. Each test case runs as an independent actor call with its own input and assertions. Since the price is per suite rather than per test case, adding more cases improves cost efficiency — 20 test cases at $0.35 works out to $0.0175 per case.

What are the 6 assertion types?

The 6 assertion types are: (1) minResults — actor must return at least N items, (2) maxResults — actor must return no more than N items, (3) requiredFields — specified fields must exist with non-null values, (4) fieldTypes — fields must match expected JavaScript types (string, number, boolean, object, array), (5) maxDuration — run must complete within N seconds, (6) noEmptyValues — fields must not be null, undefined, empty string, or empty array.

How much does Deploy Guard cost?

Each suite run costs $0.35, charged as a pay-per-event (PPE) fee on your own Apify account. ApifyForge has no platform fee or subscription. Apify's free tier includes $5/month in credits, enough for approximately 14 suite runs per month. You also pay standard Apify compute costs for the actor runs themselves.

What happens if one test case fails or crashes?

Deploy Guard uses per-case error isolation. If one test case crashes, times out, or returns an actor error, the remaining test cases still run and produce results. The failed case is marked with passed: false and includes the specific error message, while passing cases report their assertions normally.

Can I use Deploy Guard in a CI/CD pipeline?

Yes. Deploy Guard runs as an Apify actor, so you can trigger it via the Apify API from any CI/CD system (GitHub Actions, GitLab CI, Jenkins). Pass your test cases as JSON input, then check the output dataset for any failed assertions. The structured JSON output makes it straightforward to parse programmatically.

How is this different from ApifyForge Regression Tests?

Deploy Guard validates a single actor against multiple input scenarios in one run — it answers 'does my actor handle these inputs correctly?' ApifyForge Regression Tests, by contrast, runs the same actor twice (before and after a code change) and compares outputs to detect regressions. Test Runner checks correctness; Regression Tests check stability.

Does Deploy Guard replace unit testing?

No. Unit tests validate individual functions in isolation, while Deploy Guard validates the full actor end-to-end on the Apify platform. They serve different purposes: unit tests catch logic errors during development, while Test Runner catches integration issues, API changes, and platform-level failures that only appear when the actor runs in production.