diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-02-27 05:59:15 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-02-27 04:00:06 +0000 |
commit | 8f96ad53198665fa3daf118d8c8866ab47f2c747 (patch) | |
tree | 20eb3df209fa35ee1c81fdc209e0fb7074f63f2f /vid-webpack-master/cypress/support | |
parent | e51ebedbdead7413d8e76de7da2f8fb39f22e5c4 (diff) |
cypress test - provide more details upon deepCompare failure
Issue-ID: VID-740
Change-Id: I75d69d1b70e9c6a82984a1d6f61a972827c19e03
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/cypress/support')
-rw-r--r-- | vid-webpack-master/cypress/support/steps/general/compareDeepObjects.step.ts | 5 |
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}`); } } } |