summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2020-02-27 12:25:33 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-27 12:25:33 +0000
commit34c5101222a4bfbf3e0516f454232c2e11942bcd (patch)
treefde3a0a56e4ca02ac522fd9e00791f647e69c692
parent759686a89cd4b33bcfc00a54de46ae912fede772 (diff)
parent8f96ad53198665fa3daf118d8c8866ab47f2c747 (diff)
Merge "cypress test - provide more details upon deepCompare failure"
-rw-r--r--vid-webpack-master/cypress/support/steps/general/compareDeepObjects.step.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/vid-webpack-master/cypress/support/steps/general/compareDeepObjects.step.ts b/vid-webpack-master/cypress/support/steps/general/compareDeepObjects.step.ts
index 901a9b17f..f8a8b0fcc 100644
--- a/vid-webpack-master/cypress/support/steps/general/compareDeepObjects.step.ts
+++ b/vid-webpack-master/cypress/support/steps/general/compareDeepObjects.step.ts
@@ -8,6 +8,9 @@ declare namespace Cypress {
function deepCompare(actual : any, expected : any) {
if(actual !== null && expected !== null){
+ const actualOriginal = JSON.stringify(actual);
+ const expectedOriginal = JSON.stringify(expected);
+
let diff : any[] = [];
Cypress._.mergeWith(actual, expected, function (objectValue, sourceValue, key, object, source) {
if ( !(_.isEqual(objectValue, sourceValue)) && (Object(objectValue) !== objectValue)) {
@@ -24,7 +27,7 @@ function deepCompare(actual : any, expected : any) {
if(diff.length > 0){
console.error("diff", diff);
cy.log("The object are not equals", diff);
- expect(actual).equals(expected, `diff: ${diff}, actual:${JSON.stringify(actual)}, expected:${JSON.stringify(expected)}`);
+ expect(actual).equals(expected, `diff: ${diff}, actual:${actualOriginal}, expected:${expectedOriginal}`);
}
}
}