froth-webdriverio-framework 3.0.113 → 3.0.115

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 (31) hide show
  1. package/.github/workflows/main.yml +23 -0
  2. package/{froth_api_calls → api}/browsersatckSessionInfo.js +4 -8
  3. package/{froth_api_calls → api}/getexecutionDetails.js +27 -40
  4. package/{froth_api_calls → api}/getsuiteDetails.js +13 -14
  5. package/{froth_api_calls → api}/loginapi.js +4 -2
  6. package/{froth_api_calls → api}/readTestdata.js +4 -6
  7. package/{froth_common_actions → commonMethods}/Utils.js +9 -21
  8. package/{froth_common_actions → commonMethods}/alert.js +3 -3
  9. package/{froth_common_actions → commonMethods}/apicall.js +5 -17
  10. package/{froth_common_actions → commonMethods}/click.js +1 -24
  11. package/{froth_common_actions → commonMethods}/jwt.js +1 -1
  12. package/{froth_common_actions → commonMethods}/scroll.js +1 -23
  13. package/commonMethods/swipe.js +59 -0
  14. package/config/android.conf.js +49 -0
  15. package/config/api.conf.bs.js +76 -0
  16. package/config/api.conf.js +77 -0
  17. package/config/common.mobile.conf.js +45 -0
  18. package/{froth_configs → config}/commonconfig.js +45 -58
  19. package/config/injectimage.js +4 -0
  20. package/config/ios.conf.js +47 -0
  21. package/{froth_configs → config}/setallDatailinBuffer.js +16 -19
  22. package/config/web.conf.bs.js +76 -0
  23. package/config/web.conf.js +70 -0
  24. package/package.json +6 -5
  25. package/froth_common_actions/swipe.js +0 -219
  26. package/froth_configs/wdio.common.conf.js +0 -74
  27. /package/{froth_api_calls → api}/aesEncryption.js +0 -0
  28. /package/{froth_common_actions → commonMethods}/assert.js +0 -0
  29. /package/{froth_common_actions → commonMethods}/dropDown.js +0 -0
  30. /package/{froth_common_actions → commonMethods}/random.js +0 -0
  31. /package/{froth_common_actions → commonMethods}/storeToBuffer.js +0 -0
@@ -0,0 +1,76 @@
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;
@@ -0,0 +1,70 @@
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.113",
3
+ "version": "3.0.115",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",
@@ -31,20 +31,21 @@
31
31
  "@wdio/local-runner": "^9.0.9",
32
32
  "@wdio/mocha-framework": "^8.36.1",
33
33
  "@wdio/spec-reporter": "^8.36.1",
34
- "appium": "^2.15.0",
35
- "appium-uiautomator2-driver": "^4.0.1",
34
+ "appium": "^1.22.3",
35
+ "appium-uiautomator2-driver": "^2.2.0",
36
36
  "assert": "^2.1.0",
37
37
  "axios": "^1.7.7",
38
38
  "browserstack-local": "^1.5.5",
39
39
  "chai": "^5.1.1",
40
+ "crypto": "^1.0.1",
40
41
  "crypto-js": "^4.2.0",
41
42
  "deepmerge": "^4.3.1",
42
43
  "form-data": "^4.0.0",
43
- "fs": "^0.0.1-security",
44
- "js-yaml": "^4.1.0",
45
44
  "mysql2": "^3.10.2",
46
45
  "node-fetch": "^3.3.2",
47
46
  "node-localstorage": "^3.0.5",
47
+ "pg": "^8.12.0",
48
+ "pg-promise": "^11.9.0",
48
49
  "randexp": "^0.5.3",
49
50
  "ts-node": "^10.9.2",
50
51
  "typescript": "^5.4.5"
