first commit
This commit is contained in:
13
webapp/test/integration/AllJourneys.js
Normal file
13
webapp/test/integration/AllJourneys.js
Normal 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
|
||||
});
|
||||
});
|
23
webapp/test/integration/NavigationJourney.js
Normal file
23
webapp/test/integration/NavigationJourney.js
Normal 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();
|
||||
});
|
||||
});
|
25
webapp/test/integration/arrangements/Startup.js
Normal file
25
webapp/test/integration/arrangements/Startup.js
Normal 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
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
29
webapp/test/integration/opaTests.qunit.html
Normal file
29
webapp/test/integration/opaTests.qunit.html
Normal 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>
|
7
webapp/test/integration/opaTests.qunit.js
Normal file
7
webapp/test/integration/opaTests.qunit.js
Normal file
@ -0,0 +1,7 @@
|
||||
/* global QUnit */
|
||||
|
||||
sap.ui.require(["restaurant/z00124ss25restaurant/test/integration/AllJourneys"
|
||||
], function () {
|
||||
QUnit.config.autostart = false;
|
||||
QUnit.start();
|
||||
});
|
28
webapp/test/integration/pages/App.js
Normal file
28
webapp/test/integration/pages/App.js
Normal 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"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
28
webapp/test/integration/pages/tablePos.js
Normal file
28
webapp/test/integration/pages/tablePos.js
Normal 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"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user