froth-webdriverio-framework 0.1.53 → 0.1.55

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.
@@ -10,6 +10,7 @@ const commonconfig = {
10
10
 
11
11
 
12
12
  onPrepare: async function (capabilities, specs) {
13
+ localStorage.setItem("TOTAL_DURATION",0);
13
14
  // This code runs before the test suite starts
14
15
  // console.log("organisation url" + process.env.organisation_url);
15
16
  // console.log("test data id" + process.env.testdata_id);
@@ -27,7 +28,7 @@ const commonconfig = {
27
28
  const getSuiteDetail = await getSuiteDetails(localStorage.getItem("organisation_url"), getToken, getExeDetails.automation_suite_id);
28
29
  if (getSuiteDetail.test_data_id != null)
29
30
  {
30
- const jsonobject = await getDataById(localStorage.getItem("organisation_url"), getSuiteDetail.test_data_id);
31
+ const jsonobject = await getDataById(localStorage.getItem("organisation_url"),getToken, getSuiteDetail.test_data_id);
31
32
  if (jsonobject == null) {
32
33
  console.log("Test data is not available");
33
34
  }
@@ -90,6 +91,7 @@ const commonconfig = {
90
91
  */
91
92
  afterTest: function (test, context, { error, result, duration, passed, retries }) {
92
93
  console.log(`Test '${test.title}' finished.`);
94
+ localStorage.setItem("TOTAL_DURATION",Number(localStorage.getItem("TOTAL_DURATION"))+duration)
93
95
  console.log(`Duration: ${duration}ms`);
94
96
  console.log(`Passed: ${passed}`);
95
97
  if (passed)
@@ -113,15 +115,15 @@ const commonconfig = {
113
115
  * @param {Array.<Object>} capabilities list of capabilities details
114
116
  * @param {Array.<String>} specs List of spec file paths that ran
115
117
  */
116
- after: function (result, capabilities, specs, { duration }) {
118
+ after: function (result, capabilities, specs) {
117
119
  console.log('All tests are done.');
118
120
  const resultdata = result === 0 ? 'Pass' : 'Fail';
119
121
  console.log(`Result: ${resultdata}`);
120
- console.log(`Duartion suite : ${duration}`)
122
+
121
123
  const resultdetails = {}
122
124
  resultdetails.excution_status = resultdata === 'Pass' ? 'PASSED' : 'FAILED'
123
- resultdetails.excution_time = convertMillisecondsToTime(duration)
124
- exeDetails.updateExecuitonDetails(localStorage.getItem(organisation_url), localStorage.getItem("LOGIN_TOKEN"), localStorage.getItem(EXECUTION_ID), resultdetails)
125
+ resultdetails.excution_time = convertMillisecondsToTime(localStorage.getItem("TOTAL_DURATION"))
126
+ exeDetails.updateExecuitonDetails(localStorage.getItem("organisation_url"), localStorage.getItem("LOGIN_TOKEN"), localStorage.getItem("EXECUTION_ID"), resultdetails)
125
127
 
126
128
  // console.log('Capabilities:');
127
129
  // console.log(capabilities);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "readme": "WendriverIO Integration with [BrowserStack]",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",