froth-webdriverio-framework 2.0.24 → 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.
@@ -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 = `https://${frothUrl}/api/dbconnection-retrieve/${id}/`;
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 = `https://${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)
@@ -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 = `https://${frothUrl}/api/execution-script-mapping/?execution_id=${execution_id}&automation_script_id=${script_id}`;
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 = `https://${frothUrl}/api/test-execution-update/${id}/`;
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 = `https://${frothUrl}/api/script-status-percentage/${id}/`;
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 = `https://${frothUrl}/api/intergration-view/${id}/`;
6
+ const url = `${frothUrl}/api/intergration-view/${id}/`;
7
7
 
8
8
  try {
9
9
  console.log("URL: " + url)
@@ -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 = `https://${frothUrl}/api/automationsuite-retrieve/${id}/`;
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 = `https://${frothUrl}/api/login/`;
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 = "subhra.subudhi@roboticodigital.com";
41
- // const password = "V2VsY29tZUAxMjM=";
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
 
@@ -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 = `https://${frothUrl}/api/testdata-retrieve/${id}/`;
9
+ const url = `${frothUrl}/api/testdata-retrieve/${id}/`;
10
10
 
11
11
  try {
12
12
  console.log("URL: " + url)
@@ -7,22 +7,23 @@ async function assertText(driver, elementSelector, expectedText) {
7
7
  // Wait for the element to be visible
8
8
 
9
9
  // Get the actual text from the element
10
- // const element = await driver.$(elementSelector);
11
- // console.log("actual text is:" + element)
12
- const actualText = await driver.$(elementSelector).getText();
13
- // const actualText = await element.getText();
14
- console.log("actual text is:" + actualText)
10
+ // const element = await driver.$(elementSelector);
11
+ // console.log("actual text is:" + element)
12
+ const element = await driver.$(elementSelector)
13
+ // const actualText = await element.getText();
14
+ await expect(element).toHaveText(expectedText)
15
15
 
16
+ //console.log("actual text is:" + actualText)
16
17
 
17
18
  // Compare the actual text with the expected text
18
19
  if (actualText == expectedText) {
19
20
  let annotationMessage = `Assertion pass. Actual text: ${actualText}, Expected text: ${expectedText}.`;
20
21
  console.log(`Assertion pass. Actual text: ${actualText}, Expected text: ${expectedText}.`);
21
- // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
22
+ // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
22
23
  } else {
23
24
  let annotationMessage = `Assertion fail. Actual text: ${actualText}, Expected text: ${expectedText}.`;
24
25
  console.log(`Assertion fail. Actual text: ${actualText}, Expected text: ${expectedText}.`);
25
- // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
26
+ // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
26
27
  }
27
28
  } catch (error) {
28
29
  console.error('Error occurred while verifying text:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",
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
- })
@@ -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
-
@@ -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);