git:20260624.61b126a to git:20260806.2ea77f3

46 added, 29 removed. Audit A to A.

---
name: tia-testsuite
description: >
- TIA Portal TestSuite and Application Test operations. Use for managing test sets,
- application tests, style guide rules, and automated system testing workflows.
+ TIA Portal V21 Test Suite operations. Use for Application Tests with PLCSIM,
+ Style Guide rules, System Tests through OPC UA, import/scope management,
+ execution, and recursive result evaluation.
license: MIT
---
- # TIA Portal TestSuite — Automated Testing
+ # TIA Portal Test Suite — Automated Testing
## Scope
- Automated testing using the TIA Portal TestSuite Openness API.
- Covers Application Tests (PLC-based), Style Guide (Static analysis), and System Tests (OPC UA based).
-
- ---
+ The installed `Siemens.Engineering.TestSuite` API covers Application Test,
+ Style Guide, and System Test. These are different execution environments and
+ must not share safety assumptions.
## Reference files
Load ONLY the reference file(s) relevant to the task. Do not load all files at once.
| Reference file | Load when the task involves |
|---|---|
- | `references/application-test.md` | Managing PLC Application Test sets, groups, and cases; executing tests on simulation. |
- | `references/style-guide.md` | Managing and executing Style Guide rule sets; updating rule set files. |
- | `references/system-test.md` | Managing System Test cases; OPC UA server interface validation. |
- | `references/test-results.md` | Accessing and interpreting TestSuite service results and execution states. |
+ | `references/application-test.md` | Application Test sets/cases, PLCSIM execution modes, import, scope, and execution. |
+ | `references/style-guide.md` | Style Guide rule sets, import, scope update, and execution. |
+ | `references/system-test.md` | System Test cases, OPC UA endpoints/interfaces, import, scope, and execution. |
+ | `references/test-results.md` | Recursive result/message interpretation and pass/fail gates. |
- ---
+ ## Installed V21 root
- ## Key Workflows
+ ```csharp
+ TestSuiteService service = project.GetService<TestSuiteService>();
- ### Application Testing
+ ApplicationTestSystemGroup application = service.ApplicationTestGroup;
+ StyleGuideSystemGroup styleGuide = service.StyleGuideGroup;
+ SystemTestSystemGroup system = service.SystemTestGroup;
+ ```
- 1. Locate the `TestSuiteService` on the Project.
- 2. Access `ApplicationTestSets` composition.
- 3. Manage `ApplicationTestSet` and `TestCase` objects.
- 4. Execute tests via `TestCaseExecutor`.
+ The groups are singular properties. Resolve test sets, cases, and rule sets by
+ exact name and expected scope; never select `.First()` or `[0]`.
- ### Style Guide
+ ## Executor ownership
- 1. Access `StyleGuideSystemGroups` on the `TestSuiteService`.
- 2. Manage `RuleSet` objects and compositions.
- 3. Execute checks via `RuleSetExecutor`.
+ Executors are group services:
- ### System Testing
+ ```csharp
+ TestCaseExecutor applicationExecutor =
+ service.ApplicationTestGroup.GetService<TestCaseExecutor>();
+ RuleSetExecutor styleExecutor =
+ service.StyleGuideGroup.GetService<RuleSetExecutor>();
+ SystemTestCaseExecutor systemExecutor =
+ service.SystemTestGroup.GetService<SystemTestCaseExecutor>();
+ ```
- 1. Access `SystemTestSystemGroups` on the `TestSuiteService`.
- 2. Manage `SystemTestCase` objects.
- 3. Execute tests via `SystemTestCaseExecutor`.
+ Every `Run(...)` returns `TestResults`. Apply the recursive result gate from
+ `references/test-results.md`; a returned object alone is not a passing test.
- ## Enforcement
+ ## Permission and safety enforcement
- 1. Verify the existence of the target PLC software or OPC UA server before running tests.
- 2. Properly handle test failures using the `TestResults` and `TestResultsMessage` properties.
+ 1. V21 introduces the `Edit Test Suite data` user right. Require it before importing, deleting, or changing test sets, cases, rule sets, or scope.
+ 2. Treat imported test/rule files as untrusted input. Validate the exact file, provenance, intended objects, load options, and resulting identities before saving the project.
+ 3. `ImportOptions.Override` and scope replacement are destructive. Require explicit project-write authorization and an inventory of affected objects.
+ 4. Application Tests execute through PLCSIM. Require explicit simulator-execution authorization and distinguish system-managed from externally managed instances.
+ 5. System Tests use OPC UA and may target a live controller or other production endpoint. Require explicit live-operation authorization, the exact OPC UA endpoint/interface, credential/security expectations, and an approved test case. Never assume simulation.
+ 6. Style Guide execution is static, but imports and scope changes still mutate the project.
+ 7. Do not save the project unless requested. Do not claim success until top-level and nested result states, counts, and messages all pass the result gate.
+
+ ## Evidence boundary
+
+ Installed V21 assemblies/XML prove API names, signatures, types, and enum members.
+ Project permissions, PLCSIM availability/identity, OPC UA reachability/security,
+ test side effects, and actual results require an authorized runtime test.