froth-webdriverio-framework 3.0.14 → 3.0.16
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/commonMethods/Utils.js
CHANGED
|
@@ -65,7 +65,7 @@ storeattributevalue = require(basepath + '/storeToBuffer').STOREATTRIBUTEVALUE;
|
|
|
65
65
|
api = require(basepath + '/apicall').callapi;
|
|
66
66
|
validate = require(basepath + '/apicall').validate;
|
|
67
67
|
|
|
68
|
-
selectDropDownValue = require(basepath + '/dropDown').
|
|
68
|
+
selectDropDownValue = require(basepath + '/dropDown').select4mDropDownValue;
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
//export the variabels
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function select4mDropDownValue(elementSelector, selectOption) {
|
|
2
2
|
try {
|
|
3
3
|
// let selectBox = await $(elementSelector);
|
|
4
4
|
await $(elementSelector).selectByAttribute('value', selectOption);
|
|
@@ -20,4 +20,4 @@ async function amendToBrowserstack(annotationMessage, level) {
|
|
|
20
20
|
// throw error;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
module.exports = {
|
|
23
|
+
module.exports = { select4mDropDownValue };
|
package/config/commonconfig.js
CHANGED
|
@@ -7,7 +7,8 @@ const getBSSessionDetails = require("../api/browsersatckSessionInfo");
|
|
|
7
7
|
const isBrowserStackEnabled = process.env.BROWSERSTACK;
|
|
8
8
|
let starttime;
|
|
9
9
|
let endtime;
|
|
10
|
-
|
|
10
|
+
let totalTests = 0;
|
|
11
|
+
let executedTests = 0;
|
|
11
12
|
// Description: This file contains the common configuration for the webdriverio framework.
|
|
12
13
|
const commonconfig = {
|
|
13
14
|
|
|
@@ -33,7 +34,8 @@ const commonconfig = {
|
|
|
33
34
|
try {
|
|
34
35
|
console.log("Running suite:", suite.title);
|
|
35
36
|
starttime = new Date().getTime();
|
|
36
|
-
|
|
37
|
+
totalTests += suite.tests.length;
|
|
38
|
+
console.log("Total Tests Defined in Suite:", totalTests);
|
|
37
39
|
// const sessionId = browser.sessionId;
|
|
38
40
|
// BUFFER.setItem("SESSION_ID", sessionId)
|
|
39
41
|
if (isBrowserStackEnabled === true) {
|
|
@@ -77,6 +79,8 @@ const commonconfig = {
|
|
|
77
79
|
*/
|
|
78
80
|
afterTest: async function (test, context, { error, result, duration, passed, retries }) {
|
|
79
81
|
console.log(`Test '${test.title}' finished.`);
|
|
82
|
+
executedTests++;
|
|
83
|
+
|
|
80
84
|
const fileName = path.basename(test.file);
|
|
81
85
|
console.log('Test File Name:', fileName);
|
|
82
86
|
// BUFFER.setItem("FROTH_TOTAL_DURATION", Number(BUFFER.getItem("FROTH_TOTAL_DURATION")) + duration)
|
|
@@ -113,8 +117,25 @@ const commonconfig = {
|
|
|
113
117
|
* @param {Array.<Object>} capabilities list of capabilities details
|
|
114
118
|
* @param {Array.<String>} specs List of spec file paths that ran
|
|
115
119
|
*/
|
|
116
|
-
after: async function (result, capabilities, specs) {
|
|
120
|
+
after: async function (result, config,capabilities, specs) {
|
|
117
121
|
console.log('All tests are done.' + result);
|
|
122
|
+
const notRunTests1 = totalTests - executedTests;
|
|
123
|
+
console.log(`Total Tests Defined: ${totalTests}`);
|
|
124
|
+
console.log(`Executed Tests: ${executedTests}`);
|
|
125
|
+
console.log(`Tests Not Run: ${notRunTests1}`);
|
|
126
|
+
|
|
127
|
+
const totalDefinedTests = config.specs.length; // Total test files/specs defined
|
|
128
|
+
const executedTests = result.finished; // Tests that were executed
|
|
129
|
+
const passedTests = result.passed;
|
|
130
|
+
const failedTests = result.failed;
|
|
131
|
+
const notRunTests = totalDefinedTests - executedTests;
|
|
132
|
+
|
|
133
|
+
console.log(`Total Defined Tests: ${totalDefinedTests}`);
|
|
134
|
+
console.log(`Executed Tests: ${executedTests}`);
|
|
135
|
+
console.log(`Passed Tests: ${passedTests}`);
|
|
136
|
+
console.log(`Failed Tests: ${failedTests}`);
|
|
137
|
+
console.log(`Tests Not Run: ${notRunTests}`);
|
|
138
|
+
|
|
118
139
|
BUFFER.setItem("RESULT_DATA", result);
|
|
119
140
|
console.log("result data :" + BUFFER.getItem("RESULT_DATA"))
|
|
120
141
|
const resultdetails = {}
|
|
@@ -138,7 +159,7 @@ const commonconfig = {
|
|
|
138
159
|
|
|
139
160
|
const resultdetails = {}
|
|
140
161
|
resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
|
|
141
|
-
console.log("Total Duration:" + BUFFER.getItem("FROTH_TOTAL_DURATION") === 0 ? await convertTimetoHHMMSS(totalDuration)
|
|
162
|
+
console.log("Total Duration:" + BUFFER.getItem("FROTH_TOTAL_DURATION") === 0 ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION")));
|
|
142
163
|
resultdetails.excution_time = BUFFER.getItem("FROTH_TOTAL_DURATION") === 0 ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"))
|
|
143
164
|
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
144
165
|
BUFFER.clear();
|