froth-webdriverio-framework 2.0.25 → 2.0.26
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/getDBdetails.js +1 -1
- package/api/getexecutionDetails.js +4 -4
- package/api/getintegrationDetails.js +1 -1
- package/api/getsuiteDetails.js +1 -1
- package/api/loginapi.js +5 -3
- package/api/readTestdata.js +1 -1
- package/package.json +1 -1
- package/api/index.js +0 -18
- package/commonMethods/getdata.js +0 -38
- package/commonMethods/test.js +0 -19
package/api/getDBdetails.js
CHANGED
|
@@ -6,7 +6,7 @@ async function getDbDetails(frothUrl, token, id) {
|
|
|
6
6
|
|
|
7
7
|
let jsondata = {};
|
|
8
8
|
if (id != 0 || id != null || id != undefined) {
|
|
9
|
-
const url =
|
|
9
|
+
const url = `${frothUrl}/api/dbconnection-retrieve/${id}/`;
|
|
10
10
|
|
|
11
11
|
try {
|
|
12
12
|
console.log("URL: " + url)
|
|
@@ -5,7 +5,7 @@ const getLoginToken = require("../api/loginapi.js")
|
|
|
5
5
|
async function getExecuitonDetails(frothUrl, token, id) {
|
|
6
6
|
let jsondata = {};
|
|
7
7
|
if (id != 0 || id != null || id != undefined) {
|
|
8
|
-
const url =
|
|
8
|
+
const url = `${frothUrl}/api/test-execution-retrieve/${id}`;
|
|
9
9
|
|
|
10
10
|
try {
|
|
11
11
|
console.log("URL: " + url)
|
|
@@ -55,7 +55,7 @@ async function getExecuitonDetails(frothUrl, token, id) {
|
|
|
55
55
|
|
|
56
56
|
async function getExecuitonScriptDetails(frothUrl, token, execution_id, script_id) {
|
|
57
57
|
let id;
|
|
58
|
-
const url =
|
|
58
|
+
const url = `${frothUrl}/api/execution-script-mapping/?execution_id=${execution_id}&automation_script_id=${script_id}`;
|
|
59
59
|
|
|
60
60
|
try {
|
|
61
61
|
console.log("URL: " + url)
|
|
@@ -100,7 +100,7 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
|
|
|
100
100
|
if (id != 0) {
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
const url =
|
|
103
|
+
const url = `${frothUrl}/api/test-execution-update/${id}/`;
|
|
104
104
|
const formData = new FormData();
|
|
105
105
|
try {
|
|
106
106
|
console.log("URL" + url)
|
|
@@ -155,7 +155,7 @@ async function updateScriptExecutionStatus(frothUrl, token, scriptid, status) {
|
|
|
155
155
|
if (scriptid != 0) {
|
|
156
156
|
try {
|
|
157
157
|
const id = await getExecuitonScriptDetails(frothUrl, token, BUFFER.getItem("EXECUTION_ID"), scriptid)
|
|
158
|
-
const url =
|
|
158
|
+
const url = `${frothUrl}/api/script-status-percentage/${id}/`;
|
|
159
159
|
const formData = new FormData();
|
|
160
160
|
|
|
161
161
|
console.log("URL" + url)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
async function getintegrationdetails(frothUrl, token, id) {
|
|
4
4
|
let jsondata = {};
|
|
5
5
|
if (id != 0 || id != null || id != undefined) {
|
|
6
|
-
const url =
|
|
6
|
+
const url = `${frothUrl}/api/intergration-view/${id}/`;
|
|
7
7
|
|
|
8
8
|
try {
|
|
9
9
|
console.log("URL: " + url)
|
package/api/getsuiteDetails.js
CHANGED
|
@@ -4,7 +4,7 @@ const getLoginToken=require('./loginapi')
|
|
|
4
4
|
async function getSuiteDetails(frothUrl, token, id) {
|
|
5
5
|
let jsondata = {};
|
|
6
6
|
if (id != 0 || id != null || id != undefined) {
|
|
7
|
-
const url =
|
|
7
|
+
const url = `${frothUrl}/api/automationsuite-retrieve/${id}/`;
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
10
|
console.log("URL: " + url)
|
package/api/loginapi.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
async function getLoginToken(frothUrl, email, password) {
|
|
6
6
|
try {
|
|
7
|
-
const url =
|
|
7
|
+
const url = `${frothUrl}/api/login/`;
|
|
8
8
|
console.log("URL: " + url);
|
|
9
9
|
const formData = new FormData();
|
|
10
10
|
formData.append('email_or_username', email);
|
|
@@ -37,12 +37,14 @@ async function getLoginToken(frothUrl, email, password) {
|
|
|
37
37
|
// async function main() {
|
|
38
38
|
// try {
|
|
39
39
|
// const frothUrl = "devapi.frothtestops.com";
|
|
40
|
-
// const username = "
|
|
41
|
-
// const password = "
|
|
40
|
+
// const username = "frothbot@roboticodigital.com";
|
|
41
|
+
// const password = "RnJvdGh0ZXN0b3BzQDU1NQ==";
|
|
42
42
|
|
|
43
43
|
// const token = await getLoginToken(frothUrl, username, password);
|
|
44
44
|
// if (!token) {
|
|
45
45
|
// throw new Error('Login failed, no token obtained');
|
|
46
|
+
// }else{
|
|
47
|
+
// console.log(token)
|
|
46
48
|
// }
|
|
47
49
|
|
|
48
50
|
|
package/api/readTestdata.js
CHANGED
|
@@ -6,7 +6,7 @@ const getLoginToken = require('../api/loginapi.js');
|
|
|
6
6
|
async function getDataById(frothUrl, token, id) {
|
|
7
7
|
|
|
8
8
|
if (id != 0 || id != null || id != undefined|| id != "null") {
|
|
9
|
-
const url =
|
|
9
|
+
const url = `${frothUrl}/api/testdata-retrieve/${id}/`;
|
|
10
10
|
|
|
11
11
|
try {
|
|
12
12
|
console.log("URL: " + url)
|
package/package.json
CHANGED
package/api/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const express = require('express')
|
|
2
|
-
const app = express()
|
|
3
|
-
const port = 5000
|
|
4
|
-
|
|
5
|
-
let count = 0;
|
|
6
|
-
|
|
7
|
-
app.get('/api', (req, res) => {
|
|
8
|
-
res.json({count})
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
app.post('/api', (req, res) => {
|
|
12
|
-
++count;
|
|
13
|
-
res.json({count});
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
app.listen(port, () => {
|
|
17
|
-
console.log(`Example app listening on port ${port}`)
|
|
18
|
-
})
|
package/commonMethods/getdata.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const directory = '/Users/subhrasubudhi/WORKSPACES/WEBDRIVERIO/TEST/mobile/Testdata'; // specify your directory path
|
|
4
|
-
async function getdata(filename_propertyname) {
|
|
5
|
-
try {
|
|
6
|
-
console.log('data:', filename_propertyname);
|
|
7
|
-
const parts = filename_propertyname.split(".");
|
|
8
|
-
const property = parts[1];
|
|
9
|
-
console.log('property:', property);
|
|
10
|
-
fileName = parts[0] + '.json';
|
|
11
|
-
console.log('filename:', fileName);
|
|
12
|
-
|
|
13
|
-
const files = await fs.promises.readdir(directory);
|
|
14
|
-
const file = files.find(file => file === fileName);
|
|
15
|
-
|
|
16
|
-
if (file) {
|
|
17
|
-
const filePath = path.join(directory, file);
|
|
18
|
-
const jsonData = await fs.promises.readFile(filePath, 'utf-8');
|
|
19
|
-
const parsedData = JSON.parse(jsonData);
|
|
20
|
-
console.log(parsedData);
|
|
21
|
-
const value = parsedData[property];
|
|
22
|
-
console.log(value);
|
|
23
|
-
return value;
|
|
24
|
-
} else {
|
|
25
|
-
throw new Error(`File '${_filename}' not found in directory '${directory}'.`);
|
|
26
|
-
}
|
|
27
|
-
} catch (error) {
|
|
28
|
-
console.error('Error occurred:', error);
|
|
29
|
-
throw error; // Rethrow the error for the caller to handle.
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
module.exports = getdata;
|
|
33
|
-
// Example usage:
|
|
34
|
-
// specify your file name
|
|
35
|
-
|
|
36
|
-
//console.log(getdata('data1.env'));
|
|
37
|
-
|
|
38
|
-
|
package/commonMethods/test.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
|
|
3
|
-
function readAndParseJSON(filename) {
|
|
4
|
-
const [fileName, fileExtension] = filename.split(".");
|
|
5
|
-
const jsonFilePath = fileName + ".json";
|
|
6
|
-
const constantProperty = fileExtension;
|
|
7
|
-
|
|
8
|
-
const filePath = `/Users/subhrasubudhi/WORKSPACES/WEBDRIVERIO/TEST/mobile/Testdata/${jsonFilePath}`;
|
|
9
|
-
|
|
10
|
-
const jsonData = fs.readFileSync(filePath, "utf-8");
|
|
11
|
-
const parsedData = JSON.parse(jsonData);
|
|
12
|
-
|
|
13
|
-
console.log(parsedData);
|
|
14
|
-
const value = parsedData[constantProperty];
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const data1 = readAndParseJSON("data1.env");
|
|
19
|
-
console.log(data1);
|