froth-webdriverio-framework 0.1.35 → 0.1.36
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/api/readTestdata.js +1 -1
- package/config/commonconfig.js +27 -8
- package/package.json +1 -1
package/api/readTestdata.js
CHANGED
package/config/commonconfig.js
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
|
+
const getDataById = require("../api/readTestdata");
|
|
1
2
|
// Description: This file contains the common configuration for the webdriverio framework.
|
|
2
|
-
const readTestData = require('../api/readTestdata.js');
|
|
3
3
|
const commonconfig = {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Gets executed once before all workers get launched.
|
|
7
|
+
* @param {Object} config wdio configuration object
|
|
8
|
+
* @param {Array.<Object>} capabilities list of capabilities details
|
|
9
|
+
*/
|
|
10
|
+
before: function (config, capabilities) {
|
|
11
|
+
// This code runs before the test suite starts
|
|
12
|
+
console.log('Preparing for tests...');
|
|
13
|
+
console.log("organisation url" + process.env.organisation_url);
|
|
14
|
+
console.log("test data id" + process.env.testdata_id);
|
|
15
|
+
process.env.BUFFER = null;
|
|
16
|
+
console.log("process.env.BUFFER in before " + process.env.BUFFER);
|
|
17
|
+
getDataById(process.env.organisation_url, process.env.testdata_id);
|
|
18
|
+
// You can perform any setup tasks here
|
|
19
|
+
global.myGlobalVariable = 'Some value';
|
|
20
|
+
|
|
21
|
+
// If you need to perform asynchronous actions, use the 'beforeSession' hook instead
|
|
22
|
+
},
|
|
23
|
+
|
|
4
24
|
/**
|
|
5
25
|
* Gets executed before the suite starts (in Mocha/Jasmine only).
|
|
6
26
|
* @param {object} suite suite details
|
|
7
27
|
*/
|
|
8
28
|
beforeSuite: function (suite) {
|
|
9
|
-
try{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}catch(e){
|
|
29
|
+
try {
|
|
30
|
+
console.log("Running suite:", suite.title);
|
|
31
|
+
console.log("Reading test data from the API");
|
|
32
|
+
|
|
33
|
+
} catch (e) {
|
|
15
34
|
console.log("Error in beforeSuite:", e);
|
|
16
35
|
}
|
|
17
36
|
},
|
|
@@ -80,4 +99,4 @@ const commonconfig = {
|
|
|
80
99
|
|
|
81
100
|
};
|
|
82
101
|
|
|
83
|
-
module.exports = commonconfig;
|
|
102
|
+
module.exports = { commonconfig, F };
|