-
Notifications
You must be signed in to change notification settings - Fork 4
SED-4885 Creating plan samples for RPA #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
8fe5261
0eb0430
1a9dbc1
29687c7
829c5a1
cd3b63c
74a2250
3c50835
b89c699
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # Step plan samples | ||
|
|
||
| This directory is about one thing: **how to write a Step plan**. | ||
|
|
||
| A **plan** is the implementation of an automation scenario — a functional test case, a load | ||
| test, an RPA routine, a synthetic monitoring probe. It combines **keywords**, the building | ||
| blocks that do the work, with **controls** that build up the execution logic: loops, | ||
| branches, retries, waits. | ||
|
|
||
| Every sample here ships as a runnable automation package, so each plan can be validated and | ||
| executed rather than just read. Keyword code is deliberately reduced to 3-line stubs so the | ||
| plan itself is the subject. | ||
|
|
||
| ### How this differs from `automation-packages/` | ||
|
|
||
| [automation-packages/](../automation-packages/) holds **complete real-world blueprints** — | ||
| a full project for a given use case and stack (load testing with Playwright/TypeScript, | ||
| synthetic monitoring with Cypress, RPA with Selenium), including its build, its keywords and | ||
| its plans. That is where you go to start a project. | ||
|
|
||
| This directory is the **plan-authoring reference**: one plan concept per sample, stripped of | ||
| everything else. That is where you go while writing a plan. | ||
|
|
||
| ## Samples by use case | ||
|
|
||
| | Use case | Samples | Status | | ||
| |----------|---------|--------| | ||
| | [**RPA**](rpa/) | 7 samples — loops, branching, resilience, sessions, scheduling, reuse | available | | ||
| | [**Load testing**](load-testing/) | 6 samples — thread groups, scenarios, data sets, measurements, SLA gates | available | | ||
| | Functional testing | — | planned | | ||
| | Monitoring | — | planned | | ||
|
|
||
| ## Reference | ||
|
|
||
| For what each control does and how to configure it, see the official | ||
| [controls documentation](https://step.dev/knowledgebase/userdocs/plans/controls/). | ||
|
|
||
| [reference/](reference/) holds small standalone YAML plans illustrating the syntax: | ||
|
|
||
| | File | Shows | | ||
| |------|-------| | ||
| | [reference/basic-plan-syntax.yml](reference/basic-plan-syntax.yml) | The shape of a plan: root artefact, `callKeyword` with inputs, capturing an output, `if`, `assert`, `check` | | ||
| | [reference/dynamic-values.yml](reference/dynamic-values.yml) | Static values vs `expression:`, where plan variables come from, dynamic keyword names and `routing` | | ||
| | [reference/performance-assert.yml](reference/performance-assert.yml) | A `threadGroup` with a `performanceAssert` — the load-testing shape, and the `after`-block rule | | ||
|
|
||
| ## Plan formats | ||
|
|
||
| Step has three plan formats: | ||
|
|
||
| | Format | Written as | Used by these samples | | ||
| |--------|-----------|-----------------------| | ||
| | **YAML** | The tree of controls documented at [step.dev](https://step.dev/knowledgebase/userdocs/plans/controls/) | Yes — the whole `rpa/` and `load-testing/` sets | | ||
| | **Plain text** | A compact line-based syntax, one keyword call per line | No | | ||
| | **UI** | Built in the Step plan editor; [imported and exported](https://step.dev/knowledgebase/userdocs/import-export-entities/) as JSON | No — see [legacy-exports/](legacy-exports/) for what an export looks like | | ||
|
|
||
| **Automation packages support YAML and plain text.** Editing an automation package's plans in | ||
| the UI is planned but not currently supported. | ||
|
|
||
| ### Where a YAML plan lives | ||
|
|
||
| Inside an automation package, a YAML plan can be declared either way: | ||
|
|
||
| ```yaml | ||
| plans: # directly in the main descriptor | ||
| - name: "My plan" | ||
| root: | ||
| testCase: | ||
| children: [] | ||
|
|
||
| fragments: # or pulled in from a fragment file | ||
| - "plans/my-plan.yml" | ||
| ``` | ||
|
|
||
| A **standalone YAML plan** — a file with a top-level `root:`, like the three in | ||
| [reference/](reference/) — is not a separate format. It is the same tree, and it can be | ||
| either incorporated into an automation package like any other plan, or created centrally in | ||
| the Step UI with **Add plan → Create from YAML**. | ||
|
|
||
| Plain-text plans are declared with `plansPlainText`, each entry naming a `file`, a `name` and | ||
| a `rootType`: | ||
|
|
||
| ```yaml | ||
| plansPlainText: | ||
| - name: "Open the site" | ||
| file: "plans/open-site.plan" | ||
| rootType: TestCase | ||
| ``` | ||
|
|
||
| ## Schema | ||
|
|
||
| All YAML here targets Automation Package schema **1.2.0**. Any Step instance serves its own | ||
| schema at: | ||
|
|
||
| ``` | ||
| <your-step-instance>/rest/automation-packages/schema | ||
| ``` | ||
|
|
||
| Point your IDE at it to get completion and validation while editing | ||
| `automation-package.yaml`. | ||
|
|
||
| ## Frontmatter | ||
|
|
||
| Each sample README carries the same descriptor block used across this repository (see | ||
| [automation-packages/README.md](../automation-packages/README.md)), plus `focus: plans` to | ||
| mark it as plan-authoring material rather than a technology sample: | ||
|
|
||
| ```yaml | ||
| --- | ||
| use-case: rpa | ||
| focus: plans | ||
| framework: none | ||
| language: groovy | ||
| target-platform: web | ||
| approach: keyword-driven | ||
| level: beginner | ||
| --- | ||
| ``` | ||
|
|
||
| ## Running a sample | ||
|
|
||
| ```bash | ||
| step ap execute -p <sample-dir> -u <your-step-url> --token <your-token> --projectName <your-project> | ||
| ``` | ||
|
|
||
| `--includePlans` runs a subset. It is comma-separated, so plan names containing a comma | ||
| cannot be selected individually — worth avoiding when naming plans. | ||
|
|
||
| `execute` runs the plans and nothing else. To register a package in a project — its plans, | ||
| keywords, **schedules** and parameters — deploy it: | ||
|
|
||
| ```bash | ||
| step ap deploy -p <sample-dir> -u <your-step-url> --token <your-token> --projectName <your-project> | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Legacy plan exports | ||
|
|
||
| Two plans exported from the Step plan editor as JSON. | ||
|
|
||
| | File | Plan | | ||
| |------|------| | ||
| | `Demo_Google-search.json` | A sequence calling an Echo keyword and asserting on its output | | ||
| | `Demo_Data-driven.json` | A data-driven plan iterating over a data source | | ||
|
|
||
| JSON is the format Step uses to **import and export** plans. It is not meant for authoring — | ||
| these two files are kept only as a sample of the shape. | ||
|
|
||
| For how to produce and consume such files — exporting single or bulk entities, exporting a | ||
| plan recursively with the entities it references, and the import options — see | ||
| [Import/Export entities](https://step.dev/knowledgebase/userdocs/import-export-entities/) in | ||
| the Step documentation. | ||
|
|
||
| To write a plan, use YAML: | ||
|
|
||
| - [../reference/](../reference/) — the YAML syntax reference | ||
| - [../rpa/](../rpa/) — worked, runnable samples | ||
|
|
||
| See the [plans README](../README.md) for how the three plan formats relate. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| use-case: load-testing | ||
| focus: plans | ||
| framework: none | ||
| language: groovy | ||
| target-platform: api | ||
| approach: keyword-driven | ||
| level: beginner | ||
| --- | ||
|
|
||
| # 01 — First load test | ||
|
|
||
| The baseline shape of a load-testing plan: a thread group repeats one transaction, from several | ||
| virtual users at once, and the plan states the SLA that transaction has to meet. Every other | ||
| sample in this set builds on this structure. | ||
|
|
||
| **The lesson is the commented [`automation-package.yaml`](automation-package.yaml)** — read that | ||
| for the reasoning at each node. This page orients you and collects the reference tables. The | ||
| keywords are 3-line Groovy stubs simulating a shop API, so the package runs on any Java agent — | ||
| no build, no browser, no system under test. | ||
|
|
||
| ## What it covers | ||
|
|
||
| - `threadGroup` as the root of a load plan, with `users` and `iterations` | ||
| - choosing what one iteration contains — the unit your load numbers are denominated in | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. refer to the comment in the YAML, this is really not clear for me |
||
| - `instrumentNode` for an end-to-end transaction measurement | ||
| - `performanceAssert` as the SLA gate, and the two rules about where it may go | ||
| - why a load test still needs a functional `assert` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use plural |
||
|
|
||
| ## Where measurements come from | ||
|
|
||
| | Measurement | Named after | Created by | Can carry a `performanceAssert` | | ||
| |-------------|-------------|-----------|-------------------------------| | ||
| | Keyword call | the **keyword** | Step, automatically, for every call | yes | | ||
| | Instrumented node | the node's `nodeName` | `instrumentNode: true` | **no** — dashboards only | | ||
| | Custom | whatever the keyword chooses | the keyword itself — see [05](../05-measurements/) | yes | | ||
|
|
||
| ## Two rules for `performanceAssert` | ||
|
|
||
| 1. **It must live in an `after` or `afterThread` block.** Anywhere else the run ends in | ||
| `TECHNICAL_ERROR`: `PerformanceAssert can only be defined in an 'after' or 'after thread' block`. | ||
| `after` runs once when the thread group finishes (run-wide SLA); `afterThread` runs once per | ||
| virtual user. | ||
| 2. **`measurementName` must name a keyword or custom measurement**, never an `instrumentNode` one — | ||
| that fails with `No measurement is matching the defined filters.`, the same message a misspelled | ||
| name gives. For an SLA on a multi-step transaction, emit a custom measurement — see | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I only checked the sample 01 and 05 at the time of writing this, but composite keyword could be used instead |
||
| [05](../05-measurements/). | ||
|
|
||
| Set `continueOnError: true` on the `after` block, or it stops at the first breach and hides the | ||
| rest. Bound thresholds on both sides — an upper bound alone passes when the measurement is empty. | ||
|
|
||
| ## Key files | ||
|
|
||
| | File | Purpose | | ||
| |------|---------| | ||
| | `automation-package.yaml` | The plan — heavily commented, this is what to read | | ||
| | `keywords/searchProducts.groovy` | Returns a product id | | ||
| | `keywords/addToCart.groovy` | Returns a cart id | | ||
| | `keywords/checkout.groovy` | Returns an order id and `CONFIRMED` | | ||
|
|
||
| ## Running it | ||
|
|
||
| ```bash | ||
| step ap execute -p . -u <your-step-url> --token <your-token> --projectName <your-project> | ||
| ``` | ||
|
|
||
| The report should show 6 passing transactions, 18 passing keyword calls and three passing | ||
| performance asserts. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" of the plan itself" sounds weird, especially singular in this context.