Skip to content

Commit cd6fad7

Browse files
authored
test: Add e2e-tests (#1355)
1 parent 40afbdf commit cd6fad7

21 files changed

Lines changed: 7841 additions & 13 deletions
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Internal E2E Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test:
16+
name: Internal E2E Tests
17+
runs-on: ubuntu-24.04
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v6
24+
with:
25+
node-version: 22.20.0
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run e2e-tests
31+
working-directory: internal/e2e-tests
32+
run: npm run test

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,7 @@ internal/documentation/.vitepress/cache
6969
internal/documentation/dist
7070
internal/documentation/schema/*
7171
internal/documentation/docs/api
72-
internal/documentation/tmp
72+
internal/documentation/tmp
73+
74+
# E2E-tests
75+
internal/e2e-tests/tmp

internal/e2e-tests/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# E2E Tests for UI5 CLI
2+
3+
End-to-end test environment for the UI5 CLI containing realistic user scenarios.
4+
5+
## Usage
6+
7+
```bash
8+
npm install
9+
npm run unit
10+
```
11+
12+
## How It Works
13+
14+
Tests are run with the **Node.js built-in test runner**. Each test:
15+
16+
1. Copies a fixture project to a temporary directory (`./tmp`)
17+
2. Runs `npm install` there (child process)
18+
3. Runs `ui5 build` with varying configurations (child process)
19+
20+
The UI5 CLI executables are sourced directly from this repository at `packages/cli/bin/ui5.cjs`.
21+
22+
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).
23+
24+
25+
26+
27+
## Fixtures
28+
29+
Located under `./fixtures/`:
30+
31+
| Fixture | Description |
32+
|---|---|
33+
| `application.a` | Sample JavaScript project (controller + `manifest.json`) |
34+
| `application.a.ts` | Sample TypeScript project (based on [generator-ui5-ts-app](https://github.com/ui5-community/generator-ui5-ts-app)) |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import eslintCommonConfig from "../../eslint.common.config.js";
2+
3+
export default [
4+
{
5+
// Ignore test files and build output
6+
ignores: [
7+
"tmp/",
8+
"fixtures/",
9+
]
10+
},
11+
...eslintCommonConfig, // Load common ESLint config
12+
];

0 commit comments

Comments
 (0)