@cuppet/core 1.3.5 → 1.3.7

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.
@@ -26,7 +26,7 @@ Then('the property {string} should be an {string}', async function (property, ty
26
26
  await apiSteps.propertyIs(property, type);
27
27
  });
28
28
  Then('the response should have property {string} with value {string}', async function (property, value) {
29
- const checkedValue = await dataStorage.checkForVariable(value);
29
+ const checkedValue = await dataStorage.checkForSavedVariable(value);
30
30
  await apiSteps.propertyHasValue(property, checkedValue);
31
31
  });
32
32
  When('I store {string} to {string} variable', async function (property, variable) {
@@ -87,7 +87,7 @@ When(
87
87
  */
88
88
  When(
89
89
  'I generate date in {string} format for {string} days from now with UTC offset {int} hours and store it in {string}',
90
- async function (format, offset, days, variable) {
90
+ async function (format, days, offset, variable) {
91
91
  const utcOffset = offset * 60;
92
92
  await dataStorage.generateAndSaveDateWithCustomFormatAndTz(format, variable, days, utcOffset);
93
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuppet/core",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "Core testing framework components for Cuppet - BDD framework based on Cucumber and Puppeteer",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -283,10 +283,7 @@ module.exports = {
283
283
  * @returns {Promise<void>}
284
284
  */
285
285
  generateAndSaveDateWithCustomFormat: async function (format, variable, days = 0) {
286
- const date = moment()
287
- .add(days >= 0 ? days : -days, 'days')
288
- .format(format);
289
-
286
+ const date = moment().add(days, 'days').format(format);
290
287
  await this.iStoreVariableWithValueToTheJsonFile(date, variable);
291
288
  },
292
289
 
@@ -300,10 +297,7 @@ module.exports = {
300
297
  * @returns {Promise<void>}
301
298
  */
302
299
  generateAndSaveDateWithCustomFormatAndTz: async function (format, variable, days = 0, offset = 0) {
303
- const date = moment()
304
- .utcOffset(offset)
305
- .add(days >= 0 ? days : -days, 'days')
306
- .format(format);
300
+ const date = moment().utcOffset(offset).add(days, 'days').format(format);
307
301
  await this.iStoreVariableWithValueToTheJsonFile(date, variable);
308
302
  },
309
303
  };