diff options
author | 2018-04-22 11:04:16 +0300 | |
---|---|---|
committer | 2018-04-22 11:04:16 +0300 | |
commit | 4182fc36985570881dba09680d4a4bbd8d946a79 (patch) | |
tree | 539a1d07593d8738c51589dc8fca329d31ab2932 /openecomp-bdd/stepDefinitions/General_Steps.js | |
parent | 189ea57b899a346f5af26ddc88eff7a12611b560 (diff) |
List items filters flow tests
Change-Id: Id843c02e5d328a61e0c6b3e713d962e7edfa197f
Issue-ID: SDC-1213
Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-bdd/stepDefinitions/General_Steps.js')
-rw-r--r-- | openecomp-bdd/stepDefinitions/General_Steps.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/openecomp-bdd/stepDefinitions/General_Steps.js b/openecomp-bdd/stepDefinitions/General_Steps.js index bf69d8d9ba..2076366595 100644 --- a/openecomp-bdd/stepDefinitions/General_Steps.js +++ b/openecomp-bdd/stepDefinitions/General_Steps.js @@ -238,6 +238,30 @@ When('I want to load the json content of the entry {string} in the zip {string} /** * @module ResponseData + * @description Check that the result list doesn't contain an element with property x which has value + * equals to saved property y + * @exampleFile ListItemsFilters.feature + * @step I want to check that element in the response list with {string} equals to value of saved property {string} does not exist + **/ +Then('I want to check that element in the response list with {string} equals to value of saved property {string} does not exist', function (propertyPath, valueProperty) { + const results = this.context.responseData.results; + assert.equal(results.find(result => this.context[valueProperty] === _.get(result, propertyPath)), undefined); +}); + +/** + * @module ResponseData + * @description Check that the result list contains an element with property x which has value + * equals to saved property y + * @exampleFile ListItemsFilters.feature + * @step I want to check that element in the response list with {string} equals to value of saved property {string} exists + **/ +Then('I want to check that element in the response list with {string} equals to value of saved property {string} exists', function(propertyPath, valueProperty) { + const results = this.context.responseData.results; + assert.notEqual(results.find(result => this.context[valueProperty] === _.get(result, propertyPath)), undefined); +}); + +/** + * @module ResponseData * @description Check that the itemId from context exits in result of responseData * exampleFile ArchiveItem.feature * step I want to check that item exits in response |