Skip to content

Commit 15f25d3

Browse files
committed
initial state
0 parents  commit 15f25d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+5104
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build
2+
dist
3+
node_modules
4+
.tmp
5+
.idea
6+
npm-debug.log

.project.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"projectType": [
3+
"sap.watt.uitools.ide.fiori",
4+
"com.watt.common.builder.sapui5clientbuild"
5+
],
6+
"build": {
7+
"targetFolder": "dist",
8+
"sourceFolder": "webapp",
9+
"excludedFolders": [
10+
"test"
11+
],
12+
"excludedFiles": [
13+
"test.html"
14+
],
15+
"buildRequired": true
16+
},
17+
"dataBinding": {
18+
"/webapp/view/App.view.xml": {
19+
"entitySet": "UNBINDKEY"
20+
},
21+
"/webapp/view/NotFound.view.xml": {
22+
"entitySet": "UNBINDKEY"
23+
},
24+
"/webapp/view/DetailObjectNotFound.view.xml": {
25+
"entitySet": "UNBINDKEY"
26+
},
27+
"/webapp/view/DetailNoObjectsAvailable.view.xml": {
28+
"entitySet": "UNBINDKEY"
29+
},
30+
"/webapp/view/Master.view.xml": {
31+
"entitySet": "Travels"
32+
},
33+
"/webapp/view/Detail.view.xml": {
34+
"entitySet": "Travels"
35+
}
36+
},
37+
"generation": [
38+
{
39+
"templateId": "sap.ui.ui5-template-plugin.2masterdetail",
40+
"templateVersion": "1.46.8",
41+
"dateTimeStamp": "Thu, 17 Aug 2017 19:32:49 GMT"
42+
}
43+
],
44+
"translation": {
45+
"translationDomain": "",
46+
"supportedLanguages": "en,fr,de",
47+
"defaultLanguage": "en",
48+
"defaultI18NPropertyFile": "i18n.properties",
49+
"resourceModelName": "i18n"
50+
},
51+
"mockpreview": {
52+
"mockUri": "",
53+
"metadataFilePath": "",
54+
"loadJSONFiles": false,
55+
"loadCustomRequests": false,
56+
"mockRequestsFilePath": ""
57+
},
58+
"basevalidator": {
59+
"services": {
60+
"xml": "fioriXmlAnalysis",
61+
"js": "fioriJsValidator"
62+
}
63+
},
64+
"codeCheckingTriggers": {
65+
"notifyBeforePush": true,
66+
"notifyBeforePushLevel": "Error",
67+
"blockPush": false,
68+
"blockPushLevel": "Error"
69+
}
70+
}

