Skip to content

Commit

Permalink
[INTERNAL] Update test setup
Browse files Browse the repository at this point in the history
Alignment with current best practices (e.g. in Testing Tutorial)
- Remove usage of <base> tag
- Usage of ui5:// protocol instead of relative page path
- Fix coverage exclusion for test modules
  • Loading branch information
matz3 committed Oct 22, 2024
1 parent 01334af commit b53d30e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
5 changes: 2 additions & 3 deletions webapp/test/Test.qunit.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<html>
<head>
<meta charset="utf-8">
<base href="../">
<script
src="resources/sap/ui/test/starter/runTest.js"
src="../resources/sap/ui/test/starter/runTest.js"
data-sap-ui-resource-roots='{
"test-resources.sap.ui.demo.todo": "./test"
"test-resources.sap.ui.demo.todo": "./"
}'
></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion webapp/test/integration/FilterJourney.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

sap.ui.define([
"sap/ui/test/opaQunit",
"sap/ui/demo/todo/test/integration/pages/App"
"./pages/App"
], (opaTest) => {
"use strict";

Expand Down
2 changes: 1 addition & 1 deletion webapp/test/integration/SearchJourney.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
sap.ui.define([
"sap/ui/Device",
"sap/ui/test/opaQunit",
"sap/ui/demo/todo/test/integration/pages/App"
"./pages/App"
], (Device, opaTest) => {
"use strict";

Expand Down
2 changes: 1 addition & 1 deletion webapp/test/integration/TodoListJourney.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

sap.ui.define([
"sap/ui/test/opaQunit",
"sap/ui/demo/todo/test/integration/pages/App"
"./pages/App"
], (opaTest) => {
"use strict";

Expand Down
8 changes: 4 additions & 4 deletions webapp/test/integration/opaTests.qunit.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sap.ui.define([
"sap/ui/test/Opa5",
"sap/ui/demo/todo/test/integration/arrangements/Startup",
"sap/ui/demo/todo/test/integration/TodoListJourney",
"sap/ui/demo/todo/test/integration/SearchJourney",
"sap/ui/demo/todo/test/integration/FilterJourney"
"./arrangements/Startup",
"./TodoListJourney",
"./SearchJourney",
"./FilterJourney"
], (Opa5, Startup) => {
"use strict";

Expand Down
5 changes: 2 additions & 3 deletions webapp/test/testsuite.qunit.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<html>
<head>
<meta charset="utf-8">
<base href="../">
<title>QUnit test suite for Todo App</title>
<script
src="resources/sap/ui/test/starter/createSuite.js"
src="../resources/sap/ui/test/starter/createSuite.js"
data-sap-ui-testsuite="test-resources/sap/ui/demo/todo/testsuite.qunit"
data-sap-ui-resource-roots='{
"test-resources.sap.ui.demo.todo": "./test"
"test-resources.sap.ui.demo.todo": "./"
}'
></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions webapp/test/testsuite.qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sap.ui.define(function () {
return {
name: "QUnit test suite for Todo App",
defaults: {
page: "test/Test.qunit.html?testsuite={suite}&test={name}",
page: "ui5://test-resources/sap/ui/demo/todo/Test.qunit.html?testsuite={suite}&test={name}",
qunit: {
version: 2
},
Expand All @@ -16,11 +16,11 @@ sap.ui.define(function () {
},
coverage: {
only: "sap/ui/demo/todo/",
never: "sap/ui/demo/todo/test/"
never: "test-resources/sap/ui/demo/todo/"
},
loader: {
paths: {
"sap/ui/demo/todo": "./"
"sap/ui/demo/todo": "../"
}
}
},
Expand Down

0 comments on commit b53d30e

Please sign in to comment.