froth-webdriverio-framework 1.0.55 → 1.0.57

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.
@@ -21,7 +21,6 @@ async function getBSSessionDetails(sessiontype,bs_username,bs_pwd) {
21
21
 
22
22
  if (response.ok) {
23
23
  const data = await response.json();
24
- console.log('Session Info:', data);
25
24
 
26
25
  // Accessing the public_url property
27
26
  const publicUrl = data.automation_session.public_url;
@@ -29,15 +28,14 @@ async function getBSSessionDetails(sessiontype,bs_username,bs_pwd) {
29
28
  BUFFER.setItem("REPORT_URL",publicUrl)
30
29
  BUFFER.setItem("TOTAL_DURATION",duration)
31
30
 
32
- console.log("public url : " + publicUrl);
33
31
  //return jsondata;
34
32
  } else if (response.status === 401) { //
35
33
  console.log("Unauthorized, token expired")
36
34
 
37
35
  } else {
38
36
  const errorText = await response.text();
39
- console.error('Data fetch failed response:', errorText);
40
- throw new Error(`HTTP error! status: ${response.status}`);
37
+ console.error(`Data fetch failed response:${response.status}`);
38
+ // throw new Error(`HTTP error! status: ${response.status}`);
41
39
  }
42
40
 
43
41
 
@@ -9,7 +9,6 @@ async function getExecuitonDetails(frothUrl, token, id) {
9
9
 
10
10
  try {
11
11
  console.log("URL: " + url)
12
- console.log("setExecutionDetails token " + token)
13
12
 
14
13
  const response = await fetch(url, {
15
14
  method: 'GET',
@@ -21,14 +20,14 @@ async function getExecuitonDetails(frothUrl, token, id) {
21
20
  });
22
21
  if (response.ok) {
23
22
  const data = await response.json();
24
- console.log(data)
23
+ // console.log(data)
25
24
  jsondata.automation_suite_id = data.automation_suite_id;
26
25
  jsondata.test_cycle_id = data.test_cycle_id;
27
26
  if (data.testcycle_type === "Android" || data.testcycle_type === "Ios") {
28
27
  jsondata.device_name = data.device_name
29
28
  jsondata.version = data.version
30
29
  }
31
- console.log("json data :" + JSON.stringify(jsondata));
30
+ // console.log("json data :" + JSON.stringify(jsondata));
32
31
 
33
32
  return jsondata;
34
33
  } else if (response.status === 401) { // Unauthorized, token expired
@@ -60,15 +59,12 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
60
59
  const formData = new FormData();
61
60
  try {
62
61
  console.log("URL" + url)
63
- console.log("resultdetails" + JSON.stringify(resultdetails))
64
- console.log("resultdetails" + token)
62
+
65
63
 
66
64
  if (resultdetails != null) {
67
- console.log("resultdetails" + resultdetails.excution_status)
68
65
  formData.append('excution_status', resultdetails.excution_status);
69
66
  }
70
67
  if (resultdetails.excution_time != null) {
71
- console.log("excution_time" + resultdetails.excution_time)
72
68
  formData.append('excution_time', resultdetails.excution_time);
73
69
  }
74
70
  formData.append('id', BUFFER.getItem("EXECUTION_ID"))
@@ -85,7 +81,7 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
85
81
 
86
82
  if (response.ok) {
87
83
  const data = await response.json();
88
- console.log("data is :"+data)
84
+ // console.log("data is :"+data)
89
85
 
90
86
  } else if (response.status === 401) { // Unauthorized, token expired
91
87
  // Call login function to obtain a new token
@@ -94,8 +90,8 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
94
90
  return updateExecuitonDetails(frothUrl, newToken, id, resultdetails);
95
91
  } else {
96
92
  const errorText = await response.text();
97
- console.error('Data fetch failed response:', errorText);
98
- throw new Error(`HTTP error! status: ${response.status}`);
93
+ console.error(`Data fetch failed response: ${response.status}`);
94
+ // throw new Error(`HTTP error! status: ${response.status}`);
99
95
  }
100
96
 
101
97
 
@@ -17,12 +17,12 @@ async function getSuiteDetails(frothUrl, token, id) {
17
17
  });
18
18
  if (response.ok) {
19
19
  const data = await response.json();
20
- console.log(data)
20
+ // console.log(data)
21
21
  jsondata.automation_suite_id = data.id;
22
22
  jsondata.automation_suite_name = data.automation_suite_name;
23
23
  jsondata.test_data_id = data.test_data_id;
24
24
  jsondata.browser_stack_urls = data.browser_stack_urls;
25
- console.log("json data :" + JSON.stringify(jsondata));
25
+ // console.log("json data :" + JSON.stringify(jsondata));
26
26
 
27
27
  return jsondata;
28
28
 
package/api/loginapi.js CHANGED
@@ -20,7 +20,7 @@ async function getLoginToken(frothUrl, email, password) {
20
20
 
21
21
  if (response.ok) {
22
22
  const data = await response.json();
23
- console.log('Token:', data.access_token);
23
+ // console.log('Token:', data.access_token);
24
24
  return data.access_token;
25
25
  } else {
26
26
  console.error('Login failed:', response.statusText);
@@ -1,8 +1,5 @@
1
1
  const deepmerge = require('deepmerge')
2
2
  const commonconfig = require('./commonconfig');
3
- console.log("device name in common mobile:", process.env.BROWSERSTACK_ACCESS_KEY);
4
- console.log("device name in common mobile:", Buffer.from(process.env.BROWSERSTACK_ACCESS_KEY, 'base64').toString('utf-8'));
5
- console.log("device name in common mobile:", process.env.BROWSERSTACK_USERNAME);
6
3
 
7
4
  const commonmobconfig = deepmerge.all([commonconfig, {
8
5
 
@@ -32,6 +29,7 @@ const commonmobconfig = deepmerge.all([commonconfig, {
32
29
  commonCapabilities: {
33
30
  'bstack:options': {
34
31
  projectName: process.env.PROJECTNAME || "roboticodigital",
32
+ buildName: "Automation Build_"+process.env.BUILD_NUMBER,
35
33
  sessionName: 'Automation test session',
36
34
  debug: true,
37
35
  networkLogs: true
@@ -3,7 +3,7 @@ const { LocalStorage } = require('node-localstorage');
3
3
  global.BUFFER = new LocalStorage('./storage');
4
4
  const exeDetails = require("../api/getexecutionDetails")
5
5
  const getBSSessionDetails = require("../api/browsersatckSessionInfo")
6
- console.log("device name in common :", process.env.DEVICENAME);
6
+
7
7
 
8
8
  // Description: This file contains the common configuration for the webdriverio framework.
9
9
  const commonconfig = {
@@ -18,7 +18,7 @@ const commonconfig = {
18
18
  // await setAllDetails.setIntegrationsDetails();
19
19
  await setAllDetails.setSuiteDetails();
20
20
  await setAllDetails.setTestDataDetails();
21
- console.log("ALL JSON DATA in env variable :" + JSON.stringify(process.env));
21
+ // console.log("ALL JSON DATA in env variable :" + JSON.stringify(process.env));
22
22
  },
23
23
 
24
24
 
@@ -31,9 +31,8 @@ const commonconfig = {
31
31
  console.log("Running suite:", suite.title);
32
32
  const sessionId = browser.sessionId;
33
33
  BUFFER.setItem("SESSION_ID", sessionId)
34
- console.log('Session ID: ' + BUFFER.getItem("SESSION_ID"));
35
34
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, Buffer.from(process.env.BROWSERSTACK_ACCESS_KEY, 'base64').toString('utf-8'));
36
- console.log("ALL JSON DATA IN BUFFER:" + JSON.stringify(BUFFER));
35
+ // console.log("ALL JSON DATA IN BUFFER:" + JSON.stringify(BUFFER));
37
36
  const resultdetails = {};
38
37
  exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("LOGIN_TOKEN"), BUFFER.getItem("EXECUTION_ID"), resultdetails)
39
38
 
@@ -49,7 +48,7 @@ const commonconfig = {
49
48
  */
50
49
  beforeTest: function (test, context) {
51
50
  console.log("Test Name:", test.title);
52
- console.log("File Name:", test.file);
51
+ // console.log("File Name:", test.file);
53
52
 
54
53
  },
55
54
 
@@ -102,9 +101,6 @@ const commonconfig = {
102
101
  // const resultdata = result === 0 ? 'PASSED' : 'FAILED'
103
102
  BUFFER.setItem("RESULT_DATA", result);
104
103
 
105
-
106
- console.log('Local storage has been cleared.');
107
-
108
104
  },
109
105
 
110
106
  afterSession: async function (config, capabilities, specs) {
@@ -122,24 +118,6 @@ const commonconfig = {
122
118
 
123
119
  };
124
120
 
125
- async function convertMillisecondsToTime(msdata) {
126
- const ms = parseInt(msdata.replace('ms', '').trim());
127
-
128
- let seconds = Math.floor(ms / 1000);
129
- let minutes = Math.floor(seconds / 60);
130
- let hours = Math.floor(minutes / 60);
131
-
132
- seconds = seconds % 60;
133
- minutes = minutes % 60;
134
-
135
- // Pad the values with leading zeros if they are less than 10
136
- hours = String(hours).padStart(2, '0');
137
- minutes = String(minutes).padStart(2, '0');
138
- seconds = String(seconds).padStart(2, '0');
139
-
140
- return `${hours}:${minutes}:${seconds}`;
141
- }
142
-
143
121
  async function secondsToTime(secs) {
144
122
  let hours = Math.floor(secs / 3600);
145
123
  let minutes = Math.floor((secs % 3600) / 60);
@@ -7,8 +7,7 @@ const iosconfig = deepmerge.all([commonmobileconfig, {
7
7
  'browserstack',
8
8
  {
9
9
  testObservability: true,
10
- buildName: "IOS",
11
- buildIdentifier: 'BUILD',
10
+ buildIdentifier: 'BUILD_'+process.env.BUILD_NUMBER,
12
11
  browserstackLocal: false,
13
12
  opts: {
14
13
  forcelocal: false,
@@ -37,7 +37,6 @@ async function padZero(num) {
37
37
  }
38
38
 
39
39
  async function setEnvVariables() {
40
- console.log("setting all env variables ")
41
40
  generateBuildNumber();
42
41
  BUFFER.setItem("TOTAL_DURATION", 0);
43
42
  BUFFER.setItem("EXECUTION_ID", process.env.EXECUTION_ID);
@@ -51,12 +50,10 @@ async function setEnvVariables() {
51
50
 
52
51
  async function setLoginToken() {
53
52
  try {
54
- console.log("setting all login token ")
55
53
 
56
54
  const getToken = await getLoginToken(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("SERVICE_USER"), BUFFER.getItem("SERVICE_PASSWORD"));
57
55
  process.env.LOGIN_TOKEN = getToken;
58
56
  BUFFER.setItem("LOGIN_TOKEN", getToken)
59
- console.log("setting all login token " + BUFFER.getItem("LOGIN_TOKEN"))
60
57
 
61
58
  } catch (error) {
62
59
  // console.error('Error in main function:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",