first commit

This commit is contained in:
Dongho Kim
2025-05-21 15:00:13 +00:00
commit da3ac0e469
39 changed files with 16602 additions and 0 deletions

View File

@ -0,0 +1,13 @@
sap.ui.define([
"sap/ui/test/Opa5",
"./arrangements/Startup",
"./NavigationJourney"
], function (Opa5, Startup) {
"use strict";
Opa5.extendConfig({
arrangements: new Startup(),
viewNamespace: "restaurant.z00124ss25restaurant.view.",
autoWait: true
});
});

View File

@ -0,0 +1,23 @@
/*global QUnit*/
sap.ui.define([
"sap/ui/test/opaQunit",
"./pages/App",
"./pages/tablePos"
], function (opaTest) {
"use strict";
QUnit.module("Navigation Journey");
opaTest("Should see the initial page of the app", function (Given, When, Then) {
// Arrangements
Given.iStartMyApp();
// Assertions
Then.onTheAppPage.iShouldSeeTheApp();
Then.onTheViewPage.iShouldSeeThePageView();
//Cleanup
Then.iTeardownMyApp();
});
});

View File

@ -0,0 +1,25 @@
sap.ui.define([
"sap/ui/test/Opa5"
], function (Opa5) {
"use strict";
return Opa5.extend("integration.arrangements.Startup", {
iStartMyApp: function (oOptionsParameter) {
var oOptions = oOptionsParameter || {};
// start the app with a minimal delay to make tests fast but still async to discover basic timing issues
oOptions.delay = oOptions.delay || 50;
// start the app UI component
this.iStartMyUIComponent({
componentConfig: {
name: "restaurant.z00124ss25restaurant",
async: true
},
hash: oOptions.hash,
autoWait: oOptions.autoWait
});
}
});
});

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Integration tests for Basic Template</title>
<script
id="sap-ui-bootstrap"
src="../../resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon"
data-sap-ui-resourceroots='{
"restaurant.z00124ss25restaurant": "../../",
"integration": "./"
}'
data-sap-ui-animation="false"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-preload="async"
data-sap-ui-oninit="module:integration/opaTests.qunit">
</script>
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css">
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-junit.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>

View File

@ -0,0 +1,7 @@
/* global QUnit */
sap.ui.require(["restaurant/z00124ss25restaurant/test/integration/AllJourneys"
], function () {
QUnit.config.autostart = false;
QUnit.start();
});

View File

@ -0,0 +1,28 @@
sap.ui.define([
"sap/ui/test/Opa5"
], function (Opa5) {
"use strict";
var sViewName = "App";
Opa5.createPageObjects({
onTheAppPage: {
actions: {},
assertions: {
iShouldSeeTheApp: function () {
return this.waitFor({
id: "app",
viewName: sViewName,
success: function () {
Opa5.assert.ok(true, "The " + sViewName + " view is displayed");
},
errorMessage: "Did not find the " + sViewName + " view"
});
}
}
}
});
});

View File

@ -0,0 +1,28 @@
sap.ui.define([
"sap/ui/test/Opa5"
], function (Opa5) {
"use strict";
var sViewName = "tablePos";
Opa5.createPageObjects({
onTheViewPage: {
actions: {},
assertions: {
iShouldSeeThePageView: function () {
return this.waitFor({
id: "page",
viewName: sViewName,
success: function () {
Opa5.assert.ok(true, "The " + sViewName + " view is displayed");
},
errorMessage: "Did not find the " + sViewName + " view"
});
}
}
}
});
});

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>QUnit test suite</title>
<script src="../resources/sap/ui/qunit/qunit-redirect.js"></script>
<script src="testsuite.qunit.js" data-sap-ui-testsuite></script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,16 @@
/* global window, parent, location */
// eslint-disable-next-line fiori-custom/sap-no-global-define
window.suite = function() {
"use strict";
// eslint-disable-next-line
var oSuite = new parent.jsUnitTestSuite(),
sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1);
oSuite.addTestPage(sContextPath + 'unit/unitTests.qunit.html');
oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html');
return oSuite;
};

View File

@ -0,0 +1,5 @@
sap.ui.define([
"restaurant/z00124ss25restaurant/test/unit/controller/tablePos.controller"
], function () {
"use strict";
});

View File

@ -0,0 +1,16 @@
/*global QUnit*/
sap.ui.define([
"restaurant/z00124ss25restaurant/controller/tablePos.controller"
], function (Controller) {
"use strict";
QUnit.module("tablePos Controller");
QUnit.test("I should test the tablePos controller", function (assert) {
var oAppController = new Controller();
oAppController.onInit();
assert.ok(oAppController);
});
});

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Unit tests for restaurant.z00124ss25restaurant</title>
<script
id="sap-ui-bootstrap"
src="../../resources/sap-ui-core.js"
data-sap-ui-resourceroots='{
"restaurant/z00124ss25restaurant": "../../",
"unit": "."
}'
data-sap-ui-async="true"
data-sap-ui-oninit="module:unit/unitTests.qunit">
</script>
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css">
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-junit.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-coverage.js"></script>
<script src="../../resources/sap/ui/thirdparty/sinon.js"></script>
<script src="../../resources/sap/ui/thirdparty/sinon-qunit.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>

View File

@ -0,0 +1,12 @@
/* global QUnit */
QUnit.config.autostart = false;
sap.ui.getCore().attachInit(function () {
"use strict";
sap.ui.require([
"restaurant/z00124ss25restaurant/test/unit/AllTests"
], function () {
QUnit.start();
});
});