.user.project.json

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
{
2+
"run": [
3+
{
4+
"filePath": "/ui-testing/webapp/test/flpSandbox.html",
5+
"previewMode": 1,
6+
"dataMode": 1,
7+
"workspace": "withoutWorkspace",
8+
"urlParameters": [
9+
{
10+
"paramName": "",
11+
"paramValue": "",
12+
"paramActive": false
13+
},
14+
{
15+
"paramName": "",
16+
"paramValue": "",
17+
"paramActive": false
18+
}
19+
],
20+
"hashParameter": "UITesting-display",
21+
"ui5ActiveVersion": null,
22+
"ui5VerSource": null,
23+
"isDefaultVersion": 1,
24+
"_metadata": {
25+
"id": "6663453",
26+
"runnerId": "webapprunner",
27+
"displayName": "App in FLP Sandbox"
28+
}
29+
},
30+
{
31+
"filePath": "/ui-testing/webapp/test/flpSandboxMockServer.html",
32+
"previewMode": 1,
33+
"dataMode": 1,
34+
"workspace": "withoutWorkspace",
35+
"urlParameters": [
36+
{
37+
"paramName": "",
38+
"paramValue": "",
39+
"paramActive": false
40+
},
41+
{
42+
"paramName": "",
43+
"paramValue": "",
44+
"paramActive": false
45+
}
46+
],
47+
"hashParameter": "UITesting-display",
48+
"ui5ActiveVersion": null,
49+
"ui5VerSource": null,
50+
"isDefaultVersion": 1,
51+
"_metadata": {
52+
"id": "2873743",
53+
"runnerId": "webapprunner",
54+
"displayName": "App in FLP Sandbox (Mock Server)"
55+
}
56+
},
57+
{
58+
"filePath": "/ui-testing/webapp/test/unit/unitTests.qunit.html",
59+
"previewMode": 1,
60+
"dataMode": 1,
61+
"workspace": "withoutWorkspace",
62+
"ui5ActiveVersion": null,
63+
"ui5VerSource": null,
64+
"isDefaultVersion": 1,
65+
"urlParameters": [
66+
{
67+
"paramName": "",
68+
"paramValue": "",
69+
"paramActive": false
70+
},
71+
{
72+
"paramName": "",
73+
"paramValue": "",
74+
"paramActive": false
75+
}
76+
],
77+
"_metadata": {
78+
"id": "4794800",
79+
"runnerId": "webapprunner",
80+
"displayName": "Unit Tests"
81+
}
82+
},
83+
{
84+
"filePath": "/ui-testing/webapp/test/integration/opaTests.qunit.html",
85+
"previewMode": 1,
86+
"dataMode": 1,
87+
"workspace": "withoutWorkspace",
88+
"ui5ActiveVersion": null,
89+
"ui5VerSource": null,
90+
"isDefaultVersion": 1,
91+
"urlParameters": [
92+
{
93+
"paramName": "",
94+
"paramValue": "",
95+
"paramActive": false
96+
},
97+
{
98+
"paramName": "",
99+
"paramValue": "",
100+
"paramActive": false
101+
}
102+
],
103+
"hashParameter": "",
104+
"_metadata": {
105+
"id": "1127367",
106+
"runnerId": "webapprunner",
107+
"displayName": "OPA Tests"
108+
}
109+
},
110+
{
111+
"filePath": "/ui-testing/webapp/test/testsuite.qunit.html",
112+
"previewMode": 1,
113+
"dataMode": 1,
114+
"workspace": "withoutWorkspace",
115+
"ui5ActiveVersion": null,
116+
"ui5VerSource": null,
117+
"isDefaultVersion": 1,
118+
"urlParameters": [
119+
{
120+
"paramName": "",
121+
"paramValue": "",
122+
"paramActive": false
123+
},
124+
{
125+
"paramName": "",
126+
"paramValue": "",
127+
"paramActive": false
128+
}
129+
],
130+
"hashParameter": "",
131+
"_metadata": {
132+
"id": "6519799",
133+
"runnerId": "webapprunner",
134+
"displayName": "Test Suite (Unit, OPA)"
135+
}
136+
},
137+
{
138+
"filePath": "/ui-testing/webapp/Component.js",
139+
"previewMode": 1,
140+
"dataMode": 1,
141+
"workspace": "withoutWorkspace",
142+
"ui5ActiveVersion": null,
143+
"ui5VerSource": null,
144+
"isDefaultVersion": 1,
145+
"urlParameters": [
146+
{
147+
"paramName": "",
148+
"paramValue": "",
149+
"paramActive": false
150+
},
151+
{
152+
"paramName": "",
153+
"paramValue": "",
154+
"paramActive": false
155+
}
156+
],
157+
"hashParameter": "",
158+
"_metadata": {
159+
"id": "4916800",
160+
"runnerId": "fiorirunner",
161+
"displayName": "App as Fiori Component"
162+
}
163+
}
164+
]
165+
}

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# A Different Approach to UI Testing
2+
3+
[Slides](http://slides.com/christianschuff/a-different-approach-to-ui-testing#/)
4+
5+
## Project Template
6+
7+
This demo application is based on the SAP Web IDE Template 'SAP Fiori Master-Detail Application' (see .project.json).
8+
9+
10+
## How To Run Locally
11+
12+
```sh
13+
$ npm start
14+
```
15+
16+
Find the run script in [this Gist](https://gist.github.com/cschuff/6f23b61622b41fdaa3c01623e530b845).
17+
18+
19+
## [BackstopJS](https://github.com/garris/BackstopJS)
20+
21+

karma.conf.js

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// Setup ChromeHeadless
2+
// see https://github.com/karma-runner/karma-chrome-launcher
3+
const ChromiumRevision = require('puppeteer/package.json').puppeteer.chromium_revision;
4+
const Downloader = require('puppeteer/utils/ChromiumDownloader');
5+
const revisionInfo = Downloader.revisionInfo(Downloader.currentPlatform(), ChromiumRevision);
6+
7+
process.env.CHROME_BIN = revisionInfo.executablePath;
8+
9+
10+
module.exports = function(config) {
11+
config.set({
12+
13+
basePath: 'webapp',
14+
15+
16+
// frameworks to use
17+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
18+
frameworks: ['qunit', 'openui5'],
19+
20+
21+
openui5: {
22+
path: 'https://sapui5.hana.ondemand.com/resources/sap-ui-core.js',
23+
useMockServer: true
24+
},
25+
26+
27+
// plugin settings
28+
client: {
29+
openui5: {
30+
config: {
31+
theme: 'sap_belize',
32+
resourceRoots: {
33+
'ui5experts.ui-testing': '/base',
34+
'test.unit': '/base/test/unit'
35+
}
36+
},
37+
mockserver: {
38+
config: {
39+
autoRespond: true
40+
},
41+
rootUri: '',
42+
metadataURL: '/base/localService/metadata.xml',
43+
mockdataSettings: {
44+
45+
}
46+
}
47+
},
48+
49+
qunit: {
50+
showUI: true,
51+
testTimeout: 3000
52+
}
53+
},
54+
55+
56+
// list of files / patterns to load in the browser
57+
files: [
58+
{
59+
pattern: 'test/unit/allTests.js',
60+
watched: true,
61+
included: true,
62+
served: true
63+
},
64+
{
65+
pattern: '**',
66+
watched: true,
67+
included: false,
68+
served: true
69+
}
70+
],
71+
72+
73+
// start these browsers
74+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
75+
// use '--browsers ChromeHeadless' to override from CLI
76+
browsers: ['Chrome'],
77+
78+
79+
customLaunchers: {
80+
Chrome_without_security: {
81+
base: 'Chrome',
82+
flags: ['--disable-web-security']
83+
}
84+
},
85+
86+
87+
// test results reporter to use
88+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
89+
// 'progress' = default test result output to console
90+
reporters: ['progress', 'junit', 'coverage'],
91+
92+
93+
junitReporter: {
94+
outputDir: '../build/reports/unit',
95+
useBrowserName: false
96+
},
97+
98+
99+
// preprocess matching files before serving them to the browser
100+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
101+
preprocessors: {
102+
'!(test)/**/*.js': ['coverage'], // exclude tests from coverage
103+
'*.js': ['coverage']
104+
},
105+
106+
107+
coverageReporter: {
108+
includeAllSources: true,
109+
dir: '../build/reports/coverage'
110+
}
111+
112+
113+
// Continuous Integration mode
114+
// if true, Karma captures browsers, runs the tests and exits
115+
// singleRun: false // use '--single-run' to override from CLI
116+
117+
});
118+
};

0 commit comments

Comments
 (0)