froth-webdriverio-framework 3.0.81 → 3.0.83
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.
- package/{commonMethods → froth_common_actions}/Utils.js +3 -0
- package/{commonMethods → froth_common_actions}/swipe.js +28 -38
- package/{config → froth_configs}/commonconfig.js +40 -39
- package/{config → froth_configs}/wdio.common.conf.js +0 -1
- package/package.json +1 -3
- package/config/android.conf.js +0 -49
- package/config/api.conf.bs.js +0 -76
- package/config/api.conf.js +0 -77
- package/config/common.mobile.conf.js +0 -45
- package/config/dataHandler.js +0 -5
- package/config/injectimage.js +0 -4
- package/config/ios.conf.js +0 -47
- package/config/web.conf.bs.js +0 -76
- package/config/web.conf.js +0 -70
- /package/{commonMethods → froth_common_actions}/alert.js +0 -0
- /package/{commonMethods → froth_common_actions}/apicall.js +0 -0
- /package/{commonMethods → froth_common_actions}/assert.js +0 -0
- /package/{commonMethods → froth_common_actions}/click.js +0 -0
- /package/{commonMethods → froth_common_actions}/dropDown.js +0 -0
- /package/{commonMethods → froth_common_actions}/jwt.js +0 -0
- /package/{commonMethods → froth_common_actions}/random.js +0 -0
- /package/{commonMethods → froth_common_actions}/scroll.js +0 -0
- /package/{commonMethods → froth_common_actions}/storeToBuffer.js +0 -0
- /package/{config → froth_configs}/setallDatailinBuffer.js +0 -0
|
@@ -13,6 +13,7 @@ let swipeLeft = null;
|
|
|
13
13
|
let swipeUp = null;
|
|
14
14
|
let swipeDown = null;
|
|
15
15
|
let swipetoFit = null;
|
|
16
|
+
let swipeWithCoordinates = null;
|
|
16
17
|
|
|
17
18
|
let clickIfVisible = null;
|
|
18
19
|
|
|
@@ -59,6 +60,7 @@ swipeLeft = require(basepath + '/swipe').swipeleft;
|
|
|
59
60
|
swipeRight = require(basepath + '/swipe').swiperight;
|
|
60
61
|
swipeUp = require(basepath + '/swipe').swipeup;
|
|
61
62
|
swipetoFit= require(basepath + '/swipe').swipetofit;
|
|
63
|
+
swipeWithCoordinates = require(basepath + '/swipe').swipewithcoordinates;
|
|
62
64
|
|
|
63
65
|
clickIfVisible = require(basepath + "/click").clickIfVisible;
|
|
64
66
|
clickByIdWithExecute = require(basepath + "/click").clickByIdWithExecute;
|
|
@@ -121,5 +123,6 @@ module.exports = {
|
|
|
121
123
|
swipeDown,
|
|
122
124
|
swipeUp,
|
|
123
125
|
swipetoFit,
|
|
126
|
+
swipeWithCoordinates,
|
|
124
127
|
generateJWT
|
|
125
128
|
};
|
|
@@ -56,6 +56,23 @@ async function swipedown(selector, yoffset, speedinsec) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
async function swipewithcoordinates(StartX, StartY, EndX, EndY) {
|
|
60
|
+
|
|
61
|
+
await driver.performActions([
|
|
62
|
+
{
|
|
63
|
+
type: "pointer",
|
|
64
|
+
id: "finger1",
|
|
65
|
+
parameters: { pointerType: "touch" },
|
|
66
|
+
actions: [
|
|
67
|
+
{ type: "pointerMove", duration: 0, x: StartX, y: StartY },
|
|
68
|
+
{ type: "pointerDown", button: 0 },
|
|
69
|
+
{ type: "pause", duration: 300 },
|
|
70
|
+
{ type: "pointerMove", duration: 1000, x: EndX, y: EndY },
|
|
71
|
+
{ type: "pointerUp", button: 0 }
|
|
72
|
+
],
|
|
73
|
+
}
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
59
76
|
async function swipetofit() {
|
|
60
77
|
// Get screen size dynamically
|
|
61
78
|
const screenSize = await driver.getWindowRect();
|
|
@@ -65,17 +82,17 @@ async function swipetofit() {
|
|
|
65
82
|
console.log(`Screen Size: Width=${screenWidth}, Height=${screenHeight}`);
|
|
66
83
|
|
|
67
84
|
// Define approximate positions for corners
|
|
68
|
-
const topRightStartX = screenWidth * 0.
|
|
69
|
-
const topRightStartY = screenHeight * 0.
|
|
85
|
+
const topRightStartX = screenWidth * 0.88; // Top-right corner
|
|
86
|
+
const topRightStartY = screenHeight * 0.44;
|
|
70
87
|
|
|
71
|
-
const topRightEndX = screenWidth * 0.
|
|
72
|
-
const topRightEndY = screenHeight * 0.
|
|
88
|
+
const topRightEndX = screenWidth * 0.96; // Expand to the right
|
|
89
|
+
const topRightEndY = screenHeight * 0.39; // Move upwards slightly
|
|
73
90
|
|
|
74
|
-
const bottomLeftStartX = screenWidth * 0.
|
|
75
|
-
const bottomLeftStartY = screenHeight * 0.
|
|
91
|
+
const bottomLeftStartX = screenWidth * 0.12; // Bottom-left corner
|
|
92
|
+
const bottomLeftStartY = screenHeight * 0.69;
|
|
76
93
|
|
|
77
|
-
const bottomLeftEndX = screenWidth * 0.
|
|
78
|
-
const bottomLeftEndY = screenHeight * 0.
|
|
94
|
+
const bottomLeftEndX = screenWidth * 0.014; // Expand to the left
|
|
95
|
+
const bottomLeftEndY = screenHeight * 0.73; // Move down slightly
|
|
79
96
|
|
|
80
97
|
console.log(`Resizing top-right from (${topRightStartX}, ${topRightStartY}) to (${topRightEndX}, ${topRightEndY})`);
|
|
81
98
|
console.log(`Resizing bottom-left from (${bottomLeftStartX}, ${bottomLeftStartY}) to (${bottomLeftEndX}, ${bottomLeftEndY})`);
|
|
@@ -90,7 +107,7 @@ async function swipetofit() {
|
|
|
90
107
|
{ type: "pointerMove", duration: 0, x: topRightStartX, y: topRightStartY },
|
|
91
108
|
{ type: "pointerDown", button: 0 },
|
|
92
109
|
{ type: "pause", duration: 300 },
|
|
93
|
-
{ type: "pointerMove", duration:
|
|
110
|
+
{ type: "pointerMove", duration: 1000, x: topRightEndX, y: topRightEndY },
|
|
94
111
|
{ type: "pointerUp", button: 0 }
|
|
95
112
|
],
|
|
96
113
|
}
|
|
@@ -106,7 +123,7 @@ async function swipetofit() {
|
|
|
106
123
|
{ type: "pointerMove", duration: 0, x: bottomLeftStartX, y: bottomLeftStartY },
|
|
107
124
|
{ type: "pointerDown", button: 0 },
|
|
108
125
|
{ type: "pause", duration: 300 },
|
|
109
|
-
{ type: "pointerMove", duration:
|
|
126
|
+
{ type: "pointerMove", duration: 1000, x: bottomLeftEndX, y: bottomLeftEndY },
|
|
110
127
|
{ type: "pointerUp", button: 0 }
|
|
111
128
|
],
|
|
112
129
|
}
|
|
@@ -116,31 +133,4 @@ async function swipetofit() {
|
|
|
116
133
|
}
|
|
117
134
|
|
|
118
135
|
|
|
119
|
-
|
|
120
|
-
// async function swipetofit() {
|
|
121
|
-
// try {
|
|
122
|
-
// const { width, height } = await driver.getWindowRect();
|
|
123
|
-
|
|
124
|
-
// console.log('width and height:', width, height);
|
|
125
|
-
// // ⬅ Swipe from right to left (Full Swipe)
|
|
126
|
-
|
|
127
|
-
// await driver.touchAction([
|
|
128
|
-
// { action: 'press', x: width - 10, y: height / 2 }, // Start near the right edge
|
|
129
|
-
// { action: 'wait', ms: 500 }, // Hold to stabilize
|
|
130
|
-
// { action: 'moveTo', x: 10, y: height / 2 }, // Move to the left edge
|
|
131
|
-
// { action: 'release' }
|
|
132
|
-
// ]);
|
|
133
|
-
// // ⬅ Swipe from Left to Right (Full Swipe)
|
|
134
|
-
|
|
135
|
-
// await driver.touchAction([
|
|
136
|
-
// { action: 'press', x: 10, y: height / 2 }, // Start near the left edge
|
|
137
|
-
// { action: 'wait', ms: 500 },
|
|
138
|
-
// { action: 'moveTo', x: width - 10, y: height / 2 }, // Move to the right edge
|
|
139
|
-
// { action: 'release' }
|
|
140
|
-
// ]);
|
|
141
|
-
|
|
142
|
-
// } catch (error) {
|
|
143
|
-
// console.error(error.message);
|
|
144
|
-
// }
|
|
145
|
-
// }
|
|
146
|
-
module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit };
|
|
136
|
+
module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit ,swipewithcoordinates};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
global.BUFFER = new LocalStorage('./storage');
|
|
1
3
|
const setAllDetails = require("./setallDatailinBuffer")
|
|
2
4
|
const { LocalStorage } = require('node-localstorage');
|
|
3
|
-
global.BUFFER = new LocalStorage('./storage');
|
|
4
|
-
const path = require('path');
|
|
5
5
|
const exeDetails = require("../api/getexecutionDetails")
|
|
6
6
|
const getBSSessionDetails = require("../api/browsersatckSessionInfo").getBSSessionDetails;
|
|
7
7
|
const { fail } = require("assert");
|
|
8
|
+
const { platform } = require("os");
|
|
8
9
|
//const isBrowserStackEnabled = process.env.BROWSERSTACK;
|
|
9
10
|
let starttime;
|
|
10
11
|
let endtime;
|
|
@@ -23,7 +24,7 @@ const commonconfig = {
|
|
|
23
24
|
// await setAllDetails.setIntegrationsDetails();
|
|
24
25
|
await setAllDetails.setSuiteDetails();
|
|
25
26
|
await setAllDetails.setTestDataDetails();
|
|
26
|
-
console.log("on prepare:",JSON.stringify(capabilities))
|
|
27
|
+
console.log("on prepare:", JSON.stringify(capabilities))
|
|
27
28
|
// console.log("ALL JSON DATA in env variable :" + JSON.stringify(process.env));
|
|
28
29
|
} catch (e) {
|
|
29
30
|
console.log("====> Error in onPrepare:", e);
|
|
@@ -36,14 +37,15 @@ const commonconfig = {
|
|
|
36
37
|
console.log('====> This is the beforesession hook');
|
|
37
38
|
// Perform any setup or pre-test actions here
|
|
38
39
|
// console.log("Capabilities:", capabilities);
|
|
39
|
-
|
|
40
|
+
|
|
40
41
|
console.log("specdat:", specs);
|
|
41
42
|
console.log("length:", specs.length);
|
|
42
|
-
console.log("capabilities:", capabilities);
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
// console.log("capabilities:", capabilities);
|
|
44
|
+
capabilities.app = process.env.BROWSERSTACK_APP_PATH;
|
|
45
|
+
capabilities['browserstack.uploadMedia'] = process.env.MEDIA_FILES;
|
|
46
|
+
// console.log("====>",capabilities)
|
|
45
47
|
console.log(`Running tests on: ${capabilities.platformName} ${capabilities.browserName} ${capabilities.browserVersion}`);
|
|
46
|
-
|
|
48
|
+
|
|
47
49
|
|
|
48
50
|
// console.log('specs:', specs);
|
|
49
51
|
// console.log("Config:", config);
|
|
@@ -58,10 +60,9 @@ const commonconfig = {
|
|
|
58
60
|
|
|
59
61
|
starttime = new Date().getTime();
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// }
|
|
63
|
+
if (platform === 'browserstack')
|
|
64
|
+
await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
|
|
65
|
+
|
|
65
66
|
const resultdetails = {};
|
|
66
67
|
exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
67
68
|
|
|
@@ -158,7 +159,7 @@ const commonconfig = {
|
|
|
158
159
|
afterSession: async function (config, capabilities, specs) {
|
|
159
160
|
console.log('====> This is the aftersession hook');
|
|
160
161
|
// Perform any cleanup or post-test actions here
|
|
161
|
-
console.log("Capabilities:", capabilities);
|
|
162
|
+
// console.log("Capabilities:", capabilities);
|
|
162
163
|
console.log("Specs:", specs);
|
|
163
164
|
console.log("Config:", config);
|
|
164
165
|
|
|
@@ -166,7 +167,7 @@ const commonconfig = {
|
|
|
166
167
|
let totalDuration = endtime - starttime;
|
|
167
168
|
console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
|
|
168
169
|
|
|
169
|
-
|
|
170
|
+
if (platform === 'browserstack')
|
|
170
171
|
await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
|
|
171
172
|
|
|
172
173
|
const resultdetails = {}
|
|
@@ -178,39 +179,39 @@ const commonconfig = {
|
|
|
178
179
|
BUFFER.clear();
|
|
179
180
|
|
|
180
181
|
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
// Perform any cleanup or post-test actions here
|
|
183
|
+
},
|
|
183
184
|
|
|
184
|
-
|
|
185
|
+
onComplete: async function (exitCode, config, capabilities, results) {
|
|
185
186
|
|
|
186
|
-
|
|
187
|
+
console.log('====> This is the onComplete hook', results);
|
|
187
188
|
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
console.log('====> Test Results Summary ');
|
|
190
|
+
console.log('----------------------------');
|
|
190
191
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
console.log('Total Tests:', results.total);
|
|
193
|
+
console.log('Passed:', results.passed);
|
|
194
|
+
console.log('Failed:', results.failed);
|
|
195
|
+
console.log('Skipped:', results.skipped);
|
|
196
|
+
console.log('Execution Time:', results.duration);
|
|
197
|
+
console.log('Exit Code:', exitCode);
|
|
198
|
+
console.log('====> All tests are done, exiting the browser session.');
|
|
198
199
|
|
|
199
|
-
|
|
200
|
+
}
|
|
200
201
|
|
|
201
|
-
};
|
|
202
|
+
};
|
|
202
203
|
|
|
203
|
-
async function secondsToTime(secs) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
async function secondsToTime(secs) {
|
|
205
|
+
let hours = Math.floor(secs / 3600);
|
|
206
|
+
let minutes = Math.floor((secs % 3600) / 60);
|
|
207
|
+
let seconds = secs % 60;
|
|
207
208
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
// Adding leading zeros if the value is less than 10
|
|
210
|
+
if (hours < 10) hours = '0' + hours;
|
|
211
|
+
if (minutes < 10) minutes = '0' + minutes;
|
|
212
|
+
if (seconds < 10) seconds = '0' + seconds;
|
|
213
|
+
console.log("Time:" + hours + ':' + minutes + ':' + seconds);
|
|
214
|
+
return hours + ':' + minutes + ':' + seconds;
|
|
214
215
|
}
|
|
215
216
|
|
|
216
217
|
async function convertTimetoHHMMSS(time) {
|
|
@@ -12,7 +12,6 @@ console.log('PLATFORM:', PLATFORM);
|
|
|
12
12
|
const capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(),configFile)), 'utf8'));
|
|
13
13
|
const SUITE_FILE = path.resolve(process.cwd(), process.env.SUITE);
|
|
14
14
|
|
|
15
|
-
//const SUITE_FILE = process.env.SUITE;
|
|
16
15
|
console.log('SUITE_FILE:', SUITE_FILE);
|
|
17
16
|
|
|
18
17
|
capabilities.buildName = process.env.BROWSERSTACK_BUILD_NAME;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.83",
|
|
4
4
|
"readme": "WebdriverIO Integration",
|
|
5
5
|
"description": "WebdriverIO and BrowserStack App Automate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,8 +45,6 @@
|
|
|
45
45
|
"mysql2": "^3.10.2",
|
|
46
46
|
"node-fetch": "^3.3.2",
|
|
47
47
|
"node-localstorage": "^3.0.5",
|
|
48
|
-
"pg": "^8.12.0",
|
|
49
|
-
"pg-promise": "^11.9.0",
|
|
50
48
|
"randexp": "^0.5.3",
|
|
51
49
|
"ts-node": "^10.9.2",
|
|
52
50
|
"typescript": "^5.4.5"
|
package/config/android.conf.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const deepmerge = require('deepmerge')
|
|
2
|
-
process.env.BROWSERSTACK = true;
|
|
3
|
-
const commonmobileconfig = require('./common.mobile.conf');
|
|
4
|
-
|
|
5
|
-
const androidConfig = deepmerge.all([commonmobileconfig, {
|
|
6
|
-
services: [
|
|
7
|
-
[
|
|
8
|
-
'browserstack',
|
|
9
|
-
{
|
|
10
|
-
// testObservability: true,
|
|
11
|
-
// buildName: "ANDROID BUILD",
|
|
12
|
-
// buildIdentifier: "ANDROID BUILD_" + process.env.BUILD_NUMBER,
|
|
13
|
-
browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
|
|
14
|
-
opts: {
|
|
15
|
-
forcelocal: false
|
|
16
|
-
},
|
|
17
|
-
app: process.env.BROWSERSTACK_APP_PATH
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
],
|
|
21
|
-
|
|
22
|
-
capabilities: [{
|
|
23
|
-
'bstack:options': {
|
|
24
|
-
projectName: process.env.PROJECTNAME || "roboticodigital",
|
|
25
|
-
|
|
26
|
-
deviceName: process.env.DEVICENAME || 'Samsung Galaxy S23 Ultra',
|
|
27
|
-
platformVersion: process.env.OSVERSION || '13.0',
|
|
28
|
-
platformName: 'android',
|
|
29
|
-
interactiveDebugging: true,
|
|
30
|
-
buildName: process.env.BROWSERSTACK_BUILD_NAME || 'Android_Build',
|
|
31
|
-
networkLogs: "true",
|
|
32
|
-
debug: "true",
|
|
33
|
-
appProfiling: "true",
|
|
34
|
-
//enableCameraImageInjection: true,
|
|
35
|
-
// enableCameraVideoInjection: true,
|
|
36
|
-
deviceOrientation: process.env.DEVICENAME.toLowerCase().includes('tab') ? 'landscape' : 'portrait',
|
|
37
|
-
}
|
|
38
|
-
}],
|
|
39
|
-
before: function (capabilities, specs) {
|
|
40
|
-
process.env.BS_SESSION_TYPE = "app-automate";
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
}]);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
module.exports = androidConfig;
|
|
48
|
-
|
|
49
|
-
|
package/config/api.conf.bs.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const deepmerge = require('deepmerge')
|
|
2
|
-
const commonmobileconfig = require('./common.mobile.conf');
|
|
3
|
-
|
|
4
|
-
const apiconfig = deepmerge.all([commonmobileconfig, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
services: [
|
|
8
|
-
['browserstack', {
|
|
9
|
-
|
|
10
|
-
browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
|
|
11
|
-
opts: {
|
|
12
|
-
forcelocal: false,
|
|
13
|
-
// localIdentifier: "webdriverio-appium"
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
}]
|
|
17
|
-
],
|
|
18
|
-
// ====================
|
|
19
|
-
// Capabilities
|
|
20
|
-
// ====================
|
|
21
|
-
capabilities: [
|
|
22
|
-
{
|
|
23
|
-
'bstack:options': {
|
|
24
|
-
projectName: process.env.PROJECTNAME || "roboticodigital",
|
|
25
|
-
|
|
26
|
-
browserName: process.env.BROWSERSTACK_BROWSER || 'chrome', // Choose the browser you want to test
|
|
27
|
-
browserVersion: process.env.BROWSERSTACK_BROWSER_VERSION || '129', // Specify the browser version
|
|
28
|
-
os: 'Windows', // Specify the operating system
|
|
29
|
-
os_version: '10', // Specify the operating system version
|
|
30
|
-
interactiveDebugging: true,
|
|
31
|
-
buildName: process.env.BROWSERSTACK_BUILD_NAME || 'WEB_Build',
|
|
32
|
-
networkLogs: "true",
|
|
33
|
-
debug: "true",
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
// Add more capabilities for other browsers or devices as needed
|
|
37
|
-
],
|
|
38
|
-
|
|
39
|
-
// ====================
|
|
40
|
-
// Test Configurations
|
|
41
|
-
// ====================
|
|
42
|
-
// logLevel: 'info', // Set the log level
|
|
43
|
-
// bail: 0, // Set to 1 to stop the test suite after the first test failure
|
|
44
|
-
// baseUrl: '', // Specify the base URL of your application
|
|
45
|
-
// waitforTimeout: 90000, // Set the timeout for all waitFor* commands
|
|
46
|
-
// connectionRetryTimeout: 90000, // Set the timeout in milliseconds for test retries
|
|
47
|
-
// connectionRetryCount: 2, // Set the number of times to retry the entire spec file
|
|
48
|
-
|
|
49
|
-
// ====================
|
|
50
|
-
// Framework
|
|
51
|
-
// ====================
|
|
52
|
-
// framework: 'mocha', // Use the Mocha framework
|
|
53
|
-
// reporters: ['spec'
|
|
54
|
-
|
|
55
|
-
// ], // Use the spec reporter
|
|
56
|
-
|
|
57
|
-
// ====================
|
|
58
|
-
// Hooks
|
|
59
|
-
// ====================
|
|
60
|
-
before: function (capabilities, specs) {
|
|
61
|
-
browser.maximizeWindow()
|
|
62
|
-
process.env.BS_SESSION_TYPE = "automate";
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// // ====================
|
|
68
|
-
// // Mocha Options
|
|
69
|
-
// // ====================
|
|
70
|
-
// mochaOpts: {
|
|
71
|
-
// ui: 'bdd', // Set the test interface to BDD
|
|
72
|
-
// timeout: 90000, // Set the timeout for test cases in milliseconds
|
|
73
|
-
// },
|
|
74
|
-
}]);
|
|
75
|
-
|
|
76
|
-
module.exports = apiconfig;
|
package/config/api.conf.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const deepmerge = require('deepmerge')
|
|
2
|
-
process.env.BROWSERSTACK = true;
|
|
3
|
-
const commonmobileconfig = require('./common.mobile.conf');
|
|
4
|
-
|
|
5
|
-
const apiconfig = deepmerge.all([commonmobileconfig, {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
services: [
|
|
9
|
-
['browserstack', {
|
|
10
|
-
|
|
11
|
-
browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
|
|
12
|
-
opts: {
|
|
13
|
-
forcelocal: false,
|
|
14
|
-
// localIdentifier: "webdriverio-appium"
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
}]
|
|
18
|
-
],
|
|
19
|
-
// ====================
|
|
20
|
-
// Capabilities
|
|
21
|
-
// ====================
|
|
22
|
-
capabilities: [
|
|
23
|
-
{
|
|
24
|
-
'bstack:options': {
|
|
25
|
-
projectName: process.env.PROJECTNAME || "roboticodigital",
|
|
26
|
-
|
|
27
|
-
browserName: 'chrome', // Choose the browser you want to test
|
|
28
|
-
// browserVersion: '129', // Specify the browser version
|
|
29
|
-
os: 'Windows', // Specify the operating system
|
|
30
|
-
// os_version: '10', // Specify the operating system version
|
|
31
|
-
interactiveDebugging: true,
|
|
32
|
-
buildName: process.env.BROWSERSTACK_BUILD_NAME || 'WEB_Build',
|
|
33
|
-
networkLogs: "true",
|
|
34
|
-
debug: "true",
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
// Add more capabilities for other browsers or devices as needed
|
|
38
|
-
],
|
|
39
|
-
|
|
40
|
-
// ====================
|
|
41
|
-
// Test Configurations
|
|
42
|
-
// ====================
|
|
43
|
-
// logLevel: 'info', // Set the log level
|
|
44
|
-
// bail: 0, // Set to 1 to stop the test suite after the first test failure
|
|
45
|
-
// baseUrl: '', // Specify the base URL of your application
|
|
46
|
-
// waitforTimeout: 90000, // Set the timeout for all waitFor* commands
|
|
47
|
-
// connectionRetryTimeout: 90000, // Set the timeout in milliseconds for test retries
|
|
48
|
-
// connectionRetryCount: 2, // Set the number of times to retry the entire spec file
|
|
49
|
-
|
|
50
|
-
// ====================
|
|
51
|
-
// Framework
|
|
52
|
-
// ====================
|
|
53
|
-
// framework: 'mocha', // Use the Mocha framework
|
|
54
|
-
// reporters: ['spec'
|
|
55
|
-
|
|
56
|
-
// ], // Use the spec reporter
|
|
57
|
-
|
|
58
|
-
// ====================
|
|
59
|
-
// Hooks
|
|
60
|
-
// ====================
|
|
61
|
-
before: function (capabilities, specs) {
|
|
62
|
-
browser.maximizeWindow()
|
|
63
|
-
process.env.BS_SESSION_TYPE = "automate";
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// // ====================
|
|
69
|
-
// // Mocha Options
|
|
70
|
-
// // ====================
|
|
71
|
-
// mochaOpts: {
|
|
72
|
-
// ui: 'bdd', // Set the test interface to BDD
|
|
73
|
-
// timeout: 90000, // Set the timeout for test cases in milliseconds
|
|
74
|
-
// },
|
|
75
|
-
}]);
|
|
76
|
-
|
|
77
|
-
module.exports = apiconfig;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const deepmerge = require('deepmerge')
|
|
2
|
-
const commonconfig = require('./commonconfig');
|
|
3
|
-
const isBrowserStackEnabled = process.env.BROWSERSTACK;
|
|
4
|
-
console.log("isBrowserStackEnabled", isBrowserStackEnabled);
|
|
5
|
-
|
|
6
|
-
const browserStackConfig = isBrowserStackEnabled === 'true' ? {
|
|
7
|
-
user: process.env.BROWSERSTACK_USERNAME,
|
|
8
|
-
key: Buffer.from(process.env.BROWSERSTACK_ACCESS_KEY, 'base64').toString('utf-8'),
|
|
9
|
-
commonCapabilities: {
|
|
10
|
-
'bstack:options': {
|
|
11
|
-
projectName: process.env.PROJECTNAME || "roboticodigital",
|
|
12
|
-
sessionName: 'Automation test session',
|
|
13
|
-
debug: true,
|
|
14
|
-
networkLogs: true
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}: {};
|
|
18
|
-
|
|
19
|
-
const commonmobconfig = deepmerge.all([
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
logLevel: 'info',
|
|
23
|
-
coloredLogs: true,
|
|
24
|
-
screenshotPath: './errorShots/',
|
|
25
|
-
baseUrl: '',
|
|
26
|
-
waitforTimeout: 90000,
|
|
27
|
-
connectionRetryTimeout: 90000,
|
|
28
|
-
connectionRetryCount: 2,
|
|
29
|
-
|
|
30
|
-
framework: 'mocha',
|
|
31
|
-
mochaOpts: {
|
|
32
|
-
ui: 'bdd',
|
|
33
|
-
timeout: 300000
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
maxInstances: 10,
|
|
37
|
-
|
|
38
|
-
updateJob: false,
|
|
39
|
-
reporters: ['spec'],
|
|
40
|
-
},
|
|
41
|
-
browserStackConfig,
|
|
42
|
-
commonconfig,
|
|
43
|
-
]);
|
|
44
|
-
|
|
45
|
-
module.exports = commonmobconfig;
|
package/config/dataHandler.js
DELETED
package/config/injectimage.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
await driver.execute('browserstack_executor: {"action":"cameraImageInjection", "arguments": {"imageUrl" : "media://1965674f959d00128d4fb649dcc6823bd00b00cb"}}');
|
|
3
|
-
|
|
4
|
-
await driver.execute('browserstack_executor: {"action":"cameraVideoInjection", "arguments": {"videoUrl" : "media://1920c80136e1c7e2278e15d820845ed64a676e92"}}')
|
package/config/ios.conf.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// This is the configuration file for iOS devices
|
|
2
|
-
const deepmerge = require('deepmerge')
|
|
3
|
-
process.env.BROWSERSTACK = true;
|
|
4
|
-
const commonmobileconfig = require('./common.mobile.conf');
|
|
5
|
-
|
|
6
|
-
const iosconfig = deepmerge.all([commonmobileconfig, {
|
|
7
|
-
services: [
|
|
8
|
-
[
|
|
9
|
-
'browserstack',
|
|
10
|
-
{
|
|
11
|
-
// testObservability: true,
|
|
12
|
-
// buildIdentifier: `#${process.env.BUILD_NUMBER}`,
|
|
13
|
-
browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
|
|
14
|
-
opts: {
|
|
15
|
-
forcelocal: false,
|
|
16
|
-
// localIdentifier: "webdriverio-appium"
|
|
17
|
-
},
|
|
18
|
-
app: process.env.BROWSERSTACK_APP_PATH || 'bs://d6588d0899a2ac5c485d4784af9ad28d06b98c44'
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
],
|
|
22
|
-
|
|
23
|
-
capabilities: [{
|
|
24
|
-
'bstack:options': {
|
|
25
|
-
projectName: process.env.PROJECTNAME || "roboticodigital",
|
|
26
|
-
deviceName: process.env.DEVICENAME || "iPhone 15 Pro Max",
|
|
27
|
-
osVersion: process.env.OSVERSION || "17",
|
|
28
|
-
platformName: 'iOS',
|
|
29
|
-
interactiveDebugging: true,
|
|
30
|
-
buildName: process.env.BROWSERSTACK_BUILD_NAME || 'IOS_Build',
|
|
31
|
-
networkLogs: "true",
|
|
32
|
-
debug: "true",
|
|
33
|
-
appProfiling: "true",
|
|
34
|
-
//enableCameraImageInjection: "true",
|
|
35
|
-
deviceOrientation: process.env.DEVICENAME.toLowerCase().includes('tab') ? 'landscape' : 'portrait',
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}],
|
|
39
|
-
|
|
40
|
-
before: function (capabilities, specs) {
|
|
41
|
-
// browser.maximizeWindow()
|
|
42
|
-
process.env.BS_SESSION_TYPE = "app-automate";
|
|
43
|
-
},
|
|
44
|
-
}]);
|
|
45
|
-
|
|
46
|
-
module.exports = iosconfig;
|
|
47
|
-
|
package/config/web.conf.bs.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const deepmerge = require('deepmerge')
|
|
2
|
-
process.env.BROWSERSTACK = true;
|
|
3
|
-
const commonmobileconfig = require('./common.mobile.conf');
|
|
4
|
-
|
|
5
|
-
const webbsconfig = deepmerge.all([commonmobileconfig, {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
services: [
|
|
9
|
-
['browserstack', {
|
|
10
|
-
|
|
11
|
-
browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
|
|
12
|
-
opts: {
|
|
13
|
-
forcelocal: false,
|
|
14
|
-
// localIdentifier: "webdriverio-appium"
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
}]
|
|
18
|
-
],
|
|
19
|
-
// ====================
|
|
20
|
-
// Capabilities
|
|
21
|
-
// ====================
|
|
22
|
-
capabilities: [
|
|
23
|
-
{
|
|
24
|
-
'bstack:options': {
|
|
25
|
-
projectName: process.env.PROJECTNAME || "roboticodigital",
|
|
26
|
-
browserName: process.env.BROWSERSTACK_BROWSER || 'chrome', // Choose the browser you want to test
|
|
27
|
-
browserVersion: process.env.BROWSERSTACK_BROWSER_VERSION || '129', // Specify the browser version
|
|
28
|
-
os: 'Windows', // Specify the operating system
|
|
29
|
-
osVersion: '10', // Specify the operating system version
|
|
30
|
-
interactiveDebugging: true,
|
|
31
|
-
buildName: process.env.BROWSERSTACK_BUILD_NAME || 'WEB_Build',
|
|
32
|
-
networkLogs: "true",
|
|
33
|
-
debug: "true",
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
// Add more capabilities for other browsers or devices as needed
|
|
37
|
-
],
|
|
38
|
-
|
|
39
|
-
// ====================
|
|
40
|
-
// Test Configurations
|
|
41
|
-
// ====================
|
|
42
|
-
// logLevel: 'info', // Set the log level
|
|
43
|
-
// bail: 0, // Set to 1 to stop the test suite after the first test failure
|
|
44
|
-
// baseUrl: '', // Specify the base URL of your application
|
|
45
|
-
// waitforTimeout: 90000, // Set the timeout for all waitFor* commands
|
|
46
|
-
// connectionRetryTimeout: 90000, // Set the timeout in milliseconds for test retries
|
|
47
|
-
// connectionRetryCount: 2, // Set the number of times to retry the entire spec file
|
|
48
|
-
|
|
49
|
-
// ====================
|
|
50
|
-
// Framework
|
|
51
|
-
// ====================
|
|
52
|
-
// framework: 'mocha', // Use the Mocha framework
|
|
53
|
-
// reporters: ['spec'
|
|
54
|
-
|
|
55
|
-
// ], // Use the spec reporter
|
|
56
|
-
|
|
57
|
-
// ====================
|
|
58
|
-
// Hooks
|
|
59
|
-
// ====================
|
|
60
|
-
before: function (capabilities, specs) {
|
|
61
|
-
browser.maximizeWindow()
|
|
62
|
-
process.env.BS_SESSION_TYPE = "automate";
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// // ====================
|
|
68
|
-
// // Mocha Options
|
|
69
|
-
// // ====================
|
|
70
|
-
// mochaOpts: {
|
|
71
|
-
// ui: 'bdd', // Set the test interface to BDD
|
|
72
|
-
// timeout: 90000, // Set the timeout for test cases in milliseconds
|
|
73
|
-
// },
|
|
74
|
-
}]);
|
|
75
|
-
|
|
76
|
-
module.exports = webbsconfig;
|
package/config/web.conf.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const config = {
|
|
4
|
-
|
|
5
|
-
// ====================
|
|
6
|
-
// Capabilities
|
|
7
|
-
// ====================
|
|
8
|
-
capabilities: [{
|
|
9
|
-
maxInstances: 5,
|
|
10
|
-
browserName: 'chrome',
|
|
11
|
-
acceptInsecureCerts: true,
|
|
12
|
-
}],
|
|
13
|
-
|
|
14
|
-
// ====================
|
|
15
|
-
// Test Configurations
|
|
16
|
-
// ====================
|
|
17
|
-
logLevel: 'info', // Set the log level
|
|
18
|
-
bail: 0, // Set to 1 to stop the test suite after the first test failure
|
|
19
|
-
baseUrl: '', // Specify the base URL of your application
|
|
20
|
-
waitforTimeout: 60000, // Set the timeout for all waitFor* commands
|
|
21
|
-
connectionRetryTimeout: 90000, // Set the timeout in milliseconds for test retries
|
|
22
|
-
connectionRetryCount: 3, // Set the number of times to retry the entire spec file
|
|
23
|
-
|
|
24
|
-
// ====================
|
|
25
|
-
// Framework
|
|
26
|
-
// ====================
|
|
27
|
-
framework: 'mocha', // Use the Mocha framework
|
|
28
|
-
reporters: ['spec'], // Use the spec reporter
|
|
29
|
-
// reporterOptions: {
|
|
30
|
-
// allure: {
|
|
31
|
-
// outputDir: 'allure-results',
|
|
32
|
-
// disableWebdriverStepsReporting: true,
|
|
33
|
-
// disableWebdriverScreenshotsReporting: false,
|
|
34
|
-
// }
|
|
35
|
-
//},
|
|
36
|
-
// ====================
|
|
37
|
-
// Hooks
|
|
38
|
-
// ====================
|
|
39
|
-
before: function (capabilities, specs) {
|
|
40
|
-
// Code to run before the first test
|
|
41
|
-
const currentDate = new Date();
|
|
42
|
-
const timestamp = currentDate.toISOString().replace(/[:.]/g, '');
|
|
43
|
-
browser.saveScreenshot('./screenshot_' + timestamp + '.png');
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
after: function (capabilities, specs) {
|
|
47
|
-
// Code to run to take screenshots
|
|
48
|
-
const currentDate = new Date();
|
|
49
|
-
const timestamp = currentDate.toISOString().replace(/[:.]/g, '');
|
|
50
|
-
browser.saveScreenshot('./screenshot_' + timestamp + '.png');
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
// ====================
|
|
56
|
-
// BrowserStack Options
|
|
57
|
-
// ====================
|
|
58
|
-
browserstackOpts: {
|
|
59
|
-
// BrowserStack-specific options
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
// ====================
|
|
63
|
-
// Mocha Options
|
|
64
|
-
// ====================
|
|
65
|
-
mochaOpts: {
|
|
66
|
-
ui: 'bdd', // Set the test interface to BDD
|
|
67
|
-
timeout: 60000, // Set the timeout for test cases in milliseconds
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
module.exports = config;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|