froth-webdriverio-framework 3.0.105 → 3.0.107

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.
@@ -57,7 +57,7 @@ async function swipedown(selector, yoffset, speedinsec) {
57
57
  }
58
58
 
59
59
  async function swipewithcoordinates(StartX, StartY, EndX, EndY) {
60
-
60
+
61
61
  await driver.performActions([
62
62
  {
63
63
  type: "pointer",
@@ -132,62 +132,88 @@ async function swipetofit() {
132
132
  console.log("✅ Crop overlay resized from two corners successfully!");
133
133
  }
134
134
 
135
- async function swipetofit(TopRStartXpct, TopRStartYpct, TopREndXpct, TopREndYpct, BottomLStartXpct, BottomLStartYpct, BottomLEndXpct, BottomLEndYpct) {
136
- // Get screen size dynamically
137
- const screenSize = await driver.getWindowRect();
138
- const screenWidth = screenSize.width;
139
- const screenHeight = screenSize.height;
140
-
141
- console.log(`Screen Size: Width=${screenWidth}, Height=${screenHeight}`);
142
-
143
- // Define approximate positions for corners
144
- const topRightStartX = screenWidth * (TopRStartXpct/100); // Top-right corner
145
- const topRightStartY = screenHeight * (TopRStartYpct/100);
146
-
147
- const topRightEndX = screenWidth * (TopREndXpct/100); // Expand to the right
148
- const topRightEndY = screenHeight * (TopREndYpct/100); // Move upwards slightly
149
-
150
- const bottomLeftStartX = screenWidth * (BottomLStartXpct/100); // Bottom-left corner
151
- const bottomLeftStartY = screenHeight * (BottomLStartYpct/100);
152
-
153
- const bottomLeftEndX = screenWidth * (BottomLEndXpct/100); // Expand to the left
154
- const bottomLeftEndY = screenHeight * (BottomLEndYpct/100); // Move down slightly
155
-
156
- console.log(`Resizing top-right from (${topRightStartX}, ${topRightStartY}) to (${topRightEndX}, ${topRightEndY})`);
157
- console.log(`Resizing bottom-left from (${bottomLeftStartX}, ${bottomLeftStartY}) to (${bottomLeftEndX}, ${bottomLeftEndY})`);
158
-
159
- // Resize from top-right corner
160
- await driver.performActions([
161
- {
162
- type: "pointer",
163
- id: "finger1",
164
- parameters: { pointerType: "touch" },
165
- actions: [
166
- { type: "pointerMove", duration: 0, x: topRightStartX, y: topRightStartY },
167
- { type: "pointerDown", button: 0 },
168
- { type: "pause", duration: 300 },
169
- { type: "pointerMove", duration: 1000, x: topRightEndX, y: topRightEndY },
170
- { type: "pointerUp", button: 0 }
171
- ],
172
- }
173
- ]);
174
-
175
- // Resize from bottom-left corner
176
- await driver.performActions([
177
- {
178
- type: "pointer",
179
- id: "finger2",
180
- parameters: { pointerType: "touch" },
181
- actions: [
182
- { type: "pointerMove", duration: 0, x: bottomLeftStartX, y: bottomLeftStartY },
183
- { type: "pointerDown", button: 0 },
184
- { type: "pause", duration: 300 },
185
- { type: "pointerMove", duration: 1000, x: bottomLeftEndX, y: bottomLeftEndY },
186
- { type: "pointerUp", button: 0 }
187
- ],
188
- }
189
- ]);
190
-
191
- console.log("✅ Crop overlay resized from two corners successfully!");
192
- }
193
- module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit ,swipewithcoordinates};
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.105",
3
+ "version": "3.0.107",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",