sap-fiori-opa5-test-development
Use this skill when writing, fixing, extending, or reviewing OPA5 integration tests for SAP Fiori Elements applications - whether the app uses OData V4…
by SAP★ 162 GitHub stars
Install sap-fiori-opa5-test-development in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
SAP Fiori OPA5 Development Skill
A guide for writing, fixing, and extending OPA5 integration tests for SAP Fiori Elements applications.
Covers both OData V4 (sap.fe.test) and OData V2 (fioriElementsTestLibrary).
Not applicable to freestyle UI5 applications - for those, suggest the ui5-best-practices-opa5 skill from the UI5 Plugins for Coding Agents ui5.
Prerequisites
This skill requires an existing SAP Fiori Elements application generated by SAP Fiori tools with a test folder present (e.g. at webapp/test). If it is missing, follow the version-specific guide after detecting the OData version.
Step 1: Locate the Project Root
When the user provides a project name or ID (e.g. fin.test.rap.lr3) instead of a file path:
- Search for
manifest.jsonfiles under common project roots (e.g.webapp/manifest.json). - Match the
"id"field insap.appto the given name, or look for a folder whose name contains the given ID. - Once found, treat the folder containing
webapp/manifest.jsonas the project root for all subsequent steps.
Step 2: Detect OData Version
Before writing any test code, determine whether the app is OData V4 or V2. The two test libraries are completely different and must never be mixed.
Primary check: manifest.json
| What you find | Version | Test library |
|---|---|---|
"sap.fe.templates" key inside sap.ui5.dependencies.libs |
V4 | sap.fe.test |
"sap.ui.generic.app" as a root key |
V2 | fioriElementsTestLibrary |
Fallback check: metadata.xml
If manifest.json is inconclusive, check the <edmx:Edmx> root element in the service metadata file (typically at webapp/localService/mainService/metadata.xml, or wherever metadataPath points in ui5-mock.yaml):
| Attribute value | Version |
|---|---|
xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" or Version="4.0" |
V4 |
xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" or Version="1.0" |
V2 |
These attributes appear on line 1 or 2 of the file.
If neither signal is present, ask the user to confirm the OData version before proceeding.
Step 3: Follow the Matching Guide
Once the version is confirmed:
- Read the shared sections further below ("Test Endpoint and Running Tests", "Mock Server") - they apply to both V4 and V2.
- Then read the version-specific guide for all test library decisions:
- OData V4 - read
references/v4-instructions.md - OData V2 - read
references/v2-instructions.md
- OData V4 - read
Adding a New Journey
When the user asks to add an additional journey (not just a new opaTest inside an existing journey):
- Find the test root - search for files matching
*Journey.js,*Journey.ts,*Journey.gen.js, or*Journey.gen.tsin the project. The folder containing those files is the integration test root. These files typically live in a folder namedintegrationwithin the test directory, e.g.webapp/test/integration. - Understand the wiring - read the existing journey files and any entry point files to understand how journeys are registered. Three setups are possible:
- Virtual endpoint (V4) - no registration needed; the middleware picks up any file matching the configured pattern (default: ends in
Journey.jsorJourney.ts) - Physical entry point (V4) - add the new journey's module path to the
sap.ui.requirearray inOpaTests.qunit.js - Custom wiring (e.g. S/4 apps with
AllJourneys.jsorAllJourneys.json) - follow the existing pattern
- Virtual endpoint (V4) - no registration needed; the middleware picks up any file matching the configured pattern (default: ends in
- Create the journey file following the same naming pattern as existing journeys.
- Confirm to the user which file was created and how it is registered (or that registration is automatic).
General Anti-Patterns (V4 and V2)
These apply regardless of OData version or test library.
Never invent method names. Only use methods that are confirmed to exist in the test library. If a method is not shown in the quick-reference patterns, do NOT guess or construct a name - look it up first:
- V4: check
references/v4-standard-patterns.mdfor common patterns. If the method is not there, checkreferences/v4-custom-selectors.mdfor custom selector patterns. If still not found, readreferences/v4-sap-fe-test-api-guide.mdand consult the officialsap.fe.testAPI documentation it points to. A method that "sounds right" is not sufficient — it must be confirmed to exist. - V2: check
references/fiori-elements-v2-test-library.mdwhich contains the full API reference for all V2 page objects.
Invented methods fail silently with a "not a function" runtime error that is hard to diagnose.
Every opaTest must have at least one Then assertion. A test with only Given/When steps reports 0 assertions and fails silently.
// ❌ No Then = no assertions, test fails
opaTest("Click button", function(Given, When, Then) {
When.onThePage.iClickButton();
});
// ✅ Always end with a
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- references/fiori-elements-v2-test-library.md
- references/v2-instructions.md
- references/v4-custom-selectors.md
- references/v4-instructions.md
- references/v4-journeyrunner.md
- references/v4-sap-fe-test-api-guide.md
- references/v4-standard-patterns.md
FAQ
What does the sap-fiori-opa5-test-development skill do?
Use this skill when writing, fixing, extending, or reviewing OPA5 integration tests for SAP Fiori Elements applications - whether the app uses OData V4 (sap.fe.test library) or OData V2 (fioriElementsTestLibrary). Triggers on any request involving OPA5 journeys, page objects, JourneyRunner setup, test structure, mock data, or debugging test failures in a SAP Fiori Elements project generated by SAP Fiori tools. Use even when the user says "write integration tests" or "add an OPA journey" without specifying the library, as long as the project context is SAP Fiori Elements. Not applicable to freestyle UI5 apps.
How do I install the sap-fiori-opa5-test-development skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the sap-fiori-opa5-test-development skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…