@cuppet/core 1.2.0 → 1.2.1
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.
|
@@ -77,3 +77,8 @@ Given('I switch back to original window', async function () {
|
|
|
77
77
|
Given('I switch to {string} tab', async function (tabNumber) {
|
|
78
78
|
this.page = await helper.switchToTab(this.browser, tabNumber);
|
|
79
79
|
});
|
|
80
|
+
|
|
81
|
+
Then('I generate UUID and store it in {string} variable', async function (variable) {
|
|
82
|
+
const uuid = helper.generateRandomUuid();
|
|
83
|
+
await dataStorage.iStoreVariableWithValueToTheJsonFile(uuid, variable);
|
|
84
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuppet/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Core testing framework components for Cuppet - BDD framework based on Cucumber and Puppeteer",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"pa11y": "^9.0.0",
|
|
45
45
|
"pa11y-reporter-html": "^2.0.0",
|
|
46
46
|
"puppeteer": "^24.0.1",
|
|
47
|
+
"uuid": "^13.0.0",
|
|
47
48
|
"webdriverio": "9.12.7",
|
|
48
49
|
"xml2js": "^0.6.2"
|
|
49
50
|
},
|
package/src/helperFunctions.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @typedef {import('puppeteer').Browser} Browser
|
|
5
5
|
*/
|
|
6
6
|
const config = require('config');
|
|
7
|
+
const { v4: uuidv4 } = require('uuid');
|
|
8
|
+
|
|
7
9
|
module.exports = {
|
|
8
10
|
/**
|
|
9
11
|
* Waits for a keypress event to continue the test execution.
|
|
@@ -32,6 +34,15 @@ module.exports = {
|
|
|
32
34
|
.substring(2, length + 2);
|
|
33
35
|
},
|
|
34
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Generate random v4 UUID
|
|
39
|
+
* @example 123e4567-e89b-12d3-a456-426614174000
|
|
40
|
+
* @returns {string}
|
|
41
|
+
*/
|
|
42
|
+
generateRandomUuid: function () {
|
|
43
|
+
return uuidv4();
|
|
44
|
+
},
|
|
45
|
+
|
|
35
46
|
/**
|
|
36
47
|
* Iterate through json object and return the value of specific property
|
|
37
48
|
* @param object - the json object to iterate through
|