Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions internal/e2e-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# E2E Tests for UI5 CLI

End-to-end test environment for the UI5 CLI containing realistic user scenarios.

## Usage

```bash
npm install
npm run unit
```

## How It Works

Tests are run with the **Node.js built-in test runner**. Each test:

1. Copies a fixture project to a temporary directory (`./tmp`)
2. Runs `npm install` there (child process)
3. Runs `ui5 build` with varying configurations (child process)

The UI5 CLI executables are sourced directly from this repository at `packages/cli/bin/ui5.cjs`.

Some scenarios include multiple sequential builds with file modifications in between to simulate real-world development workflows. Node modules are getting installed on the fly for the first build and reused for subsequent builds (no reinstall).




## Fixtures

Located under `./fixtures/`:

| Fixture | Description |
|---|---|
| `application.a` | Sample JavaScript project (controller + `manifest.json`) |
| `application.a.ts` | Sample TypeScript project (based on [generator-ui5-ts-app](https://github.com/ui5-community/generator-ui5-ts-app)) |

> **Note:** These tests are not yet included in any CI pipeline.
10 changes: 10 additions & 0 deletions internal/e2e-tests/fixtures/application.a.ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "application.a.ts",
"version": "1.0.0",
"description": "UI5 Application: application.a.ts",
"license": "Apache-2.0",
"devDependencies": {
"@openui5/types": "1.115.1",
"ui5-tooling-transpile": "3.11.0"
}
}
21 changes: 21 additions & 0 deletions internal/e2e-tests/fixtures/application.a.ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"moduleResolution": "node",
"skipLibCheck": true,
"allowJs": true,
"strict": true,
"strictNullChecks": false,
"strictPropertyInitialization": false,
"rootDir": "./webapp",
"types": ["@openui5/types", "@types/qunit"],
"paths": {
"application/a/ts/*": ["./webapp/*"],
"unit/*": ["./webapp/test/unit/*"],
"integration/*": ["./webapp/test/integration/*"]
}
},
"include": ["./webapp/**/*"],
"exclude": ["./webapp/coverage/**/*"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
specVersion: "5.0"
metadata:
name: application.a.ts
type: application
builder:
customTasks:
- name: ui5-tooling-transpile-task
afterTask: replaceVersion
server:
customMiddleware:
- name: ui5-tooling-transpile-middleware
afterMiddleware: compression
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type randomTSType = {
first: {
a: number,
b: number,
c: number
},
second: string
}

export default class Main {
onInit(): void {
const z : randomTSType = {
first: {
a: 1,
b: 2,
c: 3
},
second: "test"
};
console.log(z.first.a);
}
}
66 changes: 66 additions & 0 deletions internal/e2e-tests/fixtures/application.a.ts/webapp/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"_version": "1.12.0",
"sap.app": {
"id": "application.a.ts",
"type": "application",
"i18n": "i18n/i18n.properties",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": {
"version": "1.0.0"
}
},
"sap.ui": {
"technology": "UI5",
"icons": {},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
}
},
"sap.ui5": {
"rootView": {
"viewName": "application.a.ts.view.App",
"type": "XML",
"async": true,
"id": "app"
},
"handleValidation": true,
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "application.a.ts.i18n.i18n"
}
}
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "application.a.ts.view",
"controlId": "app",
"controlAggregation": "pages",
"async": true
},
"routes": [
{
"pattern": "",
"name": "main",
"target": "main"
}
],
"targets": {
"main": {
"viewId": "main",
"viewName": "Main"
}
}
}
}
}
15 changes: 15 additions & 0 deletions internal/e2e-tests/fixtures/application.a/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "application.a",
"version": "1.0.0",
"description": "UI5 Application: application.a",
"license": "Apache-2.0",
"dependencies": {
"chart.js": "4.5.1"
},
"devDependencies": {
"@openui5/types": "1.115.1",
"ui5-task-zipper": "3.6.0",
"ui5-tooling-modules": "3.35.0",
"ui5-tooling-stringreplace": "3.6.0"
}
}
10 changes: 10 additions & 0 deletions internal/e2e-tests/fixtures/application.a/ui5-task-zipper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
specVersion: "5.0"
metadata:
name: application.a
type: application
builder:
customTasks:
- name: ui5-task-zipper
afterTask: generateVersionInfo
configuration:
archiveName: "webapp"
12 changes: 12 additions & 0 deletions internal/e2e-tests/fixtures/application.a/ui5-tooling-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
specVersion: "5.0"
metadata:
name: application.a
type: application
server:
customMiddleware:
- name: ui5-tooling-modules-middleware
afterMiddleware: compression
builder:
customTasks:
- name: ui5-tooling-modules-task
afterTask: replaceVersion
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
specVersion: "5.0"
metadata:
name: application.a
type: application
builder:
customTasks:
- name: ui5-tooling-stringreplace-task
afterTask: replaceVersion
configuration:
files:
- "**/*.js"
replace:
- placeholder: ${PLACEHOLDER_TEXT}
value: "'INSERTED_TEXT'"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sap.ui.define([], () => {
return Controller.extend("application.a.controller.Test",{
onInit() {
const z = {
first: {
a: 1,
b: 2,
c: 3
},
second: "test"
};
console.log(z.first.a);
}
});
});

66 changes: 66 additions & 0 deletions internal/e2e-tests/fixtures/application.a/webapp/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"_version": "1.12.0",
"sap.app": {
"id": "application.a",
"type": "application",
"i18n": "i18n/i18n.properties",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": {
"version": "1.0.0"
}
},
"sap.ui": {
"technology": "UI5",
"icons": {},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
}
},
"sap.ui5": {
"rootView": {
"viewName": "application.a.view.App",
"type": "XML",
"async": true,
"id": "app"
},
"handleValidation": true,
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "application.a.i18n.i18n"
}
}
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "application.a.view",
"controlId": "app",
"controlAggregation": "pages",
"async": true
},
"routes": [
{
"pattern": "",
"name": "main",
"target": "main"
}
],
"targets": {
"main": {
"viewId": "main",
"viewName": "Main"
}
}
}
}
}
17 changes: 17 additions & 0 deletions internal/e2e-tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@ui5-internal/e2e-tests",
"private": true,
"license": "Apache-2.0",
"type": "module",
"engines": {
"node": "^22.20.0 || >=24.0.0",
"npm": ">= 8"
},
"scripts": {
"unit": "node --test 'test/**/*.js'",
"unit-watch": "node --test --watch 'test/**/*.js'"
},
"dependencies": {
"adm-zip": "^0.5.17"
}
}
Loading
Loading