-
Notifications
You must be signed in to change notification settings - Fork 77
test: Add e2e-tests #1355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maxreichmann
wants to merge
5
commits into
main
Choose a base branch
from
test/e2e-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
test: Add e2e-tests #1355
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f084bc1
test: Add e2e-tests
maxreichmann 1e7aace
test: Ignore tmp folder in .gitignore
maxreichmann 6886c31
test: Address Review (refactor env variables + post-test cleanup)
maxreichmann de4fb7c
ci: Create workflow for internal/e2e-tests
maxreichmann 630d0d2
docs: Refactor e2e README (Address review)
maxreichmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
21
internal/e2e-tests/fixtures/application.a.ts/tsconfig.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/**/*"] | ||
| } |
12 changes: 12 additions & 0 deletions
12
internal/e2e-tests/fixtures/application.a.ts/ui5-tooling-transpile.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
22 changes: 22 additions & 0 deletions
22
internal/e2e-tests/fixtures/application.a.ts/webapp/controller/Test.controller.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
66
internal/e2e-tests/fixtures/application.a.ts/webapp/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
10
internal/e2e-tests/fixtures/application.a/ui5-task-zipper.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
12
internal/e2e-tests/fixtures/application.a/ui5-tooling-modules.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
14 changes: 14 additions & 0 deletions
14
internal/e2e-tests/fixtures/application.a/ui5-tooling-stringreplace.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'" |
16 changes: 16 additions & 0 deletions
16
internal/e2e-tests/fixtures/application.a/webapp/controller/Test.controller.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
66
internal/e2e-tests/fixtures/application.a/webapp/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.