froth-webdriverio-framework 1.0.30 → 1.0.32

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,11 +10,11 @@ const androidConfig = deepmerge.all([commonmobileconfig, {
10
10
  'browserstack',
11
11
  {
12
12
  testObservability: true,
13
- buildName: "ANDROID BUILD 1",
14
- buildIdentifier: process.env.BUILD_NUMBER || "default_build_identifier",
13
+ buildName: "ANDROID BUILD",
14
+ buildIdentifier: "ANDROID BUILD_"+process.env.BUILD_NUMBER ,
15
15
  browserstackLocal: false,
16
16
  opts: { forcelocal: false },
17
- app: process.env.BROWSERSTACK_APP_PATH || 'bs://a224145c09eb22e67c21ef65b29d32ae7aa78bb0'
17
+ app: process.env.BROWSERSTACK_APP_PATH
18
18
  }
19
19
  ]
20
20
  ],
@@ -5,16 +5,47 @@ const getSuiteDetails = require("../api/getsuiteDetails");
5
5
  const getDataById = require("../api/readTestdata");
6
6
 
7
7
 
8
+ async function generateBuildNumber() {
9
+ try {
10
+ const now = new Date();
11
+ const timestamp = formatDate(now); // Format date as needed
12
+
13
+ // Construct the build number with timestamp and counter
14
+ const buildNumber = `${timestamp}`;
15
+ process.env.BUILD_NUMBER = buildNumber;
16
+ // Increment the counter for the next build
17
+ } catch (error) {
18
+ console.log("error in generateBuildNumber")
19
+ }
20
+ //return buildNumber;
21
+ }
22
+
23
+ async function formatDate(date) {
24
+ const year = date.getFullYear();
25
+ const month = padZero(date.getMonth() + 1); // Month is zero-indexed
26
+ const day = padZero(date.getDate());
27
+ const hours = padZero(date.getHours());
28
+ const minutes = padZero(date.getMinutes());
29
+ const seconds = padZero(date.getSeconds());
30
+
31
+ return `${year}${month}${day}_${hours}${minutes}${seconds}`;
32
+ }
33
+
34
+ async function padZero(num) {
35
+ return num.toString().padStart(2, '0');
36
+ }
37
+
8
38
  async function setEnvVariables() {
9
39
  console.log("setting all env variables ")
40
+ generateBuildNumber();
10
41
  BUFFER.setItem("TOTAL_DURATION", 0);
11
42
  BUFFER.setItem("EXECUTION_ID", process.env.EXECUTION_ID);
12
43
  BUFFER.setItem("INTEGRATION_ID", process.env.INTEGRATION_ID);
13
44
  BUFFER.setItem("ORGANISATION_DOMAIN_URL", process.env.ORGANISATION_DOMAIN_URL);
14
45
  BUFFER.setItem("SERVICE_USER", "frothbot@roboticodigital.com");
15
46
  BUFFER.setItem("SERVICE_PASSWORD", "RnJvdGh0ZXN0b3BzQDU1NQ==");
16
-
17
-
47
+
48
+
18
49
  }
19
50
 
20
51
  async function setLoginToken() {
@@ -63,7 +94,7 @@ async function setSuiteDetails() {
63
94
  const getSuiteDetail = await getSuiteDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("LOGIN_TOKEN"), BUFFER.getItem("AUTOMATION_SUITE_ID"));
64
95
  process.env.BROWSERSTACK_APP_PATH = getSuiteDetail.browser_stack_urls;
65
96
  BUFFER.setItem("TESTDATA_ID", getSuiteDetail.test_data_id);
66
-
97
+
67
98
 
68
99
  } catch (error) {
69
100
  // console.error('Error in main function:', error);
@@ -72,7 +103,7 @@ async function setSuiteDetails() {
72
103
  async function setTestDataDetails() {
73
104
  try {
74
105
  const jsonobject = await getDataById(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("LOGIN_TOKEN"), BUFFER.getItem("TESTDATA_ID"));
75
-
106
+
76
107
  } catch (error) {
77
108
  // console.error('Error in main function:', error);
78
109
  }
@@ -32,8 +32,7 @@ if (process.env.LOCATION == 'local') {
32
32
  verifyText = require('froth-webdriverio-framework/mobile/commonMethods/verifyText');
33
33
  }
34
34
  //export the variabels
35
-
36
- export default {
35
+ module.exports= {
37
36
  scrollToEnd,
38
37
  clickIfVisible,
39
38
  verifyTextInFieldAttribute,
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "1.0.30",
4
- "type": "module",
3
+ "version": "1.0.32",
5
4
  "readme": "WebdriverIO Integration",
6
5
  "description": "WebdriverIO and BrowserStack App Automate",
7
6
  "license": "MIT",