froth-webdriverio-framework 3.0.109 → 3.0.111

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 +17 -20
  4. package/{froth_api_calls → api}/getsuiteDetails.js +10 -10
  5. package/{froth_api_calls → api}/loginapi.js +4 -2
  6. package/{froth_api_calls → api}/readTestdata.js +1 -1
  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 +3 -3
  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 +37 -66
  19. package/config/injectimage.js +4 -0
  20. package/config/ios.conf.js +47 -0
  21. package/{froth_configs → config}/setallDatailinBuffer.js +13 -15
  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
@@ -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