@syncfusion/ej2-base 26.1.35-806029 → 26.1.35-8139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/.eslintrc.json +261 -0
  2. package/{ReadMe.md → README.md} +100 -100
  3. package/bin/syncfusion-license.js +1 -104
  4. package/dist/ej2-base.min.js +10 -1
  5. package/dist/ej2-base.umd.min.js +10 -1
  6. package/dist/ej2-base.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-base.es2015.js +67 -74
  8. package/dist/es6/ej2-base.es2015.js.map +1 -1
  9. package/dist/es6/ej2-base.es5.js +117 -124
  10. package/dist/es6/ej2-base.es5.js.map +1 -1
  11. package/dist/global/ej2-base.min.js +10 -1
  12. package/dist/global/ej2-base.min.js.map +1 -1
  13. package/dist/global/index.d.ts +9 -0
  14. package/e2e/crypto.js +16 -16
  15. package/e2e/index.d.ts +27 -27
  16. package/e2e/m.protractor.config.js +286 -286
  17. package/e2e/modified-protractor/protractor.config.js +316 -316
  18. package/e2e/protractor.config.js +389 -389
  19. package/helpers/e2e/index.js +3 -3
  20. package/license +10 -10
  21. package/package.json +225 -225
  22. package/src/animation-model.d.ts +41 -41
  23. package/src/animation.js +19 -19
  24. package/src/browser.js +0 -4
  25. package/src/component-model.d.ts +16 -16
  26. package/src/component.js +19 -19
  27. package/src/draggable-model.d.ts +113 -113
  28. package/src/draggable.js +72 -35
  29. package/src/droppable-model.d.ts +23 -23
  30. package/src/droppable.js +19 -19
  31. package/src/intl/number-formatter.js +1 -8
  32. package/src/keyboard-model.d.ts +16 -16
  33. package/src/keyboard.js +19 -19
  34. package/src/touch-model.d.ts +39 -39
  35. package/src/touch.js +19 -19
  36. package/src/validate-lic.js +1 -1
  37. package/styles/_all.scss +2 -2
  38. package/styles/_bds-dark-definition.scss +15 -16
  39. package/styles/_bds-definition.scss +15 -16
  40. package/styles/_bootstrap-dark-definition.scss +42 -42
  41. package/styles/_bootstrap-definition.scss +42 -42
  42. package/styles/_bootstrap4-definition.scss +11 -11
  43. package/styles/_bootstrap5-dark-definition.scss +9 -9
  44. package/styles/_bootstrap5-definition.scss +8 -8
  45. package/styles/_bootstrap5.3-dark-definition.scss +8 -8
  46. package/styles/_bootstrap5.3-definition.scss +8 -8
  47. package/styles/_fabric-dark-definition.scss +42 -42
  48. package/styles/_fabric-definition.scss +42 -42
  49. package/styles/_fluent-dark-definition.scss +9 -9
  50. package/styles/_fluent-definition.scss +9 -9
  51. package/styles/_fluent2-dark-definition.scss +9 -9
  52. package/styles/_fluent2-definition.scss +9 -9
  53. package/styles/_fluent2-highcontrast-definition.scss +9 -9
  54. package/styles/_fusionnew-dark-definition.scss +8 -8
  55. package/styles/_fusionnew-definition.scss +8 -8
  56. package/styles/_highcontrast-definition.scss +42 -42
  57. package/styles/_highcontrast-light-definition.scss +42 -42
  58. package/styles/_material-dark-definition.scss +48 -49
  59. package/styles/_material-definition.scss +49 -50
  60. package/styles/_material3-dark-definition.scss +14 -15
  61. package/styles/_material3-definition.scss +15 -16
  62. package/styles/_tailwind-dark-definition.scss +15 -16
  63. package/styles/_tailwind-definition.scss +15 -16
  64. package/styles/animation/_all.scss +559 -535
  65. package/styles/bootstrap-dark.css +51 -235
  66. package/styles/bootstrap.css +51 -235
  67. package/styles/bootstrap4.css +51 -223
  68. package/styles/bootstrap5-dark.css +53 -228
  69. package/styles/bootstrap5.css +51 -226
  70. package/styles/common/_all.scss +2 -2
  71. package/styles/common/_core.scss +113 -111
  72. package/styles/common/_mixin.scss +9 -11
  73. package/styles/definition/_bds-dark.scss +1067 -1193
  74. package/styles/definition/_bds.scss +1327 -1488
  75. package/styles/definition/_bootstrap-dark.scss +207 -213
  76. package/styles/definition/_bootstrap.scss +202 -208
  77. package/styles/definition/_bootstrap4.scss +153 -159
  78. package/styles/definition/_bootstrap5-dark.scss +475 -481
  79. package/styles/definition/_bootstrap5.3-dark.scss +853 -1232
  80. package/styles/definition/_bootstrap5.3.scss +1486 -1579
  81. package/styles/definition/_bootstrap5.scss +475 -481
  82. package/styles/definition/_fabric-dark.scss +188 -194
  83. package/styles/definition/_fabric.scss +186 -192
  84. package/styles/definition/_fluent-dark.scss +488 -494
  85. package/styles/definition/_fluent.scss +488 -494
  86. package/styles/definition/_fluent2-dark.scss +1506 -1523
  87. package/styles/definition/_fluent2-highcontrast.scss +1506 -1523
  88. package/styles/definition/_fluent2.scss +2266 -2295
  89. package/styles/definition/_fusionnew-dark.scss +324 -330
  90. package/styles/definition/_fusionnew.scss +324 -331
  91. package/styles/definition/_highcontrast-light.scss +183 -189
  92. package/styles/definition/_highcontrast.scss +183 -189
  93. package/styles/definition/_material-dark.scss +187 -193
  94. package/styles/definition/_material.scss +180 -186
  95. package/styles/definition/_material3-dark.scss +654 -660
  96. package/styles/definition/_material3.scss +723 -729
  97. package/styles/definition/_tailwind-dark.scss +439 -445
  98. package/styles/definition/_tailwind.scss +437 -443
  99. package/styles/fabric-dark.css +51 -235
  100. package/styles/fabric.css +51 -235
  101. package/styles/fluent-dark.css +51 -226
  102. package/styles/fluent.css +51 -226
  103. package/styles/fluent2.css +82 -274
  104. package/styles/highcontrast-light.css +51 -235
  105. package/styles/highcontrast.css +51 -235
  106. package/styles/material-dark.css +51 -235
  107. package/styles/material.css +51 -235
  108. package/styles/material3-dark.css +51 -226
  109. package/styles/material3.css +51 -226
  110. package/styles/offline-theme/material-dark.css +51 -235
  111. package/styles/offline-theme/material.css +51 -235
  112. package/styles/offline-theme/tailwind-dark.css +51 -226
  113. package/styles/offline-theme/tailwind.css +51 -226
  114. package/styles/tailwind-dark.css +51 -226
  115. package/styles/tailwind.css +51 -226
  116. package/tslint.json +111 -0
  117. package/dist/ts/undefined +0 -67
  118. package/styles/_tailwind3-dark-definition.scss +0 -15
  119. package/styles/_tailwind3-definition.scss +0 -15
  120. package/styles/bds-lite.css +0 -3408
  121. package/styles/bds-lite.scss +0 -3
  122. package/styles/bds.css +0 -3408
  123. package/styles/bds.scss +0 -3
  124. package/styles/bootstrap-dark-lite.css +0 -3749
  125. package/styles/bootstrap-dark-lite.scss +0 -3
  126. package/styles/bootstrap-lite.css +0 -3749
  127. package/styles/bootstrap-lite.scss +0 -3
  128. package/styles/bootstrap4-lite.css +0 -3390
  129. package/styles/bootstrap4-lite.scss +0 -3
  130. package/styles/bootstrap5-dark-lite.css +0 -2966
  131. package/styles/bootstrap5-dark-lite.scss +0 -3
  132. package/styles/bootstrap5-lite.css +0 -2966
  133. package/styles/bootstrap5-lite.scss +0 -3
  134. package/styles/bootstrap5.3-lite.css +0 -3559
  135. package/styles/bootstrap5.3-lite.scss +0 -3
  136. package/styles/bootstrap5.3.css +0 -3559
  137. package/styles/bootstrap5.3.scss +0 -3
  138. package/styles/definition/_tailwind3-dark.scss +0 -1622
  139. package/styles/definition/_tailwind3.scss +0 -2093
  140. package/styles/fabric-dark-lite.css +0 -3734
  141. package/styles/fabric-dark-lite.scss +0 -3
  142. package/styles/fabric-lite.css +0 -3734
  143. package/styles/fabric-lite.scss +0 -3
  144. package/styles/fluent-dark-lite.css +0 -2966
  145. package/styles/fluent-dark-lite.scss +0 -3
  146. package/styles/fluent-lite.css +0 -2966
  147. package/styles/fluent-lite.scss +0 -3
  148. package/styles/fluent2-lite.css +0 -4017
  149. package/styles/fluent2-lite.scss +0 -3
  150. package/styles/highcontrast-light-lite.css +0 -3725
  151. package/styles/highcontrast-light-lite.scss +0 -3
  152. package/styles/highcontrast-lite.css +0 -3725
  153. package/styles/highcontrast-lite.scss +0 -3
  154. package/styles/material-dark-lite.css +0 -3702
  155. package/styles/material-dark-lite.scss +0 -3
  156. package/styles/material-lite.css +0 -3702
  157. package/styles/material-lite.scss +0 -3
  158. package/styles/material3-dark-lite.css +0 -3021
  159. package/styles/material3-dark-lite.scss +0 -3
  160. package/styles/material3-lite.css +0 -3077
  161. package/styles/material3-lite.scss +0 -3
  162. package/styles/tailwind-dark-lite.css +0 -2967
  163. package/styles/tailwind-dark-lite.scss +0 -3
  164. package/styles/tailwind-lite.css +0 -2967
  165. package/styles/tailwind-lite.scss +0 -3
  166. package/styles/tailwind3-lite.css +0 -3775
  167. package/styles/tailwind3-lite.scss +0 -3
  168. package/styles/tailwind3.css +0 -3775
  169. package/styles/tailwind3.scss +0 -3
