froth-webdriverio-framework 0.1.58 → 0.1.59
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.
|
@@ -11,13 +11,13 @@ async function getBSSessionDetails(sessiontype,bs_username,bs_pwd) {
|
|
|
11
11
|
const sessionId = browser.sessionId;
|
|
12
12
|
console.log(`Session ID: ${sessionId}`);
|
|
13
13
|
|
|
14
|
-
const sessionInfo = await browser.execute(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
14
|
+
// const sessionInfo = await browser.execute(() => {
|
|
15
|
+
// return window._browserstack_executor({
|
|
16
|
+
// action: 'getSessionDetails'
|
|
17
|
+
// });
|
|
18
|
+
// });
|
|
19
19
|
|
|
20
|
-
console.log('BrowserStack session info:', sessionInfo);
|
|
20
|
+
// console.log('BrowserStack session info:', sessionInfo);
|
|
21
21
|
|
|
22
22
|
const url = `https://api.browserstack.com/${sessiontype}/sessions/${sessionId}.json`;
|
|
23
23
|
|
|
@@ -30,7 +30,7 @@ async function getBSSessionDetails(sessiontype,bs_username,bs_pwd) {
|
|
|
30
30
|
|
|
31
31
|
if (response.ok) {
|
|
32
32
|
const data = await response.json();
|
|
33
|
-
|
|
33
|
+
console.log('Session Info:', data);
|
|
34
34
|
// const details = JSON.parse(data);
|
|
35
35
|
|
|
36
36
|
// Accessing the public_url property
|
|
@@ -38,7 +38,8 @@ async function getBSSessionDetails(sessiontype,bs_username,bs_pwd) {
|
|
|
38
38
|
|
|
39
39
|
console.log("public url : " + publicUrl);
|
|
40
40
|
// return jsondata;
|
|
41
|
-
} else if (response.status === 401) { //
|
|
41
|
+
} else if (response.status === 401) { //
|
|
42
|
+
console.log("Unauthorized, token expired")
|
|
42
43
|
// Call login function to obtain a new token
|
|
43
44
|
// const newToken = await getLoginToken(localStorage.getItem("SERVICE_USER"), localStorage.getItem("SERVICE_PASSWORD")); // You need to implement the login function
|
|
44
45
|
// Retry the request with the new token
|
package/config/commonconfig.js
CHANGED
|
@@ -18,8 +18,8 @@ const commonconfig = {
|
|
|
18
18
|
localStorage.setItem("organisation_url", process.env.organisation_url);
|
|
19
19
|
localStorage.setItem("SERVICE_USER", "subhra.subudhi@roboticodigital.com");
|
|
20
20
|
localStorage.setItem("SERVICE_PASSWORD", "V2VsY29tZUAxMjM=");
|
|
21
|
-
localStorage.setItem("BROWSERSTACK_USERNAME",
|
|
22
|
-
localStorage.setItem("BROWSERSTACK_ACCESS_KEY",
|
|
21
|
+
localStorage.setItem("BROWSERSTACK_USERNAME", process.env.BROWSERSTACK_USERNAME);
|
|
22
|
+
localStorage.setItem("BROWSERSTACK_ACCESS_KEY", process.env.BROWSERSTACK_ACCESS_KEY);
|
|
23
23
|
|
|
24
24
|
const getToken = await getLoginToken(localStorage.getItem("organisation_url"), localStorage.getItem("SERVICE_USER"), localStorage.getItem("SERVICE_PASSWORD"));
|
|
25
25
|
process.env.LOGIN_TOKEN = getToken;
|