Skip to content

Commit

Permalink
feat(e2e): integrate TS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Apr 11, 2024
1 parent 90c9c1e commit aa185fd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
26 changes: 25 additions & 1 deletion test/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [{
Expand Down Expand Up @@ -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()]
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/sample.js/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/sample.ts/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aa185fd

Please sign in to comment.