From aa185fd6f3435776e3a2e9deb51ceadc0e05d14b Mon Sep 17 00:00:00 2001 From: ArnaudBuchholz Date: Thu, 11 Apr 2024 16:40:31 -0400 Subject: [PATCH] feat(e2e): integrate TS tests --- package.json | 4 ++-- test/e2e.js | 26 +++++++++++++++++++++++++- test/sample.js/ui5.yaml | 2 ++ test/sample.ts/ui5.yaml | 2 ++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 025ef751..0a1035d9 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ "test:sample:js:basic-authent": "start-server-and-test 'npm run serve:sample:js:basic-authent' http://localhost:8081 'node . --url http://localhost:8081/test/testsuite.qunit.html --browser $/puppeteer.js --browser-args --basic-auth-username testUsername --browser-args --basic-auth-password testPassword'", "serve:sample:js": "ui5 serve --config ./test/sample.js/ui5.yaml", "serve:sample:js:basic-authent": "reserve --silent --config ./test/sample.js/reserve.json", - "test:sample:ts:remote": "start-server-and-test 'npm run serve:sample:ts' http://localhost:8080 'node . --url http://localhost:8080/test/testsuite.qunit.html'", + "test:sample:ts:remote": "start-server-and-test 'npm run serve:sample:ts' http://localhost:8082 'node . --url http://localhost:8082/test/testsuite.qunit.html'", "serve:sample:ts": "cd ./test/sample.ts && node ui5.cjs serve", - "test:sample:ts:coverage:remote": "start-server-and-test 'npm run serve:sample:ts:coverage' http://localhost:8080 'node . --url http://localhost:8080/test/testsuite.qunit.html --coverage --coverage-check-statements 67'", + "test:sample:ts:coverage:remote": "start-server-and-test 'npm run serve:sample:ts:coverage' http://localhost:8082 'node . --url http://localhost:8082/test/testsuite.qunit.html --coverage --coverage-check-statements 67'", "serve:sample:ts:coverage": "cd ./test/sample.ts && node ui5.cjs serve --config ui5-coverage.yaml", "build:doc": "node build/doc", "clean": "npm uninstall -g ui5-test-runner puppeteer nyc selenium-webdriver playwright webdriverio" diff --git a/test/e2e.js b/test/e2e.js index 41802ed7..cd86846b 100644 --- a/test/e2e.js +++ b/test/e2e.js @@ -70,6 +70,18 @@ const serveWithBasicAuthent = wrapAsPromise(() => { return waitFor('http://localhost:8081') }) +const ui5ServeTs = wrapAsPromise(() => { + const ui5 = join(root, 'test/sample.ts/ui5.cjs') + spawn( + node, + [ui5, 'serve'], + { + stdio: [0, 'pipe', 'pipe'] + } + ) + return waitFor('http://localhost:8082', 10000000) +}) + let port = 8085 const tests = [{ @@ -130,7 +142,7 @@ const tests = [{ tests: [qunitPages(3)] }, { id: 'JS_REMOTE_COVERAGE', - label: 'Remote JS sample', + label: 'Remote JS sample with coverage', before: ui5Serve, utr: '--url http://localhost:8080/test/testsuite.qunit.html --coverage --coverage-check-statements 67', tests: [qunitPages(2), coverage()] @@ -140,6 +152,18 @@ const tests = [{ before: serveWithBasicAuthent, utr: '--url http://localhost:8081/test/testsuite.qunit.html --browser $/puppeteer.js --browser-args --basic-auth-username testUsername --browser-args --basic-auth-password testPassword', tests: [qunitPages(2)] +}, { + id: 'TS_REMOTE', + label: 'Remote TS sample', + before: ui5ServeTs, + utr: '--url http://localhost:8082/test/testsuite.qunit.html', + tests: [qunitPages(2)] +}, { + id: 'TS_REMOTE_COVERAGE', + label: 'Remote TS sample with coverage', + before: ui5ServeTs, + utr: '--url http://localhost:8082/test/testsuite.qunit.html --coverage --coverage-check-statements 67', + tests: [qunitPages(2), coverage()] }].filter(({ id }) => { if (process.env.E2E_ONLY) { return id === process.env.E2E_ONLY diff --git a/test/sample.js/ui5.yaml b/test/sample.js/ui5.yaml index 8ecf6982..8d73e876 100644 --- a/test/sample.js/ui5.yaml +++ b/test/sample.js/ui5.yaml @@ -14,6 +14,8 @@ framework: - name: sap.ui.core - name: themelib_sap_horizon server: + settings: + httpPort: 8080 customMiddleware: - name: "@ui5/middleware-code-coverage" afterMiddleware: compression diff --git a/test/sample.ts/ui5.yaml b/test/sample.ts/ui5.yaml index 34878d2e..b3255078 100644 --- a/test/sample.ts/ui5.yaml +++ b/test/sample.ts/ui5.yaml @@ -10,6 +10,8 @@ framework: - name: sap.ui.core - name: themelib_sap_horizon server: + settings: + httpPort: 8082 customMiddleware: - name: ui5-tooling-transpile-middleware afterMiddleware: compression