froth-webdriverio-framework 3.0.106 → 3.0.108

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.
@@ -100,7 +100,7 @@ async function getExecuitonScriptDetails(frothUrl, token, execution_id, script_i
100
100
  }
101
101
 
102
102
  async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
103
- if (id != 0) {
103
+ // if (id != 0) {
104
104
 
105
105
 
106
106
  const url = `${frothUrl}/api/test-execution-update/${id}/`;
@@ -148,9 +148,9 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
148
148
  console.error('Error fetching data:', error);
149
149
 
150
150
  }
151
- } else {
152
- console.error('Error fetching data: Invalid ID');
153
- }
151
+ // } else {
152
+ // console.error('Error fetching data: Invalid ID');
153
+ // }
154
154
 
155
155
  }
156
156
 
@@ -73,112 +73,27 @@ async function swipewithcoordinates(StartX, StartY, EndX, EndY) {
73
73
  }
74
74
  ]);
75
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
-
76
+ async function swipetofit() {
149
77
  // Get screen size dynamically
150
78
  const screenSize = await driver.getWindowRect();
151
79
  const screenWidth = screenSize.width;
152
80
  const screenHeight = screenSize.height;
153
81
 
154
82
  console.log(`Screen Size: Width=${screenWidth}, Height=${screenHeight}`);
155
- // Define approximate positions for corners
156
83
 
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;
84
+ // Define approximate positions for corners
85
+ const topRightStartX = screenWidth * 0.88; // Top-right corner
86
+ const topRightStartY = screenHeight * 0.44;
166
87
 
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);
88
+ const topRightEndX = screenWidth * 0.96; // Expand to the right
89
+ const topRightEndY = screenHeight * 0.39; // Move upwards slightly
172
90
 
173
- topRightEndX = screenWidth * (TopREndXpct / 100); // Expand to the right
174
- topRightEndY = screenHeight * (TopREndYpct / 100); // Move upwards slightly
91
+ const bottomLeftStartX = screenWidth * 0.12; // Bottom-left corner
92
+ const bottomLeftStartY = screenHeight * 0.69;
175
93
 
176
- bottomLeftStartX = screenWidth * (BottomLStartXpct / 100); // Bottom-left corner
177
- bottomLeftStartY = screenHeight * (BottomLStartYpct / 100);
94
+ const bottomLeftEndX = screenWidth * 0.014; // Expand to the left
95
+ const bottomLeftEndY = screenHeight * 0.73; // Move down slightly
178
96
 
179
- bottomLeftEndX = screenWidth * (BottomLEndXpct / 100); // Expand to the left
180
- bottomLeftEndY = screenHeight * (BottomLEndYpct / 100); // Move down slightly
181
- }
182
97
  console.log(`Resizing top-right from (${topRightStartX}, ${topRightStartY}) to (${topRightEndX}, ${topRightEndY})`);
183
98
  console.log(`Resizing bottom-left from (${bottomLeftStartX}, ${bottomLeftStartY}) to (${bottomLeftEndX}, ${bottomLeftEndY})`);
184
99
 
@@ -216,4 +131,89 @@ async function swipetofit(TopRStartXpct, TopRStartYpct, TopREndXpct, TopREndYpct
216
131
 
217
132
  console.log("✅ Crop overlay resized from two corners successfully!");
218
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
219
  module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit, swipewithcoordinates };
@@ -44,14 +44,14 @@ const commonconfig = {
44
44
 
45
45
  if (process.env.PLATFORM === 'browserstack') {
46
46
  /// console.log("capabilities:", capabilities);
47
- // capabilities.accessKey = Buffer.from(capabilities.accessKey, 'base64').toString('utf-8');
47
+ // capabilities.accessKey = Buffer.from(capabilities.accessKey, 'base64').toString('utf-8');
48
48
  capabilities.app = process.env.BROWSERSTACK_APP_PATH;
49
49
  capabilities.browserstackLocal = process.env.BROWSERSTACK_LOCAL;
50
- if (process.env.MEDIA_FILES){
50
+ if (process.env.MEDIA_FILES) {
51
51
  console.log("Media Files:", JSON.parse(process.env.MEDIA_FILES));
52
52
  console.log("Size of Media Files:", process.env.MEDIA_FILES.length);
53
53
  if (process.env.MEDIA_FILES.length > 0)
54
- capabilities['browserstack.uploadMedia'] = JSON.parse(process.env.MEDIA_FILES);
54
+ capabilities['browserstack.uploadMedia'] = JSON.parse(process.env.MEDIA_FILES);
55
55
  }
56
56
 
57
57
  console.log(`Running tests on after app,bslocal,mediafiles: ${JSON.stringify(capabilities)}`);
@@ -74,7 +74,7 @@ const commonconfig = {
74
74
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
75
75
 
76
76
  const resultdetails = {};
77
- exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
77
+ await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
78
78
 
79
79
  } catch (e) {
80
80
  console.log("Error in beforeSuite:", e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.106",
3
+ "version": "3.0.108",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",