-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from IObert/master
PR for features of the next iteration
- Loading branch information
Showing
25 changed files
with
1,452 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Karma configuration | ||
// Generated on Wed Jun 13 2018 14:38:44 GMT+0200 (CEST) | ||
|
||
module.exports = function(config) { | ||
require("./karma.conf")(config); | ||
config.set({ | ||
|
||
client: { | ||
qunit: { | ||
showUI: false | ||
} | ||
}, | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress', 'coverage' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['ChromeHeadless'], | ||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true | ||
|
||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Karma configuration | ||
// Generated on Wed Jun 13 2018 14:38:44 GMT+0200 (CEST) | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: 'webapp', | ||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['qunit', 'openui5'], | ||
|
||
openui5: { | ||
path: 'http://localhost:8080/resources/sap-ui-core.js' | ||
}, | ||
|
||
client: { | ||
openui5: { | ||
config: { | ||
theme: 'sap_belize', | ||
language: 'EN', | ||
bindingSyntax: 'complex', | ||
compatVersion: 'edge', | ||
async: true, | ||
resourceroots: {'<%=namespace%>.<%=projectname%>': './base'} | ||
}, | ||
tests: [ | ||
'<%=namespace.replace(/\./g, '/')%>/<%=projectname%>/test/integration/AllJourneys' | ||
] | ||
}, | ||
clearContext: false, | ||
qunit: { | ||
showUI: true | ||
} | ||
}, | ||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
{ pattern: '**', included: false, served: true, watched: true } | ||
], | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
// level of browser logging | ||
browserConsoleLogOptions: { | ||
level: 'error' | ||
}, | ||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['Chrome'], | ||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false | ||
|
||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const path = require('path'); | ||
const execa = require('execa'); | ||
const assert = require('yeoman-assert'); | ||
|
||
describe('Basic project capabilities', function() { | ||
|
||
describe('Generated code', function() { | ||
this.timeout(35000) | ||
|
||
it('should contain eslint', function() { | ||
return assert.file(['node_modules/.bin/eslint']); | ||
}); | ||
|
||
it('should be lintable', function() { | ||
return execa.shellSync('npm run lint') | ||
}); | ||
|
||
it('should pass karma test suite', function() { | ||
return execa.shellSync('npm run karma') | ||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
title=<%=projectname%> | ||
appTitle=<%=projectname%> | ||
appDescription=App Description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
generators/app/templates/webapp/test/integration/AllJourneys.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sap.ui.define([ | ||
"sap/ui/test/Opa5", | ||
"<%=namespace.replace(/\./g, '/')%>/<%=projectname%>/test/integration/arrangements/Startup", | ||
"<%=namespace.replace(/\./g, '/')%>/<%=projectname%>/test/integration/BasicJourney" | ||
], function(Opa5, Startup) { | ||
"use strict"; | ||
|
||
Opa5.extendConfig({ | ||
arrangements: new Startup(), | ||
pollingInterval: 1 | ||
}); | ||
|
||
}); |
19 changes: 19 additions & 0 deletions
19
generators/app/templates/webapp/test/integration/BasicJourney.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
sap.ui.define([ | ||
"sap/ui/test/opaQunit", | ||
"<%=namespace.replace(/\./g, '/')%>/<%=projectname%>/test/integration/pages/App" | ||
], function (opaTest) { | ||
"use strict"; | ||
|
||
opaTest("should show correct number of nested pages", function (Given, When, Then) { | ||
|
||
// Arrangements | ||
Given.iStartMyApp(); | ||
|
||
// Assertions | ||
Then.onTheAppPage.iShouldSeePageCount(1); | ||
|
||
// Cleanup | ||
Then.iTeardownMyApp(); | ||
}); | ||
|
||
}); |
19 changes: 19 additions & 0 deletions
19
generators/app/templates/webapp/test/integration/arrangements/Startup.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
sap.ui.define([ | ||
"sap/ui/test/Opa5" | ||
], function(Opa5) { | ||
"use strict"; | ||
|
||
return Opa5.extend("<%=namespace%>.<%=projectname%>.test.integration.arrangements.Startup", { | ||
|
||
iStartMyApp: function () { | ||
this.iStartMyUIComponent({ | ||
componentConfig: { | ||
name: "<%=namespace%>.<%=projectname%>", | ||
async: true, | ||
manifest: true | ||
} | ||
}); | ||
} | ||
|
||
}); | ||
}); |
30 changes: 30 additions & 0 deletions
30
generators/app/templates/webapp/test/integration/opaTests.qunit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Integration tests for Todo App</title> | ||
|
||
<script id="sap-ui-bootstrap" | ||
src="../../resources/sap-ui-core.js" | ||
data-sap-ui-theme='sap_belize' | ||
data-sap-ui-resourceroots='{ | ||
"<%=namespace%>.<%=projectname%>": "../../" | ||
}' | ||
data-sap-ui-language="EN" | ||
data-sap-ui-animation="false" | ||
data-sap-ui-compatVersion="edge" | ||
data-sap-ui-async="true"> | ||
</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="opaTests.qunit.js"></script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
</body> | ||
</html> |
13 changes: 13 additions & 0 deletions
13
generators/app/templates/webapp/test/integration/opaTests.qunit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* global QUnit */ | ||
|
||
QUnit.config.autostart = false; | ||
|
||
sap.ui.getCore().attachInit(function () { | ||
"use strict"; | ||
|
||
sap.ui.require([ | ||
"<%=namespace.replace(/\./g, '/')%>/<%=projectname%>/test/integration/BasicJourney" | ||
], function() { | ||
QUnit.start(); | ||
}); | ||
}); |
34 changes: 34 additions & 0 deletions
34
generators/app/templates/webapp/test/integration/pages/App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
sap.ui.require([ | ||
"sap/ui/test/Opa5", | ||
"sap/ui/test/matchers/AggregationLengthEquals" | ||
], function (Opa5, AggregationLengthEquals) { | ||
"use strict"; | ||
|
||
var sViewName = "<%=namespace%>.<%=projectname%>.view.<%=viewname%>"; | ||
var sAppId = "idAppControl"; | ||
|
||
Opa5.createPageObjects({ | ||
onTheAppPage: { | ||
|
||
assertions: { | ||
|
||
iShouldSeePageCount: function(iItemCount) { | ||
return this.waitFor({ | ||
id: sAppId, | ||
viewName: sViewName, | ||
matchers: [new AggregationLengthEquals({ | ||
name: "pages", | ||
length: iItemCount | ||
})], | ||
success: function() { | ||
Opa5.assert.ok(true, "The app contains one page"); | ||
}, | ||
errorMessage: "App does not have expected number of pages '" + iItemCount + "'." | ||
}); | ||
} | ||
} | ||
|
||
} | ||
}); | ||
|
||
}); |
Oops, something went wrong.