Script And Schedule Tests
OpenFrame Documentation
Get the most out of OpenFrame · Book 30 minutes with Conrad, 25 years in IT. He'll show you what Mingo and Fae can take off your list.
OpenFrame Documentation
Script And Schedule Tests is the end-to-end test slice for remote-management scripts and script schedules. It is supplied by the com.openframe.oss:openframe-test-service-core library and run by this repository's OpenFrame test service. The tests exercise GraphQL read and mutation paths against a tenant, create their own data, and clean it up after execution.
The module verifies four complementary contracts:
flowchart LR
TestRunner["OpenFrame Test Runner"] --> ScriptTests["Script And Schedule Tests"]
ScriptTests --> ScriptApi["Script API"]
ScriptTests --> ScheduleApi["Script Schedule API"]
ScriptTests --> DeviceApi["Device API"]
ScriptApi --> GraphQL["OpenFrame GraphQL API"]
ScheduleApi --> GraphQL
DeviceApi --> GraphQL
GraphQL --> Dispatch["Execution Dispatch"]
Dispatch --> Agent["Enrolled Device Agent"]
Agent --> Results["Execution Results"]
Results --> GraphQL
The dispatch scenarios require an enrolled online Windows device. Tests use JUnit assumptions when the required device is absent, rather than treating an environment prerequisite as a product failure. They poll for asynchronous agent results through FleetWait and use a generated run identifier to scope test data.
The detailed documents below are generated as part of this module and use the repository documentation hierarchy.
| Area | Purpose | Documentation |
|---|---|---|
| Script Operations | Covers script CRUD-oriented behavior, archive lifecycle, manual and batch dispatch, command dispatch, and cancellation request behavior. | Script Operations Tests |
| Schedule Lifecycle | Covers date-time schedule creation, server defaults, listing and facets, full-replacement updates, archive transitions, and timing validation. | Schedule Lifecycle Tests |
| Schedule Device Targeting | Covers device pickers, idempotent assignment changes, bulk replacement, criteria selection, and platform mismatch rejection. | Schedule Device Targeting Tests |
| Execution History | Covers script execution history, schedule execution and run connections, and populated versus empty facets. | Execution History Tests |
sequenceDiagram
participant Test as "Test Case"
participant API as "GraphQL API"
participant Agent as "Device Agent"
Test->>API: Create script or schedule
Test->>API: Dispatch script or configure targets
API->>Agent: Deliver execution request
Agent->>API: Report execution status and output
Test->>API: Query executions, runs, and facets
Test->>API: Delete created schedules and scripts
Manual execution tests create an echo script whose stored environment marker can be overridden at dispatch time. They verify the returned execution identifier, final result metadata, output, target machine, privilege level, and source. Batch inputs deliberately contain duplicate machine identifiers to confirm a device is dispatched only once. Negative coverage verifies that unknown devices reject an entire batch without partially dispatching to known devices.
Schedules are deliberately created on a future slot, generally one day ahead when device assignments are involved. This keeps targeting tests from unintentionally causing a real execution while still validating the scheduling and selection contracts.
Each test class creates data with an E2E- name containing a unique run identifier. Cleanup is best effort so an assertion failure does not conceal the primary failure; cleanup failures are logged and may leave data in the tenant. The test suite avoids relying on pre-existing scripts or execution history, except where individual general script lifecycle cases intentionally enumerate tenant scripts.
The component implementations are maintained in the OpenFrame OSS Library: