froth-webdriverio-framework 3.0.104 → 3.0.106
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",
|
|
@@ -73,86 +73,112 @@ async function swipewithcoordinates(StartX, StartY, EndX, EndY) {
|
|
|
73
73
|
}
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
|
-
async function swipetofit() {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
// }
|
|
83
134
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
135
|
+
async function swipetofit(TopRStartXpct, TopRStartYpct, TopREndXpct, TopREndYpct, BottomLStartXpct, BottomLStartYpct, BottomLEndXpct, BottomLEndYpct) {
|
|
136
|
+
|
|
137
|
+
let topRightStartX; // Top-right corner
|
|
138
|
+
let topRightStartY;
|
|
87
139
|
|
|
88
|
-
|
|
89
|
-
|
|
140
|
+
let topRightEndX; // Expand to the right
|
|
141
|
+
let topRightEndY; // Move upwards slightly
|
|
90
142
|
|
|
91
|
-
|
|
92
|
-
|
|
143
|
+
let bottomLeftStartX; // Bottom-left corner
|
|
144
|
+
let bottomLeftStartY;
|
|
93
145
|
|
|
94
|
-
|
|
95
|
-
|
|
146
|
+
let bottomLeftEndX; // Expand to the left
|
|
147
|
+
let bottomLeftEndY;
|
|
96
148
|
|
|
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
149
|
// Get screen size dynamically
|
|
137
150
|
const screenSize = await driver.getWindowRect();
|
|
138
151
|
const screenWidth = screenSize.width;
|
|
139
152
|
const screenHeight = screenSize.height;
|
|
140
153
|
|
|
141
154
|
console.log(`Screen Size: Width=${screenWidth}, Height=${screenHeight}`);
|
|
142
|
-
|
|
143
155
|
// Define approximate positions for corners
|
|
144
|
-
const topRightStartX = screenWidth * (TopRStartXpct/100); // Top-right corner
|
|
145
|
-
const topRightStartY = screenHeight * (TopRStartYpct/100);
|
|
146
156
|
|
|
147
|
-
|
|
148
|
-
|
|
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
|
|
149
163
|
|
|
150
|
-
|
|
151
|
-
|
|
164
|
+
bottomLeftStartX = screenWidth * 0.12; // Bottom-left corner
|
|
165
|
+
bottomLeftStartY = screenHeight * 0.69;
|
|
152
166
|
|
|
153
|
-
|
|
154
|
-
|
|
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);
|
|
155
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
|
+
}
|
|
156
182
|
console.log(`Resizing top-right from (${topRightStartX}, ${topRightStartY}) to (${topRightEndX}, ${topRightEndY})`);
|
|
157
183
|
console.log(`Resizing bottom-left from (${bottomLeftStartX}, ${bottomLeftStartY}) to (${bottomLeftEndX}, ${bottomLeftEndY})`);
|
|
158
184
|
|
|
@@ -190,4 +216,4 @@ async function swipetofit(TopRStartXpct, TopRStartYpct, TopREndXpct, TopREndYpct
|
|
|
190
216
|
|
|
191
217
|
console.log("✅ Crop overlay resized from two corners successfully!");
|
|
192
218
|
}
|
|
193
|
-
module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit
|
|
219
|
+
module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit, swipewithcoordinates };
|
|
@@ -66,7 +66,7 @@ async function setExecutionDetails() {
|
|
|
66
66
|
process.env.AUTOMATION_SUITE_ID= getExeDetails.automation_suite_id;
|
|
67
67
|
process.env.BROWSERSTACK_LOCAL= getExeDetails.browser_stack_local;
|
|
68
68
|
process.env.BROWSERSTACK_APP_PATH=getExeDetails.app_url;
|
|
69
|
-
process.env.MEDIA_FILES= getExeDetails.mediaurls;
|
|
69
|
+
process.env.MEDIA_FILES=JSON.stringify( getExeDetails.mediaurls);
|
|
70
70
|
console.log("Execution Details:", JSON.stringify(getExeDetails));
|
|
71
71
|
|
|
72
72
|
} catch (error) {
|