froth-webdriverio-framework 0.1.49 → 0.1.51

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.
@@ -4,8 +4,8 @@ const getLoginToken = require("../api/loginapi");
4
4
  // Function to get data from the API using the Bearer token
5
5
  async function getSuiteDetails(frothUrl, token, id) {
6
6
  let jsondata = {};
7
- if (id != 0) {
8
- const url = `https://${frothUrl}/api/automationsuite-retrieve/${id}`;
7
+ if (id = null || id != 0) {
8
+ const url = `https://${frothUrl}/api/automationsuite-retrieve/${id}/`;
9
9
 
10
10
  try {
11
11
 
@@ -13,6 +13,8 @@ async function getSuiteDetails(frothUrl, token, id) {
13
13
  method: 'GET',
14
14
  headers: {
15
15
  'Authorization': `Bearer ${token}`,
16
+ 'Content-Type': 'application/json'
17
+
16
18
  }
17
19
  });
18
20
  if (response.ok) {
@@ -4,7 +4,7 @@ const login = require('./loginapi.js');
4
4
  async function getDataById(frothUrl, token, id) {
5
5
 
6
6
  if (id != 0) {
7
- const url = `https://${frothUrl}/api/testdata-retrieve/${id}`;
7
+ const url = `https://${frothUrl}/api/testdata-retrieve/${id}/`;
8
8
 
9
9
  try {
10
10
 
@@ -12,6 +12,7 @@ async function getDataById(frothUrl, token, id) {
12
12
  method: 'GET',
13
13
  headers: {
14
14
  'Authorization': `Bearer ${token}`,
15
+ 'Content-Type': 'application/json'
15
16
  }
16
17
  });
17
18
 
@@ -10,7 +10,7 @@ const androidConfig = deepmerge.all([commonmobileconfig, {
10
10
  testObservability: true,
11
11
  buildName: "ANDROID BUILD 1",
12
12
  buildIdentifier: process.env.BUILD_NUMBER || "default_build_identifier",
13
- browserstackLocal: true,
13
+ browserstackLocal: false,
14
14
  opts: { forcelocal: false },
15
15
  app: process.env.BROWSERSTACK_APP_PATH || 'bs://a224145c09eb22e67c21ef65b29d32ae7aa78bb0'
16
16
  }
@@ -13,32 +13,30 @@ const commonconfig = {
13
13
  // This code runs before the test suite starts
14
14
  // console.log("organisation url" + process.env.organisation_url);
15
15
  // console.log("test data id" + process.env.testdata_id);
16
- process.env.BUFFER = null;
17
- localStorage.setItem("EXECUTION_ID",process.env.EXECUTION_ID)
18
- localStorage.setItem("organisation_url",process.env.organisation_url)
19
- localStorage.setItem("SERVICE_USER","subhra.subudhi@roboticodigital.com")
20
- localStorage.setItem("SERVICE_PASSWORD","V2VsY29tZUAxMjM=")
16
+ localStorage.setItem("EXECUTION_ID", process.env.EXECUTION_ID)
17
+ localStorage.setItem("organisation_url", process.env.organisation_url)
18
+ localStorage.setItem("SERVICE_USER", "subhra.subudhi@roboticodigital.com")
19
+ localStorage.setItem("SERVICE_PASSWORD", "V2VsY29tZUAxMjM=")
21
20
 
22
21
  const getToken = await getLoginToken(localStorage.getItem("organisation_url"), localStorage.getItem("SERVICE_USER"), localStorage.getItem("SERVICE_PASSWORD"));
23
22
  process.env.LOGIN_TOKEN = getToken;
24
- localStorage.setItem("LOGIN_TOKEN",getToken)
25
-
26
- const getExeDetails = await exeDetails.getExecutionDetails(localStorage.getItem("organisation_url"), getToken, localStorage.getItem(EXECUTION_ID));
27
- const getSuiteDetail = await getSuiteDetails(localStorage.getItem("organisation_url"), getToken, getExeDetails.automation_suite_id);
28
- if (getSuiteDetail.test_data_id == null)
29
- console.log("Test data is not linked");
30
- else {
31
- const jsonobject = await getDataById(localStorage.getItem("organisation_url"), getSuiteDetail.test_data_id);
32
- if (jsonobject == null) {
33
- console.log("Test data is not available");
34
- }
35
- else {
36
- process.env.BUFFER = JSON.stringify(jsonobject);
37
- localStorage.setItem("BUFFER",jJSON.stringify(sonobject))
38
-
23
+ localStorage.setItem("LOGIN_TOKEN", getToken)
24
+
25
+ const getExeDetails = await exeDetails.getExecuitonDetails(localStorage.getItem("organisation_url"), getToken, localStorage.getItem("EXECUTION_ID"));
26
+ if (getExeDetails.automation_suite_id != null) {
27
+ const getSuiteDetail = await getSuiteDetails(localStorage.getItem("organisation_url"), getToken, getExeDetails.automation_suite_id);
28
+ if (getSuiteDetail.test_data_id != null)
29
+ {
30
+ const jsonobject = await getDataById(localStorage.getItem("organisation_url"), getSuiteDetail.test_data_id);
31
+ if (jsonobject == null) {
32
+ console.log("Test data is not available");
33
+ }
34
+ else {
35
+ localStorage.setItem("BUFFER", JSON.stringify(jsonobject))
36
+
37
+ }
39
38
  }
40
39
  }
41
-
42
40
  },
43
41
 
44
42
  before: function (capabilities, specs) {
@@ -156,7 +154,7 @@ function convertMillisecondsToTime(msdata) {
156
154
  // const frothUrl = "devapi.frothtestops.com";
157
155
  // const username = "subhra.subudhi@roboticodigital.com";
158
156
  // const password = "V2VsY29tZUAxMjM=";
159
-
157
+
160
158
  // const token = await getLoginToken(frothUrl, username, password);
161
159
  // if (!token) {
162
160
  // throw new Error('Login failed, no token obtained');
@@ -9,7 +9,7 @@ const iosconfig = deepmerge.all([commonmobileconfig, {
9
9
  testObservability: true,
10
10
  buildName: "IOS",
11
11
  buildIdentifier: 'BUILD',
12
- browserstackLocal: true,
12
+ browserstackLocal: false,
13
13
  opts: {
14
14
  forcelocal: false,
15
15
  localIdentifier: "webdriverio-appium" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "readme": "WendriverIO Integration with [BrowserStack]",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",