Skip to content

Commit 97e70cb

Browse files
author
Schuff, Christian
committed
Merge remote-tracking branch 'origin/master'
2 parents 2e9550d + 5cf5c7c commit 97e70cb

File tree

14 files changed

+162
-64
lines changed

14 files changed

+162
-64
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[Slides](http://slides.com/christianschuff/a-different-approach-to-ui-testing#/)
44

5+
56
## Project Template
67

78
This demo application is based on the SAP Web IDE Template 'SAP Fiori Master-Detail Application' (see .project.json).

webapp/controller/BaseController.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sap.ui.define([
55
"use strict";
66

77
return Controller.extend("ui5experts.ui-testing.controller.BaseController", {
8+
89
/**
910
* Convenience method for accessing the router in every controller of the application.
1011
* @public
@@ -59,6 +60,11 @@ sap.ui.define([
5960
} else {
6061
this.getRouter().navTo("master", {}, true);
6162
}
63+
},
64+
65+
66+
formatStateText: function (sStatusText) {
67+
return this.getResourceBundle().getText(sStatusText);
6268
}
6369

6470
});

webapp/i18n/i18n.properties

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
appTitle=UI Testing
55

66
#YDES: Application description
7-
appDescription=Example SAPUI5 application demonstrating the use of QUnit, OPA5 and karma.
7+
appDescription=Example SAPUI5 application demonstrating the use of QUnit, OPA5, karma and BackstopJS.
88

99
#~~~ Master View ~~~~~~~~~~~~~~~~~~~~~~~~~~
1010

@@ -73,6 +73,17 @@ shareSendEmailObjectSubject=<Email subject including object identifier PLEASE RE
7373
#YMSG: Send E-Mail message
7474
shareSendEmailObjectMessage=<Email body PLEASE REPLACE ACCORDING TO YOUR USE CASE> {0} (id: {1})\r\n{2}
7575

76+
purpose=Purpose
77+
location=Location
78+
country=Country
79+
departure=Departure
80+
arrival=Arrival
81+
lastChanged=Last Changed
82+
83+
Pending=Pending
84+
Approved=Approved
85+
Rejected=Rejected
86+
7687
#~~~ Not Found View ~~~~~~~~~~~~~~~~~~~~~~~
7788

7889
#XTIT: Not found view title

webapp/i18n/i18n_de.properties

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# This is the resource bundle for UI5Experts - UI Testing
2+
3+
#XTIT: Application name
4+
appTitle=UI Testing
5+
6+
#YDES: Application description
7+
appDescription=Example SAPUI5 application demonstrating the use of QUnit, OPA5, karma and BackstopJS.
8+
9+
#~~~ Master View ~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
11+
#XTIT: Master view title with placeholder for the number of items
12+
masterTitleCount=Reisen ({0})
13+
14+
#XTOL: Tooltip for the search field
15+
masterSearchTooltip=Enter a travel name or a part of it.
16+
17+
#XBLI: text for a list with no data
18+
masterListNoDataText=No travels are currently available
19+
20+
#XBLI: text for a list with no data with filter or search
21+
masterListNoDataWithFilterOrSearchText=No matching travels found
22+
23+
#XSEL: Option to sort the master list by TripActivityName
24+
masterSort1=Sortieren nach Reisename
25+
26+
#XSEL: Option to sort the master list by Estimated Cost
27+
masterSort2=Sortieren nach geschätzten Kosten
28+
29+
#XSEL: Option to filter the master list by Estimated Cost
30+
masterFilterName=Geschätzte Kosten
31+
32+
#XSEL: Option to not filter the master list
33+
masterFilterNone=Keiner
34+
35+
#XSEL: Option to filter the master list by EstimatedCost/Currency if the value is less than 1000
36+
masterFilter1=< 1000
37+
38+
#XSEL: Option to filter the master list by EstimatedCost/Currency if the value is greater than 1000
39+
masterFilter2=> 1000
40+
41+
#YMSG: Filter text that is displayed above the master list
42+
masterFilterBarText=Gefiltert nach {0}
43+
44+
#XSEL: Option to not group the master list
45+
masterGroupNone=(Nicht gruppiert)
46+
47+
#XSEL: Option to group the master list by Estimated Cost
48+
masterGroup1=Geschätzte Kosten
49+
50+
#XGRP: Group header Estimated Cost
51+
masterGroup1Header1=Geschätzte Kosten 1000 oder weniger
52+
53+
#XGRP: Group header Estimated Cost
54+
masterGroup1Header2=Geschätzte Kosten höher als 1000
55+
56+
#~~~ Detail View ~~~~~~~~~~~~~~~~~~~~~~~~~~
57+
58+
#XTIT: Detail view title
59+
detailTitle=Reisedetails
60+
61+
#XTOL: Icon Tab Bar Info
62+
detailIconTabBarInfo=Info
63+
64+
#XTOL: Icon Tab Bar Attachments
65+
detailIconTabBarAttachments=Anhänge
66+
67+
#XTIT: Save as tile app title
68+
shareSaveTileAppTitle=UI5Experts - UI Testing - {0}
69+
70+
#XTIT: Send E-Mail subject
71+
shareSendEmailObjectSubject=<Email subject including object identifier PLEASE REPLACE ACCORDING TO YOUR USE CASE> {0}
72+
73+
#YMSG: Send E-Mail message
74+
shareSendEmailObjectMessage=<Email body PLEASE REPLACE ACCORDING TO YOUR USE CASE> {0} (id: {1})\r\n{2}
75+
76+
purpose=Anlass
77+
location=Ziel
78+
country=Land
79+
departure=Abreise
80+
arrival=Ankunft
81+
lastChanged=Letzte Änderung
82+
83+
Pending=Wartend
84+
Approved=Genehmigt
85+
Rejected=Abgelehnt
86+
87+
#~~~ Not Found View ~~~~~~~~~~~~~~~~~~~~~~~
88+
89+
#XTIT: Not found view title
90+
notFoundTitle=Nicht Gefunden
91+
92+
#YMSG: The travels not found text is displayed when there is no travels with this id
93+
noObjectFoundText=Diese Reise ist nicht verfügbar
94+
95+
#YMSG: The travels not available text is displayed when there is no data when starting the app
96+
noObjectsAvailableText=Keine Reisen sind momentan verfügbar
97+
98+
#YMSG: The not found text is displayed when there was an error loading the resource (404 error)
99+
notFoundText=Die angeforderte Reise wurde nicht gefunden
100+
101+
#~~~ Not Available View ~~~~~~~~~~~~~~~~~~~~~~~
102+
103+
#XTIT: Master view title
104+
notAvailableViewTitle=Reisen
105+
106+
#~~~ Error Handling ~~~~~~~~~~~~~~~~~~~~~~~
107+
108+
#YMSG: Error dialog description
109+
errorText=Sorry, a technical error occurred! Please try again later.

webapp/localService/mockdata/Travels.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"EstimatedCost": {
44
"Currency": "EUR",
5-
"Value": "1299.99"
5+
"Value": 1299.99
66
},
77
"LastChangeDate": "/Date(1327063328000)/",
88
"TripActivityName": "Customer Visit",
@@ -37,7 +37,7 @@
3737
{
3838
"EstimatedCost": {
3939
"Currency": "EUR",
40-
"Value": "2799.00"
40+
"Value": 2799.00
4141
},
4242
"LastChangeDate": "/Date(1370691728000)/",
4343
"TripActivityName": "China",
@@ -72,7 +72,7 @@
7272
{
7373
"EstimatedCost": {
7474
"Currency": "EUR",
75-
"Value": "17042.14"
75+
"Value": 17042.14
7676
},
7777
"LastChangeDate": "/Date(998826128000)/",
7878
"TripActivityName": "Going to Ibiza",
@@ -107,7 +107,7 @@
107107
{
108108
"EstimatedCost": {
109109
"Currency": "EUR",
110-
"Value": "1869.81"
110+
"Value": 1869.81
111111
},
112112
"LastChangeDate": "/Date(1272022928000)/",
113113
"TripActivityName": "Hawaii Incentive",
@@ -142,10 +142,10 @@
142142
{
143143
"EstimatedCost": {
144144
"Currency": "USD",
145-
"Value": "478.61"
145+
"Value": 478.61
146146
},
147147
"LastChangeDate": "/Date(1319715728000)/",
148-
"TripActivityName": "sitBERN",
148+
"TripActivityName": "sitFRA",
149149
"Id": "Id 5",
150150
"Purpose": "Purpose 5",
151151
"Departure": "/Date(1014208928000)/",
@@ -177,7 +177,7 @@
177177
{
178178
"EstimatedCost": {
179179
"Currency": "USD",
180-
"Value": "1235.50"
180+
"Value": 1235.50
181181
},
182182
"LastChangeDate": "/Date(1210592528000)/",
183183
"TripActivityName": "Eis essen",
@@ -212,7 +212,7 @@
212212
{
213213
"EstimatedCost": {
214214
"Currency": "EUR",
215-
"Value": "2777.92"
215+
"Value": 2777.92
216216
},
217217
"LastChangeDate": "/Date(1140871328000)/",
218218
"TripActivityName": "Business Trip",
@@ -247,7 +247,7 @@
247247
{
248248
"EstimatedCost": {
249249
"Currency": "EUR",
250-
"Value": "9230.06"
250+
"Value": 9230.06
251251
},
252252
"LastChangeDate": "/Date(1103719328000)/",
253253
"TripActivityName": "Business Trip",
@@ -282,7 +282,7 @@
282282
{
283283
"EstimatedCost": {
284284
"Currency": "EUR",
285-
"Value": "4667.41"
285+
"Value": 4667.41
286286
},
287287
"LastChangeDate": "/Date(1119094928000)/",
288288
"TripActivityName": "Business Trip",
@@ -317,7 +317,7 @@
317317
{
318318
"EstimatedCost": {
319319
"Currency": "EUR",
320-
"Value": "1850.04"
320+
"Value": 1850.04
321321
},
322322
"LastChangeDate": "/Date(954157328000)/",
323323
"TripActivityName": "Business Trip",

webapp/model/formatter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sap.ui.define([
77
"use strict";
88

99
return {
10+
1011
/**
1112
* Rounds the currency value to 2 digits
1213
*

webapp/test/integration/opaTests.qunit.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<script id="sap-ui-bootstrap"
99
src="../../resources/sap-ui-core.js"
1010
data-sap-ui-resourceroots='{
11-
"ui5experts.ui-testing.test.integration": "./",
12-
"ui5experts.ui-testing.app" : "../flpSandboxMockServer"
13-
}'>
11+
"ui5experts.ui-testing.test.integration": "./",
12+
"ui5experts.ui-testing.app" : "../flpSandboxMockServer"
13+
}'>
1414
</script>
1515

1616
<script>

webapp/test/integration/opaTestsPhone.qunit.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<script id="sap-ui-bootstrap"
99
src="../../resources/sap-ui-core.js"
1010
data-sap-ui-resourceroots='{
11-
"ui5experts.ui-testing.test.integration": "./",
12-
"ui5experts.ui-testing.app" : "../flpSandboxMockServer"
13-
}'>
11+
"ui5experts.ui-testing.test.integration": "./",
12+
"ui5experts.ui-testing.app" : "../flpSandboxMockServer"
13+
}'>
1414
</script>
1515

1616
<script>

webapp/test/integration/pages/Common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sap.ui.define([
66
function getFrameUrl(sHash, sUrlParameters) {
77
var sUrl = jQuery.sap.getResourcePath("ui5experts/ui-testing/app", ".html");
88
sHash = sHash || "";
9-
sUrlParameters = sUrlParameters ? "?" + sUrlParameters : "";
9+
sUrlParameters = "?sap-ui-language=en" + (sUrlParameters ? "&" + sUrlParameters : "");
1010

1111
if (sHash) {
1212
sHash = "#UITesting-display&/" + (sHash.indexOf("/") === 0 ? sHash.substring(1) : sHash);

webapp/test/integration/pages/Master.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ sap.ui.define([
512512
}).isMatching(oList);
513513
},
514514
success: function (oList) {
515-
Opa5.assert.strictEqual(oList.getItems().length, iExpectedNumberOfItems, "The growing list dsiplays all items");
515+
Opa5.assert.strictEqual(oList.getItems().length, iExpectedNumberOfItems, "The" +
516+
" growing list displays all items");
516517
},
517518
errorMessage: "List does not display all entries."
518519
});

webapp/test/unit/model/formatter.js

100755100644
File mode changed.

webapp/test/unit/unitTests.qunit.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<script id="sap-ui-bootstrap"
99
src="../../resources/sap-ui-core.js"
10+
data-sap-ui-language="en"
1011
data-sap-ui-libs="sap.m"
1112
data-sap-ui-resourceroots='{
1213
"ui5experts/ui-testing": "../../",

webapp/view/Detail.view.xml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,6 @@
1616
busyIndicatorDelay="{detailView>/delay}">
1717

1818
<semantic:content>
19-
20-
<!--number="{-->
21-
<!--path: 'EstimatedCost/Value',-->
22-
<!--type: 'sap.ui.model.type.Currency',-->
23-
<!--formatOptions: {-->
24-
<!--source: {-->
25-
<!--groupingSeparator: '',-->
26-
<!--decimalSeparator: '.'-->
27-
<!--}-->
28-
<!--}-->
29-
<!--}"-->
3019
<ObjectHeader
3120
id="objectHeader"
3221
icon="sap-icon://flight"
@@ -40,14 +29,9 @@
4029
<ObjectAttribute text="{RequesterLastName}, {RequesterFirstName}" />
4130
</attributes>
4231
<statuses>
43-
<ObjectStatus text="{Status}"
44-
icon="{
45-
path: 'Status',
46-
formatter: '.formatter.stateIcon'
47-
}"
48-
state="{
32+
<ObjectStatus text="{
4933
path: 'Status',
50-
formatter: '.formatter.state'
34+
formatter: '.formatStateText'
5135
}" />
5236
</statuses>
5337
</ObjectHeader>
@@ -61,17 +45,17 @@
6145
tooltip="{i18n>detailIconTabBarInfo}">
6246
<content>
6347
<f:SimpleForm>
64-
<Label text="Purpose" />
48+
<Label text="{i18n>purpose}" />
6549
<Text text="{Purpose}" />
66-
<Label text="Location" />
50+
<Label text="{i18n>location}" />
6751
<Text text="{Location}" />
68-
<Label text="Country" />
52+
<Label text="{i18n>country}" />
6953
<Text text="{CountryName} ({CountryCode})" />
70-
<Label text="Departure" />
54+
<Label text="{i18n>departure}" />
7155
<Text text="{ path: 'Departure', type: 'sap.ui.model.type.DateTime' }" />
72-
<Label text="Arrival" />
56+
<Label text="{i18n>arrival}" />
7357
<Text text="{ path: 'Arrival', type: 'sap.ui.model.type.DateTime' }" />
74-
<Label text="Last Changed" />
58+
<Label text="{i18n>lastChanged}" />
7559
<Text text="{ path: 'LastChangeDate', type: 'sap.ui.model.type.DateTime' }" />
7660
</f:SimpleForm>
7761
</content>

0 commit comments

Comments
 (0)