@@ -1,287 +1,287 @@
1
- require('./crypto');
2
- var shell = require('shelljs');
3
- var os = require('os');
4
- var camelCase = require('pix-diff/lib/camelCase.js');
5
- var config = require('../../../../config.json');
6
- var request = require('request');
7
- var RepalceRegex = /"/g;
8
- var isDashBoardReport = config['dashBoardReport'];
9
- var timeCal = {};
10
- var fs = require('fs');
11
- isDashBoardReport = isDashBoardReport === undefined ? true : isDashBoardReport;
12
- if (isDashBoardReport) {
13
- var currentRepo = shell.exec('git config --get remote.origin.url', {
14
- silent: true
15
- })
16
- .stdout.split('essential-studio/')[1].replace('.git', '').replace('/', '').trim();
17
- var components = JSON.stringify(config.components);
18
- components = components.replace(RepalceRegex, '').replace('[', '').replace(']', '').trim();
19
- var branch = JSON.stringify(config.branchName);
20
- branch = branch.replace(RepalceRegex, '').trim();
21
- var toMail = config.toMailAddress;
22
- var ccMail = config.ccMailAddress;
23
- }
24
-
25
-
26
-
27
- var commonCap = {
28
- 'browserstack.user': global.encrypt_decrypt.decrypt('c517d44b27fd03d45d94ea52b59c6b4b'),
29
- 'browserstack.key': global.encrypt_decrypt.decrypt('2e03c613f7035effb9d2d467109d50cb0ed8418b5394cf084189878ae7fe4710'),
30
- "browserstack.debug": "false",
31
- }
32
- var defaultCap = [{
33
- "device": "Samsung Galaxy S8",
34
- "browserName": "chrome",
35
- "realMobile": "true",
36
- "os_version": "7.0"
37
- },
38
- {
39
- "device": "iPhone SE",
40
- "browserName": "safari",
41
- "realMobile": "true",
42
- "os_version": "11.2"
43
- }
44
- ];
45
- var capabilities = config['multiCapabilities'];
46
- capabilities = capabilities ? capabilities : defaultCap;
47
- capabilities.map((val, i) => {
48
- return Object.assign(val, commonCap);
49
- });
50
- exports.config = {
51
-
52
- seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
53
-
54
- multiCapabilities: capabilities,
55
-
56
- framework: 'jasmine',
57
-
58
- jasmineNodeOpts: {
59
- defaultTimeoutInterval: 1000000
60
- },
61
-
62
- // Path to change
63
- specs: ['../../../../e2e/mobile-tests/**/*.spec.js'],
64
-
65
- onComplete: function () {
66
- if (isDashBoardReport) {
67
- var failurecount = 0;
68
- var resultjson = require('../../../../jasmine-test-results.json');
69
- var key = Object.keys(resultjson);
70
- var totalcount = 0;
71
- for (var i = 0; i < key.length; i++) {
72
- var Objects = resultjson[key[i]]["specs"];
73
- totalcount = totalcount + Objects.length;
74
- for (var j = 0; j < Objects.length; j++) {
75
- if (Objects[j].status === "failed") {
76
- failurecount++;
77
- }
78
- }
79
- }
80
- ccMail.push("ej2core@syncfusion.com");
81
- var data = {
82
- RepositoryName: currentRepo,
83
- ComponentName: components,
84
- BranchName: branch,
85
- StartDate: new Date(),
86
- EndDate: new Date(),
87
- Type: "Mobile",
88
- TotalTestCaseCount: totalcount,
89
- FailureTestCaseCount: failurecount,
90
- SuccessTestCaseCount: totalcount - failurecount,
91
- Browser: browser.browserName,
92
- toMailAddress: toMail,
93
- ccMailAddress: ccMail
94
- };
95
- var status = failurecount.length ? 'Failure' : 'Success';
96
- var successCount = totalcount - failurecount;
97
- var notRun = totalcount - (successCount + failurecount);
98
- if (fs.existsSync('./testreport')) {
99
- shell.cd('./testreport');
100
- shell.exec('Syncfusion.UpdateTestResults.exe /Platform:"JavaScript - EJ2" /Control:"' + components +
101
- '" /TestingTool:"Selenium" /StartTime:"' + new Date().toLocaleTimeString() + '" /EndTime:"' + new Date().toLocaleTimeString() +
102
- '" /Status:"' + status + '" /TotalTestCase:' + totalcount +
103
- ' /SuccessCount:' + successCount + ' /FailureCount:' + failurecount + ' /NotRunCount:' + notRun + ' /UpdatedBy:"' + toMail[0] + '"');
104
- shell.cd('../');
105
- }
106
- request({
107
- url: 'https://ej2services.syncfusion.com/cicentral/api/getE2EReport',
108
- method: 'POST',
109
- json: true,
110
- body: data,
111
- headers: {
112
- 'authorization': 'ej2centrailzedstatus',
113
- 'content-type': 'application/json'
114
- }
115
- });
116
- }
117
- browser.driver.quit();
118
- console.log(browser.browserName + ' driver closed!');
119
- },
120
-
121
- onPrepare: function () {
122
- const PixDiff = require('pix-diff');
123
- const fs = require('fs');
124
- const path = require('path');
125
- browser.ignoreSynchronization = true;
126
- browser.waitForAngularEnabled = false;
127
- browser.isDesktop = false;
128
- timeCal['startTime'] = new Date().toLocaleTimeString();
129
- //Path to change
130
- browser.basePath = require('../../../../protractor.browser.json').basePath;
131
- var JSONReporter = require('jasmine-json-test-reporter');
132
- jasmine.getEnv().addReporter(new JSONReporter({
133
- file: 'jasmine-test-results.json',
134
- beautify: true,
135
- indentationLevel: 4 // used if beautify === true
136
- }));
137
- // Print User Agent
138
- browser.executeAsyncScript(function (callback) {
139
- callback(navigator.userAgent);
140
- }).then(function (uA) {
141
- console.log(uA);
142
- });
143
-
144
- browser.getCapabilities().then(function (cap) {
145
- browser.browserName = cap.get('browserName');
146
-
147
- browser.pixResult = PixDiff;
148
-
149
- browser.pixDiff = new PixDiff({
150
- basePath: './e2e',
151
- diffPath: './e2e',
152
- formatImageName: '{tag}'
153
- });
154
- browser.pixDiff.platformName = cap.get('platformName');
155
- browser.pixDiff.deviceModel = cap.get('deviceModel');
156
- browser.pixDiff.deviceName = cap.get('deviceName');
157
- if (cap.get('platformName') === 'Android') {
158
-
159
- browser.pixDiff.devicePath = browser.pixDiff.platformName + '/' + browser.pixDiff.deviceModel;
160
- } else {
161
- browser.pixDiff.devicePath = browser.pixDiff.platformName + '/' + browser.pixDiff.deviceName;
162
- }
163
- console.log('check Device Path is : ', browser.pixDiff.devicePath);
164
-
165
- //override difference path
166
- browser.pixDiff.diffPath = path.normalize(camelCase('./e2e/' + browser.pixDiff.devicePath + '/Diff/'));
167
- //create folder if not present
168
- createF(browser.pixDiff.diffPath);
169
-
170
- browser.compareScreen = function (element, fileName, opt) {
171
-
172
- var folderName = fileName;
173
- var fArr = fileName.split('/');
174
- if (fArr.length > 1) {
175
- fArr.splice(-1, 1);
176
- folderName = fArr.join('/')
177
- createF(camelCase('e2e/mobile/expected/' + browser.pixDiff.devicePath));
178
- createF(camelCase('e2e/mobile/actual/' + browser.pixDiff.devicePath));
179
- }
180
- // thresholdType: 'percent',
181
- // threshold: 0.009,
182
- var option = {
183
- imageAPath: '/mobile/expected/' + browser.pixDiff.devicePath + '/' + fileName, // Use file-path
184
- imageBPath: '/mobile/actual/' + browser.pixDiff.devicePath + '/' + fileName,
185
- filter: ['grayScale'],
186
- debug: true,
187
- hideShift: true,
188
- };
189
- var doneFn = arguments[arguments.length - 1];
190
- if (typeof opt === 'object' && Object.keys(opt).length) {
191
- Object.assign(option, opt);
192
- }
193
-
194
- browser.pixDiff.saveRegion(element, '/mobile/Actual/' + browser.pixDiff.devicePath + '/' + fileName, option).then(() => {
195
- var fPathName = path.resolve(__dirname, '../../../../' + camelCase('e2e/mobile/Expected/' + browser.pixDiff.devicePath + '/' + fileName) + '.png');
196
- if (!fs.existsSync(fPathName) && fs.existsSync(fPathName.replace("Expected", "Actual"))) {
197
- fs.copyFileSync(fPathName.replace("Expected", "Actual"), fPathName);
198
- console.log('Expected Image Created : /mobile/Expected/' + browser.pixDiff.devicePath + '/' + fileName);
199
- }
200
- browser.saveCheckImage(element, fileName, option, doneFn);
201
- });
202
-
203
-
204
- }
205
- browser.saveCheckImage = function (element, fileName, option, doneFn) {
206
- browser.pixDiff.checkRegion(element, '/mobile/Expected/' + browser.pixDiff.devicePath + '/' + fileName, option).then(function (result) {
207
- //
208
- // * - `RESULT_UNKNOWN`: 0
209
- // * - `RESULT_DIFFERENT`: 1
210
- // * - `RESULT_SIMILAR`: 7
211
- // * - `RESULT_IDENTICAL`: 5
212
- expect(result.code).toEqual(browser.pixResult.RESULT_IDENTICAL);
213
- if (typeof doneFn === 'function') {
214
- doneFn();
215
- }
216
- });
217
-
218
- }
219
-
220
- browser.waitForEvent = function (id, moduleName, eventName) {
221
- return browser.executeAsyncScript(function (id, moduleName, eventName, callback) {
222
- var instances = document.getElementById(id).ej2_instances;
223
- var instanceObj;
224
- for (var i = 0; instances && i < instances.length; i++) {
225
- if (instances[i].getModuleName() == moduleName) {
226
- instanceObj = instances[i]
227
- }
228
- }
229
- if (instanceObj) {
230
- var handler;
231
- handler = function (e) {
232
- instanceObj.removeEventListener(eventName, handler);
233
- callback();
234
- };
235
- instanceObj.addEventListener(eventName, handler);
236
- } else {
237
- callback();
238
- }
239
- }, id, moduleName, eventName);
240
- }
241
-
242
- browser.injectScript = function (path, callback) {
243
- return browser.executeAsyncScript(function (path) {
244
- var head = document.getElementsByTagName('head')[0];
245
- var script = document.createElement('script');
246
- script.type = 'text/javascript';
247
- script.onload = function () {
248
- callback();
249
- }
250
- script.src = path;
251
- head.appendChild(script);
252
- }, browser.basePath + path);
253
-
254
- }
255
-
256
- browser.injectCss = function (content) {
257
- return browser.wait(browser.executeScript(`
258
- var style = document.createElement('style');
259
- style.id = 'browsercss';
260
- if (style.styleSheet) {style.styleSheet.cssText = '` + content + `';}
261
- else{style.appendChild(document.createTextNode('` + content + `'));}
262
- document.head.appendChild(style);
263
- `));
264
- }
265
- browser.load = function (path) {
266
- browser.get(browser.basePath + path);
267
- browser.wait(function () {
268
- browser.sleep(30000);
269
- return element(By.css('.e-control')).isDisplayed();
270
- }, 30000);
271
- if (browser.css) {
272
- browser.injectCss(browser.css);
273
- }
274
- }
275
- browser.loadAsync = function (path) {
276
- return browser.get(browser.basePath + path);
277
- }
278
-
279
-
280
- });
281
-
282
- },
283
- };
284
-
285
- function createF(path) {
286
- shell.mkdir('-p', path);
1
+ require('./crypto');
2
+ var shell = require('shelljs');
3
+ var os = require('os');
4
+ var camelCase = require('pix-diff/lib/camelCase.js');
5
+ var config = require('../../../../config.json');
6
+ var request = require('request');
7
+ var RepalceRegex = /"/g;
8
+ var isDashBoardReport = config['dashBoardReport'];
9
+ var timeCal = {};
10
+ var fs = require('fs');
11
+ isDashBoardReport = isDashBoardReport === undefined ? true : isDashBoardReport;
12
+ if (isDashBoardReport) {
13
+ var currentRepo = shell.exec('git config --get remote.origin.url', {
14
+ silent: true
15
+ })
16
+ .stdout.split('essential-studio/')[1].replace('.git', '').replace('/', '').trim();
17
+ var components = JSON.stringify(config.components);
18
+ components = components.replace(RepalceRegex, '').replace('[', '').replace(']', '').trim();
19
+ var branch = JSON.stringify(config.branchName);
20
+ branch = branch.replace(RepalceRegex, '').trim();
21
+ var toMail = config.toMailAddress;
22
+ var ccMail = config.ccMailAddress;
23
+ }
24
+
25
+
26
+
27
+ var commonCap = {
28
+ 'browserstack.user': global.encrypt_decrypt.decrypt('c517d44b27fd03d45d94ea52b59c6b4b'),
29
+ 'browserstack.key': global.encrypt_decrypt.decrypt('2e03c613f7035effb9d2d467109d50cb0ed8418b5394cf084189878ae7fe4710'),
30
+ "browserstack.debug": "false",
31
+ }
32
+ var defaultCap = [{
33
+ "device": "Samsung Galaxy S8",
34
+ "browserName": "chrome",
35
+ "realMobile": "true",
36
+ "os_version": "7.0"
37
+ },
38
+ {
39
+ "device": "iPhone SE",
40
+ "browserName": "safari",
41
+ "realMobile": "true",
42
+ "os_version": "11.2"
43
+ }
44
+ ];
45
+ var capabilities = config['multiCapabilities'];
46
+ capabilities = capabilities ? capabilities : defaultCap;
47
+ capabilities.map((val, i) => {
48
+ return Object.assign(val, commonCap);
49
+ });
50
+ exports.config = {
51
+
52
+ seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
53
+
54
+ multiCapabilities: capabilities,
55
+
56
+ framework: 'jasmine',
57
+
58
+ jasmineNodeOpts: {
59
+ defaultTimeoutInterval: 1000000
60
+ },
61
+
62
+ // Path to change
63
+ specs: ['../../../../e2e/mobile-tests/**/*.spec.js'],
64
+
65
+ onComplete: function () {
66
+ if (isDashBoardReport) {
67
+ var failurecount = 0;
68
+ var resultjson = require('../../../../jasmine-test-results.json');
69
+ var key = Object.keys(resultjson);
70
+ var totalcount = 0;
71
+ for (var i = 0; i < key.length; i++) {
72
+ var Objects = resultjson[key[i]]["specs"];
73
+ totalcount = totalcount + Objects.length;
74
+ for (var j = 0; j < Objects.length; j++) {
75
+ if (Objects[j].status === "failed") {
76
+ failurecount++;
77
+ }
78
+ }
79
+ }
80
+ ccMail.push("ej2core@syncfusion.com");
81
+ var data = {
82
+ RepositoryName: currentRepo,
83
+ ComponentName: components,
84
+ BranchName: branch,
85
+ StartDate: new Date(),
86
+ EndDate: new Date(),
87
+ Type: "Mobile",
88
+ TotalTestCaseCount: totalcount,
89
+ FailureTestCaseCount: failurecount,
90
+ SuccessTestCaseCount: totalcount - failurecount,
91
+ Browser: browser.browserName,
92
+ toMailAddress: toMail,
93
+ ccMailAddress: ccMail
94
+ };
95
+ var status = failurecount.length ? 'Failure' : 'Success';
96
+ var successCount = totalcount - failurecount;
97
+ var notRun = totalcount - (successCount + failurecount);
98
+ if (fs.existsSync('./testreport')) {
99
+ shell.cd('./testreport');
100
+ shell.exec('Syncfusion.UpdateTestResults.exe /Platform:"JavaScript - EJ2" /Control:"' + components +
101
+ '" /TestingTool:"Selenium" /StartTime:"' + new Date().toLocaleTimeString() + '" /EndTime:"' + new Date().toLocaleTimeString() +
102
+ '" /Status:"' + status + '" /TotalTestCase:' + totalcount +
103
+ ' /SuccessCount:' + successCount + ' /FailureCount:' + failurecount + ' /NotRunCount:' + notRun + ' /UpdatedBy:"' + toMail[0] + '"');
104
+ shell.cd('../');
105
+ }
106
+ request({
107
+ url: 'https://ej2services.syncfusion.com/cicentral/api/getE2EReport',
108
+ method: 'POST',
109
+ json: true,
110
+ body: data,
111
+ headers: {
112
+ 'authorization': 'ej2centrailzedstatus',
113
+ 'content-type': 'application/json'
114
+ }
115
+ });
116
+ }
117
+ browser.driver.quit();
118
+ console.log(browser.browserName + ' driver closed!');
119
+ },
120
+
121
+ onPrepare: function () {
122
+ const PixDiff = require('pix-diff');
123
+ const fs = require('fs');
124
+ const path = require('path');
125
+ browser.ignoreSynchronization = true;
126
+ browser.waitForAngularEnabled = false;
127
+ browser.isDesktop = false;
128
+ timeCal['startTime'] = new Date().toLocaleTimeString();
129
+ //Path to change
130
+ browser.basePath = require('../../../../protractor.browser.json').basePath;
131
+ var JSONReporter = require('jasmine-json-test-reporter');
132
+ jasmine.getEnv().addReporter(new JSONReporter({
133
+ file: 'jasmine-test-results.json',
134
+ beautify: true,
135
+ indentationLevel: 4 // used if beautify === true
136
+ }));
137
+ // Print User Agent
138
+ browser.executeAsyncScript(function (callback) {
139
+ callback(navigator.userAgent);
140
+ }).then(function (uA) {
141
+ console.log(uA);
142
+ });
143
+
144
+ browser.getCapabilities().then(function (cap) {
145
+ browser.browserName = cap.get('browserName');
146
+
147
+ browser.pixResult = PixDiff;
148
+
149
+ browser.pixDiff = new PixDiff({
150
+ basePath: './e2e',
151
+ diffPath: './e2e',
152
+ formatImageName: '{tag}'
153
+ });
154
+ browser.pixDiff.platformName = cap.get('platformName');
155
+ browser.pixDiff.deviceModel = cap.get('deviceModel');
156
+ browser.pixDiff.deviceName = cap.get('deviceName');
157
+ if (cap.get('platformName') === 'Android') {
158
+
159
+ browser.pixDiff.devicePath = browser.pixDiff.platformName + '/' + browser.pixDiff.deviceModel;
160
+ } else {
161
+ browser.pixDiff.devicePath = browser.pixDiff.platformName + '/' + browser.pixDiff.deviceName;
162
+ }
163
+ console.log('check Device Path is : ', browser.pixDiff.devicePath);
164
+
165
+ //override difference path
166
+ browser.pixDiff.diffPath = path.normalize(camelCase('./e2e/' + browser.pixDiff.devicePath + '/Diff/'));
167
+ //create folder if not present
168
+ createF(browser.pixDiff.diffPath);
169
+
170
+ browser.compareScreen = function (element, fileName, opt) {
171
+
172
+ var folderName = fileName;
173
+ var fArr = fileName.split('/');
174
+ if (fArr.length > 1) {
175
+ fArr.splice(-1, 1);
176
+ folderName = fArr.join('/')
177
+ createF(camelCase('e2e/mobile/expected/' + browser.pixDiff.devicePath));
178
+ createF(camelCase('e2e/mobile/actual/' + browser.pixDiff.devicePath));
179
+ }
180
+ // thresholdType: 'percent',
181
+ // threshold: 0.009,
182
+ var option = {
183
+ imageAPath: '/mobile/expected/' + browser.pixDiff.devicePath + '/' + fileName, // Use file-path
184
+ imageBPath: '/mobile/actual/' + browser.pixDiff.devicePath + '/' + fileName,
185
+ filter: ['grayScale'],
186
+ debug: true,
187
+ hideShift: true,
188
+ };
189
+ var doneFn = arguments[arguments.length - 1];
190
+ if (typeof opt === 'object' && Object.keys(opt).length) {
191
+ Object.assign(option, opt);
192
+ }
193
+
194
+ browser.pixDiff.saveRegion(element, '/mobile/Actual/' + browser.pixDiff.devicePath + '/' + fileName, option).then(() => {
195
+ var fPathName = path.resolve(__dirname, '../../../../' + camelCase('e2e/mobile/Expected/' + browser.pixDiff.devicePath + '/' + fileName) + '.png');
196
+ if (!fs.existsSync(fPathName) && fs.existsSync(fPathName.replace("Expected", "Actual"))) {
197
+ fs.copyFileSync(fPathName.replace("Expected", "Actual"), fPathName);
198
+ console.log('Expected Image Created : /mobile/Expected/' + browser.pixDiff.devicePath + '/' + fileName);
199
+ }
200
+ browser.saveCheckImage(element, fileName, option, doneFn);
201
+ });
202
+
203
+
204
+ }
205
+ browser.saveCheckImage = function (element, fileName, option, doneFn) {
206
+ browser.pixDiff.checkRegion(element, '/mobile/Expected/' + browser.pixDiff.devicePath + '/' + fileName, option).then(function (result) {
207
+ //
208
+ // * - `RESULT_UNKNOWN`: 0
209
+ // * - `RESULT_DIFFERENT`: 1
210
+ // * - `RESULT_SIMILAR`: 7
211
+ // * - `RESULT_IDENTICAL`: 5
212
+ expect(result.code).toEqual(browser.pixResult.RESULT_IDENTICAL);
213
+ if (typeof doneFn === 'function') {
214
+ doneFn();
215
+ }
216
+ });
217
+
218
+ }
219
+
220
+ browser.waitForEvent = function (id, moduleName, eventName) {
221
+ return browser.executeAsyncScript(function (id, moduleName, eventName, callback) {
222
+ var instances = document.getElementById(id).ej2_instances;
223
+ var instanceObj;
224
+ for (var i = 0; instances && i < instances.length; i++) {
225
+ if (instances[i].getModuleName() == moduleName) {
226
+ instanceObj = instances[i]
227
+ }
228
+ }
229
+ if (instanceObj) {
230
+ var handler;
231
+ handler = function (e) {
232
+ instanceObj.removeEventListener(eventName, handler);
233
+ callback();
234
+ };
235
+ instanceObj.addEventListener(eventName, handler);
236
+ } else {
237
+ callback();
238
+ }
239
+ }, id, moduleName, eventName);
240
+ }
241
+
242
+ browser.injectScript = function (path, callback) {
243
+ return browser.executeAsyncScript(function (path) {
244
+ var head = document.getElementsByTagName('head')[0];
245
+ var script = document.createElement('script');
246
+ script.type = 'text/javascript';
247
+ script.onload = function () {
248
+ callback();
249
+ }
250
+ script.src = path;
251
+ head.appendChild(script);
252
+ }, browser.basePath + path);
253
+
254
+ }
255
+
256
+ browser.injectCss = function (content) {
257
+ return browser.wait(browser.executeScript(`
258
+ var style = document.createElement('style');
259
+ style.id = 'browsercss';
260
+ if (style.styleSheet) {style.styleSheet.cssText = '` + content + `';}
261
+ else{style.appendChild(document.createTextNode('` + content + `'));}
262
+ document.head.appendChild(style);
263
+ `));
264
+ }
265
+ browser.load = function (path) {
266
+ browser.get(browser.basePath + path);
267
+ browser.wait(function () {
268
+ browser.sleep(30000);
269
+ return element(By.css('.e-control')).isDisplayed();
270
+ }, 30000);
271
+ if (browser.css) {
272
+ browser.injectCss(browser.css);
273
+ }
274
+ }
275
+ browser.loadAsync = function (path) {
276
+ return browser.get(browser.basePath + path);
277
+ }
278
+
279
+
280
+ });
281
+
282
+ },
283
+ };
284
+
285
+ function createF(path) {
286
+ shell.mkdir('-p', path);
287
287
  }