Modernizes QUnit unit tests and OPA5 integration tests to the UI5 Test Starter concept. Use when linter reports prefer-test-starter or when tests use manual bootstrapping.
Ships in ui5-modernization. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill modernizes a UI5 project's entire test infrastructure — both unit tests and OPA5 integration tests — to the Test Starter concept.
Reference: Blog post: Simplify Your Test Setup
The Test Starter replaces per-test HTML bootstrapping with a single generic test page and a declarative testsuite.qunit.js configuration. Benefits: eliminates boilerplate HTML/JS, handles QUnit/Sinon/coverage setup automatically, ensures CSP compliance, provides consistent configuration, enables per-test isolation and parallel execution.
OPA5 test HTML files are ALWAYS convertible — they follow a mechanical pattern. Invalid excuses: "complex mock server" (lives in host, not entry point), "sap.ui.define monkey-patching" (same), "FLP sandbox bootstrap" (same), "too many files" (batch-process), "too complex" (invalid).
| Type | Example | Action |
|---|---|---|
| Test Driver | opa/<Area>/<TestName>.qunit.html | CONVERT to Test Starter |
| Test Host | test<ServiceName>.html | KEEP AS-IS (app-under-test in iframe) |
| Test Suite | testsuite.qunit.html | REPLACE with testsuite.qunit.js |
| Dev Sandbox | flpSandbox.html | IGNORE |
The only real technical challenge: OPA5 entry points may use jQuery.sap.require() for QUnit bootstrap libs — replace with sap.ui.require or note that Test Starter loads them automatically.
Read manifest.json → sap.app/id. This is your namespace:
<NAMESPACE> — dots → slashes (e.g., my.app → my/app)<NAMESPACE-WITH-DOTS> — raw value with dotsLook for webapp/test/unit/ containing unitTests.qunit.html, unitTests.qunit.js, allTests.js, AllTests.js, or allTests.qunit.js. Identify all legacy aggregator files — JS files whose only purpose is loading other test modules via sap.ui.require/sap.ui.define with no actual test logic (QUnit.module, QUnit.test, assert.*). Their contents will be inlined into unitTests.qunit.js and the files deleted.
Phase 5b is gated on needsIframeMigration = (launcher === "in-window" AND flpSandbox === true).
node <skill-dir>/scripts/parse-testsuite.js --detect-launcher webapp/test > /tmp/launcher.json
Returns { "launcher": "iframe"|"in-window"|"mixed"|"none", "flpSandbox": true|false, "needsIframeMigration": true|false }.
launcher | flpSandbox | Action |
|---|---|---|
iframe | any | Pattern I — Phase 5 only, skip 5b |
in-window | true | Pattern U — Phase 5 + Phase 5b |
in-window | false | Plain in-window — skip 5b, leave iStartMyUIComponent |
mixed | any | Halt. Log to MODERNIZATION_ISSUES.md, ask developer to reconcile |
none | any | No OPA tests — skip OPA phases |
Pattern U + Pattern B is unsupported. If needsIframeMigration === true and Phase 0.3 reports Pattern B, halt and surface to the developer.
Pattern A — "Single HTML + AllJourneys": opaTests.qunit.html + AllJourneys.js orchestrator.
Pattern B — "Many Individual HTML Files": Multiple *.qunit.html under webapp/test/opa/.
Detection:
find webapp/test -name "AllJourneys.js" -o -name "AllJourneys.json"
find webapp/test/opa -name "*.qunit.html" -type f 2>/dev/null | wc -l
node <skill-dir>/scripts/parse-testsuite.js <testsuite.qunit.html> <test-base-dir> <namespace>
Outputs: pattern (A/B), summary (counts), entries (module→config mapping), opaConfig (for Pattern A). Save this — it drives the rest.
node <skill-dir>/scripts/parse-testsuite.js --scan-bootstrap-overrides webapp/test > /tmp/bootstrap-overrides.json
Detects: sap.ui.define = ..., sap.ui.require = ..., defineModuleSync(...). Append each finding to MODERNIZATION_ISSUES.md. Do NOT rewrite overrides — reporting is the deliverable.
Lists all tests: unit tests delegated via "unit/unitTests", OPA journeys listed individually. Build OPA entries from parse script output — key = relative path from webapp/test/ without .qunit.js.
sap.ui.define(function() {
"use strict";
return {
name: "QUnit test suite for <NAMESPACE-WITH-DOTS>",
defaults: {
page: "ui5://test-resources/<NAMESPACE>/Test.qunit.html?testsuite={suite}&test={name}",
qunit: { version: 2 },
sinon: { version: 4 },
ui5: { theme: "sap_horizon" },
loader: {
map: { "*": {
"sap/ui/thirdparty/sinon": "sap/ui/thirdparty/sinon-4",
"sap/ui/thirdparty/sinon-qunit": "sap/ui/qunit/sinon-qunit-bridge"
}},
paths: { "<NAMESPACE>": "../" }
},
coverage: { only: ["<NAMESPACE>"], never: ["<NAMESPACE>/test"] }
},
tests: {
// ----- Unit Tests -----
"unit/unitTests": { title: "Unit Tests" },
// ----- OPA Integration Tests -----
"integration/NavigationJourney": { title: "Navigation Journey" }
}
};
});
Read references/testsuite-configuration.md for detailed option explanations.
Key points:
page MUST use ui5:// protocol prefixmodule property needed — Test Starter appends .qunit to entry keys{suite} and {name} placeholders are mandatoryMANDATORY. Extract ALL resource root mappings from ALL test HTML files:
grep -rh "data-sap-ui-resourceroots" webapp/test/ --include="*.html"
Convert dot-notation keys to slash-notation, add to loader.paths. All values resolve relative to Test.qunit.html (at webapp/test/) — recompute paths from subdirectory HTMLs accordingly.
If two HTMLs define the same key with different values, prefer the main testsuite.qunit.html/opaTests.qunit.html value. Minority tests get per-test loader.paths overrides.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../resources/sap/ui/test/starter/runTest.js"
data-sap-ui-resource-roots='{ "test-resources.<NAMESPACE-WITH-DOTS>": "./" }'
></script>
</head>
<body class="sapUiBody">
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QUnit test suite for <NAMESPACE-WITH-DOTS></title>
<script src="../resources/sap/ui/test/starter/createSuite.js"
data-sap-ui-testsuite="test-resources/<NAMESPACE>/testsuite.qunit"
data-sap-ui-resource-roots='{ "test-resources.<NAMESPACE-WITH-DOTS>": "./" }'
></script>
</head>
<body></body>
</html>
A redundant aggregator has NO actual test logic — only sap.ui.require([deps], function() { QUnit.start(); }) or load-only sap.ui.define. QUnit.config.autostart = false + QUnit.start() are boot scaffolding, NOT test logic.
Action: Note the test modules they load (for unitTests.qunit.js), then DELETE both .js and companion .html immediately.
Files with actual test logic (QUnit.module, QUnit.test, assert.*) need:
.qunit.js suffix (e.g., App.controller.js → App.controller.qunit.js)sap.ui.define (remove QUnit.config.autostart, Core.ready wrappers)// Before (App.controller.js)
QUnit.config.autostart = false;
sap.ui.getCore().attachInit(function() {
sap.ui.require(["my/app/model/formatter"], function(formatter) {
QUnit.module("formatter");
QUnit.test("formatValue", function(assert) { ... });
});
});
// After (App.controller.qunit.js)
sap.ui.define(["my/app/model/formatter"], function(formatter) {
"use strict";
QUnit.module("formatter");
QUnit.test("formatValue", function(assert) { ... });
});
Directly lists all real unit test modules (from deleted aggregators + any additional .qunit.js files):
sap.ui.define([
"./controller/Main.qunit",
"./model/formatter.qunit"
]);
Rules: relative ./ paths, include .qunit suffix (without .js).
If old testsuite.qunit.js used jsUnitTestSuite, it's already replaced in Phase 1. Delete old content.
Read references/pattern-a-modernization.md for detailed instructions.
Opa5.extendConfig + page object imports. OpaSetup MUST NOT import sap/ui/test/opaQunit..qunit.js"./OpaSetup" as side-effect dependency (relative path)Opa5.extendConfig// OpaSetup.js (no opaQunit!)
sap.ui.define(["sap/ui/test/Opa5", "test-resources/<NAMESPACE>/integration/pages/App"
], function(Opa5) {
"use strict";
Opa5.extendConfig({ viewNamespace: "<APP-NAMESPACE>.view.", autoWait: true });
});
// Journey file (opaQunit here, OpaSetup relative)
sap.ui.define(["sap/ui/test/opaQunit", "sap/ui/test/Opa5", "./OpaSetup"
], function(opaTest, Opa5) {
"use strict";
// opaTest(...) calls
});
Read references/pattern-b-modernization.md for detailed instructions.
Opa5.createPageObjectsOpa5.extendConfig.qunit.js, add OpaSetup dependencyautoWaitFalseFiles*Combined names). See references/pattern-b-modernization.md Step 6.Run only when Phase 0.2 reported needsIframeMigration: true.
Read references/pattern-u-iframe-migration.md for full instructions. Summary:
opaIframe.qunit.html + opaIframeBoot.js — bare-Component iframe. HTML loads sap/ushell sandbox.js for stubs, no sap-ushell-config. Boot module runs mockserver.init() → new ComponentContainer(...).placeAt("content"). CSP-clean: data-sap-ui-oninit="module:...", no inline script.arrangements/Common.js — iStartMyApp → iStartMyAppInAFrame(...). Drop mockserver import, drop _clearSharedData.iStartMyUIComponent({...}) → iStartMyApp() (forward hash/autoWait).waitFor callbacks must resolve via Opa5.getWindow().sap.ui.require(...). OPA-safe deps kept in parent: sap/ui/test/*, sap/ui/core/routing/History. Gate: node <skill-dir>/scripts/detect-cross-window-imports.js <project-root>.$(...), document.*, window.* with Opa5.getJQuery()(...), Opa5.getWindow().*.#app-tile&/ prefix.sap-message envelopes — POST handlers need sap-message header for message collectors.getElementsByTagName("message")[0].firstChild.data against null.<NAMESPACE>/test/integration/opaIframe in loader.paths.Items 5–9 are project-specific; apply mechanically per detection grep in reference file.
unitTests.qunit.html, legacyTests.qunit.html (legacy bootstraps)opaTests.qunit.html, AllJourneys.js, AllJourneys.jsonneedsIframeMigration)flpSandbox.qunit.html if it exists from prior attemptiStartMyUIComponent*.qunit.html under webapp/test/opa/ (count must match summary.totalActive)testsuite.qunit.html (updated), Test.qunit.html (created)testsuite.qunit.js match parse script's OPA total.node <skill-dir>/scripts/check-dangling-entries.js webapp/test — exit 0 = OK.npx @ui5/linter — no prefer-test-starter warnings remain.Test.qunit.html → runTest.js; testsuite.qunit.html → createSuite.js; testsuite.qunit.js → unit delegate + OPA journeys; all unit files use sap.ui.define; OpaSetup.js exists; every journey imports it; no stale HTML remains.needsIframeMigration):
opaIframe.qunit.html + opaIframeBoot.js exist; no inline <script> body; no window["sap-ushell-config"]grep -rn "iStartMyUIComponent\b" webapp/test → zero hitsgrep -rn "#app-tile&/" webapp/test → zero hitsmockserver.init() only in opaIframeBoot.jsloader.paths alias for opaIframe/flpSandboxdetect-cross-window-imports.js exits 0Namespace: com.mycompany.myapp, 4 OPA journeys + 2 unit tests.
After: testsuite.qunit.js → 5 entries (1 unit + 4 OPA). AllJourneys.js → OpaSetup.js + individual entries. Deleted: AllJourneys.json, opaTests.qunit.html, unitTests.qunit.html.
Namespace: com.mycompany.myapp, 45 OPA journeys + 3 unit tests.
After: testsuite.qunit.js → 46 entries (1 unit + 45 OPA). OpaSetup.js = union of utility imports. 3 journeys with autoWait: false override. Deleted: 46 HTML files + unitTests.qunit.html.
runTest.js vs createSuite.js: createSuite.js = testsuite overview. runTest.js = Test.qunit.html for individual tests..qunit.js suffix rule: Only testsuite entry keys need .qunit.js. Dependencies loaded via sap.ui.define (page objects, OpaSetup.js) keep plain .js..qunit in dependency paths: "./FilterBar.qunit" resolves to FilterBar.qunit.js. Without suffix → file not found.test-resources/ prefix: Deps under webapp/test/ use test-resources/<NAMESPACE>/... not <NAMESPACE>/test/....<NAMESPACE>/test/ deps: After Phase 5, scan ALL test .js files and convert to test-resources/<NAMESPACE>/.test-resources/: Same-directory → ./. Cross-directory → test-resources/<NAMESPACE>/....sap/ui/test/opaQunit — belongs in each journey file.| # | Check |
|---|---|
| 1 | Test.qunit.html exists with runTest.js |
| 2 | testsuite.qunit.html uses createSuite.js |
| 3 | testsuite.qunit.js has "unit/unitTests" + all OPA journeys |
| 4 | No redundant aggregators remain |
| 5 | No stale test HTML bootstraps remain |
| 6 | unitTests.qunit.js references only real test files |
| 7 | OPA entry count matches parse script total |
| 8 | Dangling-entry check passes (exit 0) |
| 9 | Bootstrap overrides reported in MODERNIZATION_ISSUES.md (if any) |
| 10 | Launcher + FLP classified; mixed halted |
| 11 | If needsIframeMigration: iframe files exist, no inline script, no iStartMyUIComponent |
| 12 | If needsIframeMigration: no FLP hash prefix, no loader alias |
| 13 | If needsIframeMigration: ErrorHandler guarded or flagged |
| 14 | If needsIframeMigration: detect-cross-window-imports.js exits 0 |
sap.* globals the linter reports.references/linter-invisible-patterns.md (opens in a new tab)references/pattern-a-modernization.md (opens in a new tab)references/pattern-b-modernization.md (opens in a new tab)references/pattern-u-iframe-migration.md (opens in a new tab)references/testsuite-configuration.md (opens in a new tab)scripts/check-dangling-entries.js (opens in a new tab)scripts/check-dangling-entries.test.js (opens in a new tab)scripts/detect-cross-window-imports.js (opens in a new tab)scripts/detect-cross-window-imports.test.js (opens in a new tab)scripts/parse-testsuite.js (opens in a new tab)scripts/parse-testsuite.test.js (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ui5-test-starter, qunit-modernization, opa5, test-migration, ui5-testing
19 skills in this plugin
/fix-bootstrap-paramsFix HTML bootstrap parameter issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
- `no-deprecated-api` - For missing/deprecated bootstrap parameters (async, compat-version, animation, binding-syntax, etc.)
- `no-deprecated-theme` - For deprecated theme values in data-sap-ui-theme
- `no-deprecated-library` - For deprecated libraries in data-sap-ui-libs
Trigger on error messages containing: "Missing bootstrap parameter", "Abandoned bootstrap parameter", "Redundant bootstrap parameter", "deprecated value", "bootstrap"
Automatically applies safe fixes to HTML files containing UI5 bootstrap script tags.
/fix-component-asyncFix Component.js async configuration issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
- `async-component-flags` - For missing IAsyncContentCreation interface, missing manifest declaration, redundant async flags, async:false errors
- `no-removed-manifest-property` - For async flags in inline manifest v2
Trigger on Component.js files with errors about async loading, IAsyncContentCreation, manifest declaration.
Automatically adds the IAsyncContentCreation interface and configures manifest properly.
/fix-control-rendererFix Control renderer issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
- `no-deprecated-control-renderer-declaration` - For missing renderer declaration, string-based renderer declaration, implicit renderer auto-discovery (removed in modern UI5)
- `no-deprecated-api` - For missing apiVersion:2 in renderer objects, missing IconPool import when using oRm.icon(), deprecated rerender() override. NOTE: For Library.init() apiVersion errors, use fix-library-init instead.
- `ui5-class-declaration` - For non-static renderer property in ES6 classes
Trigger on: "missing a renderer declaration", "Deprecated declaration of renderer", "deprecated renderer", "apiVersion" (in renderer context), "IconPool", "rerender", "renderer must be a static property"
Converts legacy renderer patterns to modern apiVersion: 2 format with proper module imports.
/fix-csp-complianceFix Content Security Policy (CSP) compliance issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs:
- `csp-unsafe-inline-script` with message "Use of unsafe inline script"
Trigger on: inline JavaScript in HTML files, script tags without src attribute, onclick/onload handlers in HTML.
Also use when user mentions 'security headers', 'inline script warning', 'CSP policy', 'unsafe-inline', or 'Content-Security-Policy'.
Provides guidance on moving inline scripts to external files for CSP compliance.
/fix-cyclic-depsDetect and resolve cyclic module dependencies introduced during UI5 modernization.
Trigger when user mentions: "cyclic dependency", "circular import", "undefined module at runtime",
"lazy require", "sap.ui.require sync", "import cycle", or when a module returns undefined despite
a correct import path. Classic symptom: a module is `undefined` at runtime despite a correct
sap.ui.define import path.
Auto-fixes 2-node cycles (A↔B) by converting the lesser-used edge to lazy sap.ui.require().
Auto-fixes longer chains (3+ nodes) via hub-based approach. Reports unfixable chains to
MODERNIZATION-ISSUES.md. Runs as Phase 3, Step 3.3 (final step) after all other Phase 3 steps.
/fix-deprecated-controlsFix deprecated control/class/interface/type issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs:
- `no-deprecated-api` with messages about deprecated class, interface, type, property, or property of class
- Messages like "Use of deprecated class '...'", "Use of deprecated interface '...'", "Use of deprecated property '...'"
Trigger on: deprecated control usage in JS `new` expressions, deprecated properties in constructor settings, deprecated interfaces/types in metadata, deprecated controls/properties in XML views, sap.m.MessagePage modernization to IllustratedMessage.
Use this skill whenever you see 'deprecated class', 'deprecated property', 'deprecated interface', or 'deprecated type' in linter output, even if the user doesn't explicitly mention deprecation.
Provides replacement guidance for deprecated UI5 controls and their properties.
/ui5-ui5-modernization-plugins-ui5-modernization:modernize-test-starterfrom ui5-modernization
Generated from the plugin's indexed repository (ui5/plugins-coding-agents) — no native marketplace selected
npx claudepluginhub p/ui5-ui5-modernization-plugins-ui5-modernizationOther plugins' skills for the same job