@@ -1,219 +0,0 @@
1
- async function swipeleft(selector, xoffset, speedinsec) {
2
- try {
3
- console.log('Swiping left');
4
-
5
- if (xoffset == null) {
6
- driver.swipeLeft(selector, speedinsec);
7
- } else {
8
- driver.swipeLeft(selector, xoffset, speedinsec);
9
- }
10
- } catch (error) {
11
- console.error(error.message);
12
- }
13
-
14
- }
15
-
16
- async function swiperight(selector, xoffset, speedinsec) {
17
- try {
18
- console.log('Swiping right');
19
-
20
- if (xoffset == null) {
21
- driver.swipeRight(selector, speedinsec);
22
- } else {
23
- driver.swipeRight(selector, xoffset, speedinsec);
24
- }
25
- } catch (error) {
26
- console.error(error.message);
27
- }
28
-
29
- }
30
-
31
- async function swipeup(selector, yoffset, speedinsec) {
32
- try {
33
- console.log('Swiping up');
34
-
35
- if (yoffset == null) {
36
- driver.swipeUp(selector, speedinsec);
37
- } else {
38
- driver.swipeUp(selector, yoffset, speedinsec);
39
- }
40
- } catch (error) {
41
- console.error(error.message);
42
- }
43
- }
44
-
45
- async function swipedown(selector, yoffset, speedinsec) {
46
- try {
47
- console.log('Swiping down');
48
-
49
- if (yoffset == null) {
50
- driver.swipeDown(selector, speedinsec);
51
- } else {
52
- driver.swipeDown(selector, yoffset, speedinsec);
53
- }
54
- } catch (error) {
55
- console.error(error.message);
56
- }
57
- }
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
- }
76
- async function swipetofit() {
77
- // Get screen size dynamically
78
- const screenSize = await driver.getWindowRect();
79
- const screenWidth = screenSize.width;
80
- const screenHeight = screenSize.height;
81
-
82
- console.log(`Screen Size: Width=${screenWidth}, Height=${screenHeight}`);
83
-
84
- // Define approximate positions for corners
85
- const topRightStartX = screenWidth * 0.88; // Top-right corner
86
- const topRightStartY = screenHeight * 0.44;
87
-
88
- const topRightEndX = screenWidth * 0.96; // Expand to the right
89
- const topRightEndY = screenHeight * 0.39; // Move upwards slightly
90
-
91
- const bottomLeftStartX = screenWidth * 0.12; // Bottom-left corner
92
- const bottomLeftStartY = screenHeight * 0.69;
93
-
94
- const bottomLeftEndX = screenWidth * 0.014; // Expand to the left
95
- const bottomLeftEndY = screenHeight * 0.73; // Move down slightly
96
-
97
- console.log(`Resizing top-right from (${topRightStartX}, ${topRightStartY}) to (${topRightEndX}, ${topRightEndY})`);
98
- console.log(`Resizing bottom-left from (${bottomLeftStartX}, ${bottomLeftStartY}) to (${bottomLeftEndX}, ${bottomLeftEndY})`);
99
-
100
- // Resize from top-right corner
101
- await driver.performActions([
102
- {
103
- type: "pointer",
104
- id: "finger1",
105
- parameters: { pointerType: "touch" },
106
- actions: [
107
- { type: "pointerMove", duration: 0, x: topRightStartX, y: topRightStartY },
108
- { type: "pointerDown", button: 0 },
109
- { type: "pause", duration: 300 },
110
- { type: "pointerMove", duration: 1000, x: topRightEndX, y: topRightEndY },
111
- { type: "pointerUp", button: 0 }
112
- ],
113
- }
114
- ]);
115
-
116
- // Resize from bottom-left corner
117
- await driver.performActions([
118
- {
119
- type: "pointer",
120
- id: "finger2",
121
- parameters: { pointerType: "touch" },
122
- actions: [
123
- { type: "pointerMove", duration: 0, x: bottomLeftStartX, y: bottomLeftStartY },
124
- { type: "pointerDown", button: 0 },
125
- { type: "pause", duration: 300 },
126
- { type: "pointerMove", duration: 1000, x: bottomLeftEndX, y: bottomLeftEndY },
127
- { type: "pointerUp", button: 0 }
128
- ],
129
- }
130
- ]);
131
-
132
- console.log("✅ Crop overlay resized from two corners successfully!");
133
- }
134
-
135
- // async function swipetofit(TopRStartXpct, TopRStartYpct, TopREndXpct, TopREndYpct, BottomLStartXpct, BottomLStartYpct, BottomLEndXpct, BottomLEndYpct) {
136
-
137
- // let topRightStartX; // Top-right corner
138
- // let topRightStartY;
139
-
140
- // let topRightEndX; // Expand to the right
141
- // let topRightEndY; // Move upwards slightly
142
-
143
- // let bottomLeftStartX; // Bottom-left corner
144
- // let bottomLeftStartY;
145
-
146
- // let bottomLeftEndX; // Expand to the left
147
- // let bottomLeftEndY;
148
-
149
- // // Get screen size dynamically
150
- // const screenSize = await driver.getWindowRect();
151
- // const screenWidth = screenSize.width;
152
- // const screenHeight = screenSize.height;
153
-
154
- // console.log(`Screen Size: Width=${screenWidth}, Height=${screenHeight}`);
155
- // // Define approximate positions for corners
156
-
157
- // if (TopRStartXpct === null) {// default calucaltion
158
- // topRightStartX = screenWidth * 0.88; // Top-right corner
159
- // topRightStartY = screenHeight * 0.44;
160
-
161
- // topRightEndX = screenWidth * 0.96; // Expand to the right
162
- // topRightEndY = screenHeight * 0.39; // Move upwards slightly
163
-
164
- // bottomLeftStartX = screenWidth * 0.12; // Bottom-left corner
165
- // bottomLeftStartY = screenHeight * 0.69;
166
-
167
- // bottomLeftEndX = screenWidth * 0.014; // Expand to the left
168
- // bottomLeftEndY = screenHeight * 0.73;
169
- // } else {
170
- // topRightStartX = screenWidth * (TopRStartXpct / 100); // Top-right corner
171
- // topRightStartY = screenHeight * (TopRStartYpct / 100);
172
-
173
- // topRightEndX = screenWidth * (TopREndXpct / 100); // Expand to the right
174
- // topRightEndY = screenHeight * (TopREndYpct / 100); // Move upwards slightly
175
-
176
- // bottomLeftStartX = screenWidth * (BottomLStartXpct / 100); // Bottom-left corner
177
- // bottomLeftStartY = screenHeight * (BottomLStartYpct / 100);
178
-
179
- // bottomLeftEndX = screenWidth * (BottomLEndXpct / 100); // Expand to the left
180
- // bottomLeftEndY = screenHeight * (BottomLEndYpct / 100); // Move down slightly
181
- // }
182
- // console.log(`Resizing top-right from (${topRightStartX}, ${topRightStartY}) to (${topRightEndX}, ${topRightEndY})`);
183
- // console.log(`Resizing bottom-left from (${bottomLeftStartX}, ${bottomLeftStartY}) to (${bottomLeftEndX}, ${bottomLeftEndY})`);
184
-
185
- // // Resize from top-right corner
186
- // await driver.performActions([
187
- // {
188
- // type: "pointer",
189
- // id: "finger1",
190
- // parameters: { pointerType: "touch" },
191
- // actions: [
192
- // { type: "pointerMove", duration: 0, x: topRightStartX, y: topRightStartY },
193
- // { type: "pointerDown", button: 0 },
194
- // { type: "pause", duration: 300 },
195
- // { type: "pointerMove", duration: 1000, x: topRightEndX, y: topRightEndY },
196
- // { type: "pointerUp", button: 0 }
197
- // ],
198
- // }
199
- // ]);
200
-
201
- // // Resize from bottom-left corner
202
- // await driver.performActions([
203
- // {
204
- // type: "pointer",
205
- // id: "finger2",
206
- // parameters: { pointerType: "touch" },
207
- // actions: [
208
- // { type: "pointerMove", duration: 0, x: bottomLeftStartX, y: bottomLeftStartY },
209
- // { type: "pointerDown", button: 0 },
210
- // { type: "pause", duration: 300 },
211
- // { type: "pointerMove", duration: 1000, x: bottomLeftEndX, y: bottomLeftEndY },
212
- // { type: "pointerUp", button: 0 }
213
- // ],
214
- // }
215
- // ]);
216
-
217
- // console.log("✅ Crop overlay resized from two corners successfully!");
218
- // }
219
- module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit, swipewithcoordinates };
@@ -1,74 +0,0 @@
1
- const deepmerge = require('deepmerge')
2
- const fs = require('fs');
3
- const yaml = require('js-yaml');
4
- const path = require('path');
5
- const commonconfig = require('./commonconfig');
6
- console.log('=====wdios common config===== ');
7
-
8
- // Select platform at runtime
9
- const PLATFORM = process.env.PLATFORM || 'browserstack';
10
- const configFile = process.env.YML_NAME || '../ymls/browserstack/android/android_caps.yml';
11
- console.log('====>PLATFORM:', PLATFORM);
12
- // Load YAML file
13
- const capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(), configFile)), 'utf8'));
14
- console.log('====>capabilities:', capabilities);
15
- const SUITE_FILE = path.resolve(process.cwd(), process.env.SUITE);
16
- console.log('====>SUITE_FILE:', SUITE_FILE);
17
-
18
-
19
- function setupPrerequisites() {
20
- console.log("inside this fuction first ");
21
- if (PLATFORM === 'browserstack') {
22
- process.env.BROWSERSTACK_USERNAME = capabilities.userName;
23
- capabilities.accessKey = Buffer.from(capabilities.accessKey, 'base64').toString('utf-8');
24
- process.env.BROWSERSTACK_ACCESS_KEY = capabilities.accessKey
25
- console.log('capabilities.platformName:', capabilities.platformName);
26
- process.env.BS_SESSION_TYPE = capabilities.platformName === 'android' || capabilities.platformName === 'ios' ? 'app-automate' : 'automate';
27
- capabilities.buildName = process.env.BROWSERSTACK_BUILD_NAME;
28
-
29
- }
30
-
31
- }
32
-
33
- const specificConfig = setupPrerequisites();
34
-
35
-
36
- exports.config = deepmerge(commonconfig,
37
-
38
- {
39
- user: process.env.BROWSERSTACK_USERNAME,
40
- key: process.env.BROWSERSTACK_ACCESS_KEY ,
41
- // debug: true,
42
- // execArgv: ['--inspect-brk'],
43
- services: PLATFORM === 'browserstack'
44
- ? ['browserstack']
45
- : PLATFORM === 'saucelabs'
46
- ? ['sauce']
47
- : [],
48
-
49
- //runner: 'local',
50
- specs: require(SUITE_FILE).tests,
51
-
52
- maxInstances: 1,
53
- capabilities: [capabilities],
54
-
55
- logLevel: 'info',
56
- coloredLogs: true,
57
- screenshotPath: './errorShots/',
58
- bail: 0,
59
- //baseUrl: 'https://example.com',
60
- waitforTimeout: 90000,
61
- connectionRetryTimeout: 90000,
62
- connectionRetryCount: 3,
63
-
64
- framework: 'mocha',
65
- reporters: ['spec'],
66
- maxInstances: 10,
67
- updateJob: false,
68
- mochaOpts: {
69
- ui: 'bdd',
70
- timeout: 300000
71
- }
72
- });
73
-
74
-
File without changes