froth-webdriverio-framework 1.0.16 → 1.0.18

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.
@@ -1,4 +1,8 @@
1
1
 
2
+ const getLoginToken = require('../api/loginapi.js');
3
+ const { LocalStorage } = require('node-localstorage');
4
+ global.BUFFER = new LocalStorage('./storage');
5
+
2
6
  // Function to get data from the API using the Bearer token
3
7
  async function getDataById(frothUrl, token, id) {
4
8
 
@@ -21,7 +25,7 @@ async function getDataById(frothUrl, token, id) {
21
25
  // Convert the key-value data to a JSON string
22
26
  const jsonData = data.key_value_data;
23
27
  // Convert the array into an object with keys as property names
24
- const buffer = jsonData.reduce((obj, item) => {
28
+ const bufferdta = jsonData.reduce((obj, item) => {
25
29
  obj[item.key] = item.value;
26
30
  BUFFER.setItem(item.key, item.value);
27
31
  return obj;
@@ -29,7 +33,7 @@ async function getDataById(frothUrl, token, id) {
29
33
  // Set the buffer as an environment variable
30
34
  // const stringData = JSON.stringify(buffer);
31
35
  // console.log('JSON DATA : ', stringData);
32
- return buffer;
36
+ return bufferdta;
33
37
  }
34
38
  else if (response.status === 401) { // Unauthorized, token expired
35
39
  // Call login function to obtain a new token
@@ -57,27 +61,30 @@ async function getDataById(frothUrl, token, id) {
57
61
 
58
62
 
59
63
  // Execute the main function
60
- async function main() {
61
- try {
62
- const frothUrl = "devapi.frothtestops.com";
63
- const username = "subhra.subudhi@roboticodigital.com";
64
- const password = "V2VsY29tZUAxMjM=";
65
-
66
- const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzE4ODk2NjMzLCJpYXQiOjE3MTg4OTMwMzMsImp0aSI6ImM2NDJlODk3NDI5MjQ1YTliN2E1YmYyYWEzOTMwYjY4IiwidXNlcl9pZCI6MTk0fQ.Om2kXmuhquY1xooCXWacyArCezff2B4qu_joTStyhsA"
67
- // if (!token) {
68
- // throw new Error('Login failed, no token obtained');
69
- // }
70
-
71
- const id = 94;
72
- // const data = await getExecuitonDetails(frothUrl, token, id);
73
- // console.log("Retrieved JSON Data:", data);
74
-
75
- await getDataById(frothUrl, token, id);
76
- } catch (error) {
77
- console.error('Error in main function:', error);
78
- }
79
- }
80
-
81
- main();
64
+ // async function main() {
65
+ // try {
66
+ // const frothUrl = "devapi.frothtestops.com";
67
+ // const username = "subhra.subudhi@roboticodigital.com";
68
+ // const password = "V2VsY29tZUAxMjM=";
69
+
70
+ // const token = await getLoginToken(frothUrl, username, password);
71
+
72
+ // // const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzE4ODk2NjMzLCJpYXQiOjE3MTg4OTMwMzMsImp0aSI6ImM2NDJlODk3NDI5MjQ1YTliN2E1YmYyYWEzOTMwYjY4IiwidXNlcl9pZCI6MTk0fQ.Om2kXmuhquY1xooCXWacyArCezff2B4qu_joTStyhsA"
73
+ // if (!token) {
74
+ // throw new Error('Login failed, no token obtained');
75
+ // }
76
+
77
+ // const id = 94;
78
+ // // const data = await getExecuitonDetails(frothUrl, token, id);
79
+ // // console.log("Retrieved JSON Data:", data);
80
+
81
+ // const d= await getDataById(frothUrl, token, id);
82
+ // console.log(JSON.stringify(BUFFER))
83
+ // } catch (error) {
84
+ // console.error('Error in main function:', error);
85
+ // }
86
+ // }
87
+
88
+ // main();
82
89
 
83
90
  module.exports = getDataById;
@@ -1,8 +1,10 @@
1
- const getDataById = require("../api/readTestdata");
1
+ const getLoginToken = require("../api/loginapi");
2
2
  const exeDetails = require("../api/getexecutionDetails")
3
3
  const getintegrationdetails = require("../api/getintegrationDetails");
4
- const getLoginToken = require("../api/loginapi");
5
4
  const getSuiteDetails = require("../api/getsuiteDetails");
5
+ const getDataById = require("../api/readTestdata");
6
+
7
+
6
8
 
7
9
 
8
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "readme": "WendriverIO Integration with [BrowserStack]",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",
@@ -0,0 +1 @@
1
+ QgCY72/szqZ@(ap&
@@ -0,0 +1 @@
1
+ ytladmin
package/storage/EMAIL ADDED
@@ -0,0 +1 @@
1
+ 0184310814@YES.MY
@@ -0,0 +1 @@
1
+ password