From 17bddbda75ee7ccff15b1ab3a11de35f182e0eaf Mon Sep 17 00:00:00 2001 From: Aditya Acharya Date: Fri, 29 May 2020 10:04:55 +0000 Subject: [PATCH] Publish Test Cases --- .../Smoke_TestSuite/Binding/TextTable.js | 41 ++++++++++++++++--- .../cypress/locators/publishWidgetspage.json | 33 +++++++-------- 2 files changed, 53 insertions(+), 21 deletions(-) diff --git a/app/client/cypress/integration/Smoke_TestSuite/Binding/TextTable.js b/app/client/cypress/integration/Smoke_TestSuite/Binding/TextTable.js index 18d119b828..77a21c84e1 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/Binding/TextTable.js +++ b/app/client/cypress/integration/Smoke_TestSuite/Binding/TextTable.js @@ -1,4 +1,5 @@ const commonlocators = require("../../../locators/commonlocators.json"); +const publish = require("../../../locators/publishWidgetspage.json"); const dsl = require("../../../fixtures/TextTabledsl.json"); describe("Text-Table Binding Functionality", function() { @@ -20,9 +21,16 @@ describe("Text-Table Binding Functionality", function() { cy.readTabledata("1", "0").then(tabData => { const tabValue = tabData; cy.get(commonlocators.TextInside).should("have.text", tabValue); + cy.PublishtheApp(); + cy.isSelectRow(1); + cy.readTabledataPublish("1", "0").then(tabDataP => { + const tabValueP = tabDataP; + cy.get(commonlocators.TextInside).should("have.text", tabValueP); + }); }); }); it("Text-Table Binding Functionality For Email", function() { + cy.get(publish.backToEditor).click(); cy.isSelectRow(2); cy.openPropertyPane("textwidget"); cy.testJsontext("text", "{{Table1.selectedRow.email}}"); @@ -33,9 +41,16 @@ describe("Text-Table Binding Functionality", function() { cy.readTabledata("2", "1").then(tabData => { const tabValue = tabData; cy.get(commonlocators.TextInside).should("have.text", tabValue); + cy.PublishtheApp(); + cy.isSelectRow(2); + cy.readTabledataPublish("2", "1").then(tabDataP => { + const tabValueP = tabDataP; + cy.get(commonlocators.TextInside).should("have.text", tabValueP); + }); }); }); it("Text-Table Binding Functionality For Total Length", function() { + cy.get(publish.backToEditor).click(); cy.pageNo(1); cy.openPropertyPane("textwidget"); cy.testJsontext("text", "{{Table1.pageSize}}"); @@ -44,13 +59,24 @@ describe("Text-Table Binding Functionality", function() { .then(listing => { const listingCount = listing.length.toString(); cy.get(commonlocators.TextInside).should("have.text", listingCount); + cy.PublishtheApp(); + cy.pageNo(1); + cy.get(publish.tableLength) + .find("tr") + .then(listing => { + const listingCountP = listing.length.toString(); + cy.get(commonlocators.TextInside).should( + "have.text", + listingCountP, + ); + }); }); }); it("Text-Table Binding Functionality For Username", function() { + cy.get(publish.backToEditor).click(); /** * @param(Index) Provide index value to select the row. */ - cy.pageNo(1); cy.isSelectRow(1); cy.openPropertyPane("textwidget"); cy.testJsontext("text", "{{Table1.selectedRow.userName}}"); @@ -61,10 +87,15 @@ describe("Text-Table Binding Functionality", function() { cy.readTabledata("1", "2").then(tabData => { const tabValue = tabData; cy.get(commonlocators.TextInside).should("have.text", tabValue); + cy.PublishtheApp(); + cy.isSelectRow(1); + cy.readTabledataPublish("1", "2").then(tabDataP => { + const tabValueP = tabDataP; + cy.get(commonlocators.TextInside).should("have.text", tabValueP); + }); }); }); - afterEach(() => { - // put your clean up code if any - cy.get(commonlocators.editPropCrossButton).click(); - }); +}); +afterEach(() => { + // put your clean up code if any }); diff --git a/app/client/cypress/locators/publishWidgetspage.json b/app/client/cypress/locators/publishWidgetspage.json index 2058e1e408..89512e0367 100644 --- a/app/client/cypress/locators/publishWidgetspage.json +++ b/app/client/cypress/locators/publishWidgetspage.json @@ -1,17 +1,18 @@ { - "buttonWidget": ".t--widget-buttonwidget", - "textWidget": ".t--widget-textwidget", - "richTextEditorWidget": ".t--widget-richtexteditorwidget", - "datepickerWidget": ".t--widget-datepickerwidget", - "backToEditor": ".bp3-icon.bp3-icon-chevron-left", - "inputWidget": ".t--widget-inputwidget", - "checkboxWidget": ".t--widget-checkboxwidget", - "radioWidget": ".t--widget-radiogroupwidget", - "formWidget": ".t--widget-formwidget", - "imageWidget": ".t--widget-imagewidget", - "dropdownWidget": ".t--widget-dropdownwidget", - "tabWidget": ".t--widget-tabswidget", - "chartWidget": ".t--widget-chartwidget", - "horizontalTab": ".t--widget-chartwidget g[class='raphael-group-104-axis-Line-group'] rect", - "tableWidget": ".t--widget-tablewidget" - } \ No newline at end of file + "buttonWidget": ".t--widget-buttonwidget", + "textWidget": ".t--widget-textwidget", + "richTextEditorWidget": ".t--widget-richtexteditorwidget", + "datepickerWidget": ".t--widget-datepickerwidget", + "backToEditor": ".bp3-icon.bp3-icon-chevron-left", + "inputWidget": ".t--widget-inputwidget", + "checkboxWidget": ".t--widget-checkboxwidget", + "radioWidget": ".t--widget-radiogroupwidget", + "formWidget": ".t--widget-formwidget", + "imageWidget": ".t--widget-imagewidget", + "dropdownWidget": ".t--widget-dropdownwidget", + "tabWidget": ".t--widget-tabswidget", + "chartWidget": ".t--widget-chartwidget", + "horizontalTab": ".t--widget-chartwidget g[class='raphael-group-104-axis-Line-group'] rect", + "tableWidget": ".t--widget-tablewidget", + "tableLength": ".t--widget-tablewidget .e-gridcontent.e-lib.e-droppable" +} \ No newline at end of file