froth-webdriverio-framework 0.1.58 → 0.1.60
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.
- package/api/browsersatckSessionInfo.js +12 -15
- package/config/commonconfig.js +2 -2
- package/package.json +1 -1
|
@@ -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,19 +30,16 @@ async function getBSSessionDetails(sessiontype,bs_username,bs_pwd) {
|
|
|
30
30
|
|
|
31
31
|
if (response.ok) {
|
|
32
32
|
const data = await response.json();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
console.log('Session Info:', data);
|
|
34
|
+
|
|
36
35
|
// Accessing the public_url property
|
|
37
36
|
const publicUrl = data.automation_session.public_url;
|
|
38
|
-
|
|
37
|
+
localStorage.setItem("BS_PUBLIC_URL",publicUrl)
|
|
39
38
|
console.log("public url : " + publicUrl);
|
|
40
39
|
// return jsondata;
|
|
41
|
-
} else if (response.status === 401) { //
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// Retry the request with the new token
|
|
45
|
-
// return getExecuitonDetails(frothUrl, newToken, id);
|
|
40
|
+
} else if (response.status === 401) { //
|
|
41
|
+
console.log("Unauthorized, token expired")
|
|
42
|
+
|
|
46
43
|
} else {
|
|
47
44
|
const errorText = await response.text();
|
|
48
45
|
console.error('Data fetch failed response:', errorText);
|
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;
|