froth-webdriverio-framework 2.0.3 → 2.0.6
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.
|
@@ -160,7 +160,7 @@ async function updateScriptExecutionStatus(frothUrl, token, scriptid, status) {
|
|
|
160
160
|
|
|
161
161
|
console.log("URL" + url)
|
|
162
162
|
// formData.append('execution_id', BUFFER.getItem("EXECUTION_ID"))
|
|
163
|
-
formData.append('
|
|
163
|
+
formData.append('script_status', status)
|
|
164
164
|
|
|
165
165
|
const response = await fetch(url, {
|
|
166
166
|
method: 'PUT',
|
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
// Function to verify text in Android app
|
|
2
|
-
const assert = require('assert');
|
|
3
2
|
|
|
4
3
|
async function assertText(driver, elementSelector, expectedText) {
|
|
5
|
-
|
|
6
|
-
//
|
|
4
|
+
|
|
5
|
+
// Wait for the element to be visible
|
|
7
6
|
await driver.waitUntil(async () => {
|
|
8
7
|
const element = await driver.$(elementSelector);
|
|
9
|
-
return await element.isDisplayed();
|
|
8
|
+
// return await element.isDisplayed();
|
|
10
9
|
}, { timeout: 30000 });
|
|
11
10
|
|
|
12
11
|
// Get the actual text from the element
|
|
13
|
-
const element = await driver.$(elementSelector);
|
|
14
12
|
const actualText = await element.getText();
|
|
15
13
|
|
|
16
|
-
// expect(actualText).toEqual(expectedText,`Expected title to be "${expectedText}", but found "${actualText}"`);
|
|
17
14
|
console.log('Actual text:', actualText, 'Expected text:', expectedText);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// if (actualText === expectedText) {
|
|
22
|
-
// console.log('Text verification passed. Actual text:', actualText, 'Expected text:', expectedText);
|
|
23
|
-
// return true;
|
|
24
|
-
// } else {
|
|
25
|
-
// console.warn('Text verification failed. Actual text:', actualText, 'Expected text:', expectedText);
|
|
26
|
-
// }
|
|
27
|
-
// } catch (error) {
|
|
28
|
-
// console.error('Error occurred while verifying text:', error);
|
|
29
|
-
// }
|
|
15
|
+
|
|
16
|
+
await expect(actualText).toBe(expectedText, `Expected text to be "${expectedText}", but found "${actualText}"`);
|
|
17
|
+
|
|
30
18
|
}
|
|
31
19
|
|
|
32
20
|
module.exports = assertText;
|
package/config/commonconfig.js
CHANGED
|
@@ -76,7 +76,7 @@ const commonconfig = {
|
|
|
76
76
|
// BUFFER.setItem("TOTAL_DURATION", Number(BUFFER.getItem("TOTAL_DURATION")) + duration)
|
|
77
77
|
console.log(`Duration: ${duration}ms`);
|
|
78
78
|
console.log(`Passed: ${passed}`);
|
|
79
|
-
let scriptresult;
|
|
79
|
+
let scriptresult="NOT RUN";
|
|
80
80
|
let scriptid = BUFFER.getItem(fileName.replace(".js", ""))
|
|
81
81
|
|
|
82
82
|
if (passed) {
|
|
@@ -148,31 +148,5 @@ async function secondsToTime(secs) {
|
|
|
148
148
|
|
|
149
149
|
return hours + ':' + minutes + ':' + seconds;
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
// try {
|
|
153
|
-
// const frothUrl = "devapi.frothtestops.com";
|
|
154
|
-
// const username = "subhra.subudhi@roboticodigital.com";
|
|
155
|
-
// const password = "V2VsY29tZUAxMjM=";
|
|
156
|
-
|
|
157
|
-
// const token = await getLoginToken(frothUrl, username, password);
|
|
158
|
-
// if (!token) {
|
|
159
|
-
// throw new Error('Login failed, no token obtained');
|
|
160
|
-
// }
|
|
161
|
-
|
|
162
|
-
// const id = 208;
|
|
163
|
-
// // const data = await getExecuitonDetails(frothUrl, token, id);
|
|
164
|
-
// // console.log("Retrieved JSON Data:", data);
|
|
165
|
-
// const resultdetails = {};
|
|
166
|
-
// const resultdata="Pass";
|
|
167
|
-
// const duration ="31355ms";
|
|
168
|
-
// resultdetails.excution_status = resultdata === 'Pass' ? 'PASSED' : 'FAILED'
|
|
169
|
-
// resultdetails.excution_time = convertMillisecondsToTime(duration)
|
|
170
|
-
// BUFFER.setItem("EXECUTION_ID",208);
|
|
171
|
-
// await exeDetails.updateExecuitonDetails(frothUrl, token, id,resultdetails);
|
|
172
|
-
// } catch (error) {
|
|
173
|
-
// console.error('Error in main function:', error);
|
|
174
|
-
// }
|
|
175
|
-
// }
|
|
176
|
-
|
|
177
|
-
// main();
|
|
151
|
+
|
|
178
152
|
module.exports = commonconfig;
|