Using Cycle Properties
What are Cycle properties?
Step plugins accept inputs for steps from three sources:
- CycleScript step parameters
- Cycle variables
- Cycle properties
These mechanisms are defined in the Writing OpenAPI Specs page.
Cycle properties are special values provided by the Cycle engine. They come from sources such as Cycle project settings and execution settings. For example, _CYCLE_DEFAULT_OUTPUT_DIR is the Cycle property for the current Cycle project's default output directory where screenshot files are saved.
Each Cycle property has a name that starts with _CYCLE_. They can have the same types as variables: string or number. Steps in a step plugin can require a Cycle property as an input by its name, just as if it were a regular Cycle variable. For example, the following step requires _CYCLE_DEFAULT_OUTPUT_DIR as a request body input:
/sessions/start-local:
post:
tags: [WebDriver]
operationId: startLocal
x-cycle-steps:
- I open {browser} web browser
x-cycle-step-ids: [138]
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
browser:
$ref: "#/components/schemas/BrowserType"
_CYCLE_DEFAULT_OUTPUT_DIR:
description: Absolute path to the default output directory for screenshots.
type: string
required:
- browser
- _CYCLE_DEFAULT_OUTPUT_DIR
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/StepResponse'