From 9d93a8f6c2b47cfa67c2f45c25231ad816d8e79f Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Mon, 7 Oct 2024 13:39:29 +0530 Subject: [PATCH 1/3] chore: Update Inline_editing_3_spec.js to include expected JSON parsing --- .../ClientSide/Widgets/TableV2/Inline_editing_3_spec.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js index 40da3f138e35..ea5e3be0fa51 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js @@ -148,10 +148,12 @@ describe( cy.editTableCell(0, 0); cy.enterTableCellValue(0, 0, "newValue"); cy.saveTableCellValue(0, 0); - cy.get(".t--widget-textwidget .bp3-ui-text").should( - "contain", + const exected = JSON.parse( `[ { "index": 0, "updatedFields": { "step": "newValue" }, "allFields": { "step": "newValue", "task": "Drop a table", "status": "✅" } }]`, ); + agHelper + .GetText(".t--widget-textwidget .bp3-ui-text", "text") + .should((text) => expect(JSON.parse(text)).to.deep.equal(exected)); cy.openPropertyPane("textwidget"); cy.updateCodeInput( ".t--property-control-text", From 463c470dff0f42fa39350662781de79404019a31 Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Mon, 7 Oct 2024 13:56:47 +0530 Subject: [PATCH 2/3] Use proper selector for text widget. --- .../ClientSide/Widgets/TableV2/Inline_editing_3_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js index ea5e3be0fa51..a31213c6cc28 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js @@ -152,7 +152,7 @@ describe( `[ { "index": 0, "updatedFields": { "step": "newValue" }, "allFields": { "step": "newValue", "task": "Drop a table", "status": "✅" } }]`, ); agHelper - .GetText(".t--widget-textwidget .bp3-ui-text", "text") + .GetText(locators._textWidget, "text") .should((text) => expect(JSON.parse(text)).to.deep.equal(exected)); cy.openPropertyPane("textwidget"); cy.updateCodeInput( From 0cf810ba36f9947f9aff6c85c6c8d64bc7f1dbf3 Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Mon, 7 Oct 2024 13:57:28 +0530 Subject: [PATCH 3/3] Removes redundant parsing in spec. --- .../Widgets/TableV2/Inline_editing_3_spec.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js index a31213c6cc28..5a27f59e1e0f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js @@ -4,6 +4,7 @@ import { agHelper, table as tableHelper, propPane, + locators, } from "../../../../../support/Objects/ObjectsCore"; import { PROPERTY_SELECTOR } from "../../../../../locators/WidgetLocators"; @@ -148,9 +149,13 @@ describe( cy.editTableCell(0, 0); cy.enterTableCellValue(0, 0, "newValue"); cy.saveTableCellValue(0, 0); - const exected = JSON.parse( - `[ { "index": 0, "updatedFields": { "step": "newValue" }, "allFields": { "step": "newValue", "task": "Drop a table", "status": "✅" } }]`, - ); + const exected = [ + { + index: 0, + updatedFields: { step: "newValue" }, + allFields: { step: "newValue", task: "Drop a table", status: "✅" }, + }, + ]; agHelper .GetText(locators._textWidget, "text") .should((text) => expect(JSON.parse(text)).to.deep.equal(exected));