froth-webdriverio-framework 2.0.1 → 2.0.3
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,17 +1,21 @@
|
|
|
1
1
|
// Function to verify text in Android app
|
|
2
|
-
|
|
3
|
-
// try {
|
|
4
|
-
// Wait for the element to be visible
|
|
5
|
-
await driver.waitUntil(async () => {
|
|
6
|
-
const element = await driver.$(elementSelector);
|
|
7
|
-
return await element.isDisplayed();
|
|
8
|
-
}, { timeout: 30000});
|
|
2
|
+
const assert = require('assert');
|
|
9
3
|
|
|
10
|
-
|
|
4
|
+
async function assertText(driver, elementSelector, expectedText) {
|
|
5
|
+
// try {
|
|
6
|
+
// Wait for the element to be visible
|
|
7
|
+
await driver.waitUntil(async () => {
|
|
11
8
|
const element = await driver.$(elementSelector);
|
|
12
|
-
|
|
9
|
+
return await element.isDisplayed();
|
|
10
|
+
}, { timeout: 30000 });
|
|
11
|
+
|
|
12
|
+
// Get the actual text from the element
|
|
13
|
+
const element = await driver.$(elementSelector);
|
|
14
|
+
const actualText = await element.getText();
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
// expect(actualText).toEqual(expectedText,`Expected title to be "${expectedText}", but found "${actualText}"`);
|
|
17
|
+
console.log('Actual text:', actualText, 'Expected text:', expectedText);
|
|
18
|
+
assert.strictEqual(actualText, expectedText, `Expected title to be "${expectedText}", but found "${actualText}"`);
|
|
15
19
|
|
|
16
20
|
// // Compare the actual text with the expected text
|
|
17
21
|
// if (actualText === expectedText) {
|
|
@@ -8,7 +8,7 @@ const getLoginToken = require('../api/loginapi');
|
|
|
8
8
|
|
|
9
9
|
async function connectToDB(id, querytype, query) {
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
// console.log("insude connectToDB"+id+" "+querytype+" "+query)
|
|
12
12
|
const jsondata = await dbinfo.getDbDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("LOGIN_TOKEN"), id);
|
|
13
13
|
let connectionpool = await dbtype(jsondata);
|
|
14
14
|
let result = await executeQuery(jsondata.database_type,querytype, query, connectionpool);
|
package/db/postgresOperations.js
CHANGED
|
@@ -12,21 +12,10 @@ async function connectToPostgreSQL(hostname, username, password1, dbname, portnu
|
|
|
12
12
|
database: dbname,
|
|
13
13
|
port: portnumber // Increased connection timeout
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
// user: "postgres",
|
|
17
|
-
// host: "10.0.222.36",
|
|
18
|
-
// database: "testops",
|
|
19
|
-
// password: "A6b1b/b%V9",
|
|
20
|
-
// port: 5432,
|
|
21
|
-
// });
|
|
22
|
-
|
|
15
|
+
|
|
23
16
|
const pool = new Pool(poolConfig);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// Optionally, run a simple query to verify the connection
|
|
27
|
-
// const res = await client.query('SELECT NOW()');
|
|
28
|
-
// console.log("postgresresults "+res.rows[0]);
|
|
29
|
-
// client.release();
|
|
17
|
+
console.log('PostgreSQL connection pool created.');
|
|
18
|
+
|
|
30
19
|
return pool;
|
|
31
20
|
} catch (error) {
|
|
32
21
|
console.error('Error creating MySQL connection pool:', error);
|
|
@@ -40,18 +29,15 @@ async function fetchDataFromPostgresDB(connectionpool, query) {
|
|
|
40
29
|
let connection = null;
|
|
41
30
|
let finalResult = null;
|
|
42
31
|
try {
|
|
43
|
-
console.log("connectionpool" + connectionpool)
|
|
44
32
|
connection = await connectionpool.connect();
|
|
45
33
|
|
|
46
|
-
console.log('Connected to the fetchDataFromPostgresDB database.' + connection);
|
|
47
|
-
|
|
48
34
|
const result = await connection.query(query);
|
|
49
35
|
const dataArray = result[0] || result.rows; // Adjust for MySQL and PostgreSQL response formats
|
|
50
36
|
finalResult = {
|
|
51
37
|
totalNumberOfRecords: dataArray.length,
|
|
52
38
|
records: dataArray
|
|
53
39
|
};
|
|
54
|
-
console.log(JSON.stringify(finalResult, null, 2));
|
|
40
|
+
// console.log(JSON.stringify(finalResult, null, 2));
|
|
55
41
|
} catch (error) {
|
|
56
42
|
console.error('Error fetching data:', error);
|
|
57
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"readme": "WebdriverIO Integration",
|
|
5
5
|
"description": "WebdriverIO and BrowserStack App Automate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@wdio/spec-reporter": "^8.36.1",
|
|
34
34
|
"appium": "^2.5.4",
|
|
35
35
|
"appium-uiautomator2-driver": "^3.2.0",
|
|
36
|
+
"assert": "^2.1.0",
|
|
36
37
|
"browserstack-local": "^1.5.5",
|
|
37
38
|
"deepmerge": "^4.3.1",
|
|
38
39
|
"form-data": "^4.0.0",
|