froth-webdriverio-framework 3.0.84 → 3.0.86
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.
|
@@ -132,5 +132,62 @@ 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
|
+
]);
|
|
135
190
|
|
|
191
|
+
console.log("✅ Crop overlay resized from two corners successfully!");
|
|
192
|
+
}
|
|
136
193
|
module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit ,swipewithcoordinates};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const { LocalStorage } = require('node-localstorage');
|
|
2
3
|
global.BUFFER = new LocalStorage('./storage');
|
|
3
4
|
const setAllDetails = require("./setallDatailinBuffer")
|
|
4
|
-
const { LocalStorage } = require('node-localstorage');
|
|
5
5
|
const exeDetails = require("../api/getexecutionDetails")
|
|
6
6
|
const getBSSessionDetails = require("../api/browsersatckSessionInfo").getBSSessionDetails;
|
|
7
7
|
const { fail } = require("assert");
|