froth-webdriverio-framework 5.0.1 → 5.0.3
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.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
async function getExecuitonDetails(frothUrl, token, id) {
|
|
6
6
|
let jsondata = {};
|
|
7
7
|
if (id != 0 || id != null || id != undefined) {
|
|
8
|
-
const url = `${frothUrl}/api/test-execution-retrieve/${id}
|
|
8
|
+
const url = `${frothUrl}/api/test-execution-retrieve/${id}/`;
|
|
9
9
|
|
|
10
10
|
try {
|
|
11
11
|
console.log("URL: " + url)
|
|
@@ -34,11 +34,7 @@ async function getExecuitonDetails(frothUrl, token, id) {
|
|
|
34
34
|
|
|
35
35
|
return jsondata;
|
|
36
36
|
} else if (response.status === 401) { // Unauthorized, token expired
|
|
37
|
-
|
|
38
|
-
// const newToken = await getLoginToken(BUFFER.getItem("SERVICE_USER"), BUFFER.getItem("SERVICE_PASSWORD")); // You need to implement the login function
|
|
39
|
-
// Retry the request with the new token
|
|
40
|
-
// return getExecuitonDetails(frothUrl, newToken, id);
|
|
41
|
-
// console.log("Unauthorized, token expired" + response.status)
|
|
37
|
+
|
|
42
38
|
console.error("Unauthorized, token expired" + response.status);
|
|
43
39
|
|
|
44
40
|
} else {
|
|
@@ -20,6 +20,9 @@ async function switch2WindowByTitle(title) {
|
|
|
20
20
|
*/
|
|
21
21
|
async function switch2WindowByIndex(index) {
|
|
22
22
|
const handles = await browser.getWindowHandles();
|
|
23
|
+
console.log(`Total open windows: ${handles.length}`);
|
|
24
|
+
console.log(`Switching to window at index: ${index}`);
|
|
25
|
+
console.log(`Available handles: ${handles.join(', ')}`);
|
|
23
26
|
if (index < 0 || index >= handles.length) {
|
|
24
27
|
throw new Error(`Invalid window index: ${index}. There are only ${handles.length} windows open.`);
|
|
25
28
|
}
|