test: Script fixes for Flaky tests (#11653)

* Table_GeneralProp spec fix

* Flakes fixed

* Increased deployed page ele wait timeout

* readTabledataPublish() fix

* readTabledataPublish() updated

* Table specs flaky fix

* Table & Mongo Flaky fixes

* Mongo & Table spec flake fix

* Mongo flaky fix

* Mongo fix

* Table_Generalprop flaky fix

* Greencolor locator update

* expandCollapseEntity() method improved

* Table_generalProp flaky fix

* Datepick2, AddWidget flaky fix

* FLakyfix

* WidgetSelection_spec flaky fix

* Flaky fixes

* Adding GitSync to ignore files

* Removing GitSync from ignore files

* Added wait aft PublishApp
This commit is contained in:
Aishwarya-U-R 2022-03-09 12:05:56 +05:30 committed by GitHub
parent e90b7c5120
commit fb0dc53a83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 292 additions and 230 deletions

View File

@ -9,7 +9,7 @@ describe("Binding the API with pageOnLoad and input Widgets", function() {
cy.addDsl(dsl); cy.addDsl(dsl);
}); });
it("Will load an api on load", function() { it("1. Will load an api on load", function() {
cy.NavigateToAPI_Panel(); cy.NavigateToAPI_Panel();
cy.CreateAPI("PageLoadApi"); cy.CreateAPI("PageLoadApi");
cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods);
@ -20,8 +20,9 @@ describe("Binding the API with pageOnLoad and input Widgets", function() {
cy.reload(); cy.reload();
}); });
it("Input widget updated with deafult data", function() { it("2. Input widget updated with deafult data", function() {
cy.SearchEntityandOpen("Input1"); cy.selectEntityByName("WIDGETS");
cy.selectEntityByName("Input1");
cy.get(widgetsPage.defaultInput).type("3"); cy.get(widgetsPage.defaultInput).type("3");
cy.wait("@updateLayout").should( cy.wait("@updateLayout").should(
@ -35,8 +36,8 @@ describe("Binding the API with pageOnLoad and input Widgets", function() {
.should("contain", "3"); .should("contain", "3");
}); });
it("Binding second input widget with API on PageLoad data and default data from input1 widget ", function() { it("3. Binding second input widget with API on PageLoad data and default data from input1 widget ", function() {
cy.SearchEntityandOpen("Input3"); cy.selectEntityByName("Input3");
cy.get(widgetsPage.defaultInput).type(testdata.pageloadBinding, { cy.get(widgetsPage.defaultInput).type(testdata.pageloadBinding, {
parseSpecialCharSequences: false, parseSpecialCharSequences: false,
}); });

View File

@ -61,11 +61,32 @@ describe("Addwidget from Query and bind with other widgets", function() {
200, 200,
); );
cy.wait(3000); cy.wait(3000);
cy.waitUntil(
() =>
cy
.get(
'.tbody .td[data-rowindex="' +
1 +
'"][data-colindex="' +
0 +
'"]',
{
timeout: 40000,
},
)
.eq(0)
.should("be.visible"),
{
errorMsg: "Table not visible in Public view page",
timeout: 20000,
interval: 1000,
},
).then(() => cy.wait(500));
cy.isSelectRow(1); cy.isSelectRow(1);
cy.readTabledataPublish("1", "0").then((tabData) => { cy.readTabledataPublish("1", "0").then((tabData) => {
let tabValue = tabData; let tabValue = tabData;
cy.log("the value is after Publish: " + tabValue); cy.log("Value in public viewing: " + tabValue);
expect(tabValue).to.be.equal("5"); expect(tabValue).to.be.equal("5");
cy.log("Verified that JSObject is visible for Public viewing"); cy.log("Verified that JSObject is visible for Public viewing");
}); });

View File

@ -1,8 +1,5 @@
const commonlocators = require("../../../../locators/commonlocators.json"); const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const dsl = require("../../../../fixtures/MultipleInput.json"); const dsl = require("../../../../fixtures/MultipleInput.json");
const pages = require("../../../../locators/Pages.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const publish = require("../../../../locators/publishWidgetspage.json"); const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json"); const testdata = require("../../../../fixtures/testdata.json");
@ -17,7 +14,7 @@ describe("Binding the multiple input Widget", function() {
return false; return false;
}); });
it("Cyclic depedancy error message validation", function() { it("1. Cyclic depedancy error message validation", function() {
cy.openPropertyPane("inputwidgetv2"); cy.openPropertyPane("inputwidgetv2");
cy.testJsontext("defaulttext", testdata.defaultMoustacheData + "}}"); cy.testJsontext("defaulttext", testdata.defaultMoustacheData + "}}");
@ -29,7 +26,7 @@ describe("Binding the multiple input Widget", function() {
cy.get(commonlocators.toastmsg).contains("Cyclic dependency"); cy.get(commonlocators.toastmsg).contains("Cyclic dependency");
}); });
it("Binding input widget1 and validating", function() { it("2. Binding input widget1 and validating", function() {
cy.openPropertyPane("inputwidgetv2"); cy.openPropertyPane("inputwidgetv2");
cy.testJsontext("defaulttext", testdata.defaultdata); cy.testJsontext("defaulttext", testdata.defaultdata);
@ -44,8 +41,9 @@ describe("Binding the multiple input Widget", function() {
.should("contain", testdata.defaultdata); .should("contain", testdata.defaultdata);
}); });
it("Binding second input widget with first input widget and validating", function() { it("3. Binding second input widget with first input widget and validating", function() {
cy.SearchEntityandOpen("Input2"); cy.selectEntityByName("WIDGETS");
cy.selectEntityByName("Input2");
cy.testJsontext("defaulttext", testdata.defaultMoustacheData + "}}"); cy.testJsontext("defaulttext", testdata.defaultMoustacheData + "}}");
cy.wait("@updateLayout").should( cy.wait("@updateLayout").should(
@ -56,9 +54,6 @@ describe("Binding the multiple input Widget", function() {
cy.xpath(testdata.input2) cy.xpath(testdata.input2)
.invoke("attr", "value") .invoke("attr", "value")
.should("contain", testdata.defaultdata); .should("contain", testdata.defaultdata);
cy.reload();
/*
cy.PublishtheApp(); cy.PublishtheApp();
cy.get(publish.inputWidget + " " + "input") cy.get(publish.inputWidget + " " + "input")
.first() .first()
@ -70,11 +65,11 @@ describe("Binding the multiple input Widget", function() {
cy.get(publish.backToEditor) cy.get(publish.backToEditor)
.first() .first()
.click(); .click();
*/
}); });
it("Binding third input widget with first input widget and validating", function() { it("4. Binding third input widget with first input widget and validating", function() {
cy.SearchEntityandOpen("Input3"); cy.selectEntityByName("WIDGETS");
cy.selectEntityByName("Input3");
cy.testJsontext("defaulttext", testdata.defaultMoustacheData + "}}"); cy.testJsontext("defaulttext", testdata.defaultMoustacheData + "}}");
cy.wait("@updateLayout").should( cy.wait("@updateLayout").should(

View File

@ -1,3 +1,5 @@
/// <reference types="Cypress" />
const widgetsPage = require("../../../../locators/Widgets.json"); const widgetsPage = require("../../../../locators/Widgets.json");
import homePage from "../../../../locators/HomePage"; import homePage from "../../../../locators/HomePage";
@ -163,10 +165,11 @@ describe("Migration Validate", function() {
() => () =>
cy cy
.xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", {
timeout: 30000, timeout: 50000,
}) })
.eq(0) .eq(0)
.should("contain.text", "State:"), .contains("State:", { timeout: 30000 })
.should("exist"),
{ {
errorMsg: "Execute call did not complete evn after 10 secs", errorMsg: "Execute call did not complete evn after 10 secs",
timeout: 20000, timeout: 20000,
@ -215,7 +218,7 @@ describe("Migration Validate", function() {
// cy.get("div.tableWrap").should("be.visible"); //wait for page load! // cy.get("div.tableWrap").should("be.visible"); //wait for page load!
cy.waitUntil( cy.waitUntil(
() => cy.get("div.tableWrap", { timeout: 30000 }).should("be.visible"), () => cy.get("div.tableWrap", { timeout: 50000 }).should("be.visible"),
{ {
errorMsg: "Page is not loaded evn after 10 secs", errorMsg: "Page is not loaded evn after 10 secs",
timeout: 30000, timeout: 30000,
@ -239,10 +242,11 @@ describe("Migration Validate", function() {
() => () =>
cy cy
.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", { .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
timeout: 30000, timeout: 50000,
}) })
.eq(0) .eq(0)
.should("contain.text", "CreditLimit:"), .contains("CreditLimit:", { timeout: 30000 })
.should("exist"),
{ {
errorMsg: "Execute call did not complete evn after 10 secs", errorMsg: "Execute call did not complete evn after 10 secs",
timeout: 20000, timeout: 20000,
@ -276,10 +280,11 @@ describe("Migration Validate", function() {
() => () =>
cy cy
.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", { .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
timeout: 30000, timeout: 50000,
}) })
.eq(0) .eq(0)
.should("contain.text", "CreditLimit:"), .contains("CreditLimit:", { timeout: 30000 })
.should("exist"),
{ {
errorMsg: "Execute call did not complete evn after 10 secs", errorMsg: "Execute call did not complete evn after 10 secs",
timeout: 20000, timeout: 20000,
@ -341,10 +346,11 @@ describe("Migration Validate", function() {
() => () =>
cy cy
.xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", {
timeout: 30000, timeout: 50000,
}) })
.eq(0) .eq(0)
.should("contain.text", "State:"), .contains("State:", { timeout: 30000 })
.should("exist"),
{ {
errorMsg: "Execute call did not complete evn after 10 secs", errorMsg: "Execute call did not complete evn after 10 secs",
timeout: 20000, timeout: 20000,
@ -393,7 +399,7 @@ describe("Migration Validate", function() {
//cy.get("div.tableWrap").should("be.visible"); //cy.get("div.tableWrap").should("be.visible");
cy.waitUntil( cy.waitUntil(
() => cy.get("div.tableWrap", { timeout: 30000 }).should("be.visible"), () => cy.get("div.tableWrap", { timeout: 50000 }).should("be.visible"),
{ {
errorMsg: "Page is not loaded evn after 10 secs", errorMsg: "Page is not loaded evn after 10 secs",
timeout: 30000, timeout: 30000,
@ -418,10 +424,11 @@ describe("Migration Validate", function() {
() => () =>
cy cy
.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", { .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
timeout: 30000, timeout: 50000,
}) })
.eq(0) .eq(0)
.should("contain.text", "CreditLimit:"), .contains("CreditLimit:", { timeout: 30000 })
.should("exist"),
{ {
errorMsg: "Execute call did not complete evn after 10 secs", errorMsg: "Execute call did not complete evn after 10 secs",
timeout: 20000, timeout: 20000,
@ -455,10 +462,11 @@ describe("Migration Validate", function() {
() => () =>
cy cy
.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", { .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
timeout: 30000, timeout: 50000,
}) })
.eq(0) .eq(0)
.should("contain.text", "CreditLimit:"), .contains("CreditLimit:", { timeout: 30000 })
.should("exist"),
{ {
errorMsg: "Execute call did not complete evn after 10 secs", errorMsg: "Execute call did not complete evn after 10 secs",
timeout: 20000, timeout: 20000,
@ -816,7 +824,7 @@ describe("Migration Validate", function() {
// cy // cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][2]") // .xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(0) // .eq(0)
// .should("contain.text", "State:"), // .contains("State:").should('be.visible'),
// { // {
// errorMsg: "Execute call did not complete evn after 10 secs", // errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000, // timeout: 20000,

View File

@ -4,20 +4,21 @@ const widgetsPage = require("../../../../locators/Widgets.json");
const commonlocators = require("../../../../locators/commonlocators.json"); const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableNewDsl.json"); const dsl = require("../../../../fixtures/tableNewDsl.json");
const testdata = require("../../../../fixtures/testdata.json"); const testdata = require("../../../../fixtures/testdata.json");
const publish = require("../../../../locators/publishWidgetspage.json");
describe("Table Widget property pane feature validation", function() { describe("Table Widget property pane feature validation", function() {
before(() => { before(() => {
cy.addDsl(dsl); cy.addDsl(dsl);
}); });
it("Test to validate table pagination is disabled", function() { it("1. Test to validate table pagination is disabled", function() {
// Verify pagination is disabled // Verify pagination is disabled
cy.get(".t--table-widget-prev-page").should("have.attr", "disabled"); cy.get(".t--table-widget-prev-page").should("have.attr", "disabled");
cy.get(".t--table-widget-next-page").should("have.attr", "disabled"); cy.get(".t--table-widget-next-page").should("have.attr", "disabled");
cy.get(".t--table-widget-page-input input").should("have.attr", "disabled"); cy.get(".t--table-widget-page-input input").should("have.attr", "disabled");
}); });
it("Test to validate text allignment", function() { it("2. Test to validate text allignment", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Change the text align to center // Change the text align to center
@ -40,7 +41,7 @@ describe("Table Widget property pane feature validation", function() {
cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-start"); cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-start");
}); });
it("Test to validate column heading allignment", function() { it("3. Test to validate column heading allignment", function() {
// cy.openPropertyPane("tablewidget"); // cy.openPropertyPane("tablewidget");
// Change the text align to center // Change the text align to center
cy.get(widgetsPage.centerAlign) cy.get(widgetsPage.centerAlign)
@ -68,7 +69,7 @@ describe("Table Widget property pane feature validation", function() {
.should("have.css", "text-align", "left"); .should("have.css", "text-align", "left");
}); });
it("Test to validate text format", function() { it("4. Test to validate text format", function() {
// Select the bold font style // Select the bold font style
cy.get(widgetsPage.bold).click({ force: true }); cy.get(widgetsPage.bold).click({ force: true });
// Varify the font style is bold // Varify the font style is bold
@ -84,7 +85,7 @@ describe("Table Widget property pane feature validation", function() {
cy.readTabledataValidateCSS("1", "0", "text-decoration-line", "underline"); cy.readTabledataValidateCSS("1", "0", "text-decoration-line", "underline");
}); });
it("Test to validate vertical allignment", function() { it("5. Test to validate vertical allignment", function() {
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Select the top vertical alignment // Select the top vertical alignment
cy.get(widgetsPage.verticalTop).click({ force: true }); cy.get(widgetsPage.verticalTop).click({ force: true });
@ -104,7 +105,7 @@ describe("Table Widget property pane feature validation", function() {
cy.readTabledataValidateCSS("1", "0", "align-items", "flex-end"); cy.readTabledataValidateCSS("1", "0", "align-items", "flex-end");
}); });
it("Table widget toggle test for text alignment", function() { it("6. Table widget toggle test for text alignment", function() {
// Click on text align JS // Click on text align JS
cy.get(widgetsPage.toggleTextAlign) cy.get(widgetsPage.toggleTextAlign)
.first() .first()
@ -121,7 +122,7 @@ describe("Table Widget property pane feature validation", function() {
cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-start"); cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-start");
}); });
it("Table widget change text size and validate", function() { it("7. Table widget change text size and validate", function() {
// Verify font size is 14px // Verify font size is 14px
cy.readTabledataValidateCSS("0", "0", "font-size", "14px"); cy.readTabledataValidateCSS("0", "0", "font-size", "14px");
@ -149,7 +150,7 @@ describe("Table Widget property pane feature validation", function() {
cy.readTabledataValidateCSS("0", "0", "font-size", "24px"); cy.readTabledataValidateCSS("0", "0", "font-size", "24px");
}); });
it("Test to validate open new tab icon shows when URL type data validate link text ", function() { it("8. Test to validate open new tab icon shows when URL type data validate link text ", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
@ -173,7 +174,7 @@ describe("Table Widget property pane feature validation", function() {
*/ */
}); });
it("Edit column name and test for table header changes", function() { it("9. Edit column name and test for table header changes", function() {
cy.get(commonlocators.editPropBackButton).click({ force: true }); cy.get(commonlocators.editPropBackButton).click({ force: true });
// Open email property pane // Open email property pane
cy.editColumn("email"); cy.editColumn("email");
@ -184,70 +185,88 @@ describe("Table Widget property pane feature validation", function() {
cy.get(commonlocators.editPropBackButton).click({ force: true }); cy.get(commonlocators.editPropBackButton).click({ force: true });
}); });
// it("Edit Row height and test table for changes", function() { it("10. Edit Row height and test table for changes", function() {
// cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// cy.get(widgetsPage.rowHeight) cy.get(widgetsPage.rowHeight)
// .last() .last()
// .click({ force: true }); .click({ force: true });
// cy.get(".t--dropdown-option") cy.get(".t--dropdown-option")
// .contains("Short") .contains("Short")
// .click({ force: true }); .click({ force: true });
// cy.wait(1000); cy.wait(2000);
// cy.readTabledataValidateCSS("0", "1", "height", "19px", true); cy.PublishtheApp();
// }); cy.readTabledataValidateCSS("0", "1", "height", "19px", true);
cy.get(publish.backToEditor).click();
cy.wait(2000);
});
// it("Test to validate text color and text background", function() { it("11. Test to validate text color and text background", function() {
// // Open property pane // Open property pane
// cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// // Click on text color input field // Click on text color input field
// cy.get(widgetsPage.textColor) cy.get(widgetsPage.textColor)
// .first() .first()
// .click({ force: true }); .click({ force: true });
// // Select green color // Select green color
// cy.xpath(widgetsPage.greenColor).click(); cy.get(widgetsPage.greenColor)
// // eslint-disable-next-line cypress/no-unnecessary-waiting .last()
// cy.wait(500); .click();
// cy.wait("@updateLayout"); // eslint-disable-next-line cypress/no-unnecessary-waiting
// // Verify the text color is green cy.wait(500);
// cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)"); cy.wait("@updateLayout");
// // Change the text color and enter purple in input field // Verify the text color is green
// cy.get(widgetsPage.textColor) cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)");
// .scrollIntoView() // Change the text color and enter purple in input field
// .clear({ force: true }) cy.get(widgetsPage.textColor)
// .type("purple", { force: true }); .scrollIntoView()
// cy.wait("@updateLayout"); .clear({ force: true })
// // Verify the text color is purple .type("purple", { force: true });
// cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)"); cy.wait("@updateLayout");
// // Click on cell background color // Verify the text color is purple
// cy.get(`${widgetsPage.cellBackground} input`) cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)");
// .first() // Click on cell background color
// .scrollIntoView() cy.get(`${widgetsPage.cellBackground} input`)
// .click({ force: true }); .first()
// // eslint-disable-next-line cypress/no-unnecessary-waiting .scrollIntoView()
// cy.wait(500); .click({ force: true });
// // select the green color // eslint-disable-next-line cypress/no-unnecessary-waiting
// cy.xpath(widgetsPage.greenColor) cy.wait(500);
// .first() // select the green color
// .click(); cy.get(widgetsPage.greenColor)
// cy.wait("@updateLayout"); .last()
// // Verify the cell background color is green .click();
// cy.readTabledataValidateCSS( cy.wait("@updateLayout");
// "1", cy.wait(2000);
// "0",
// "background", cy.PublishtheApp();
// "rgb(3, 179, 101) none repeat scroll 0% 0% / auto padding-box border-box", cy.wait(4000);
// );
// // Change the cell background color and enter purple in input field // Verify the cell background color is green
// cy.get(`${widgetsPage.cellBackground} input`) cy.readTabledataValidateCSS(
// .clear({ force: true }) "1",
// .type("purple", { force: true }); "1",
// cy.wait("@updateLayout"); "background",
// // Verify the cell background color is purple "rgb(3, 179, 101) none repeat scroll 0% 0% / auto padding-box border-box",
// cy.readTabledataValidateCSS( );
// "1", cy.get(publish.backToEditor).click();
// "0", cy.openPropertyPane("tablewidget");
// "background",
// "rgb(128, 0, 128) none repeat scroll 0% 0% / auto padding-box border-box", // Change the cell background color and enter purple in input field
// ); cy.get(`${widgetsPage.cellBackground} input`)
// }); .clear({ force: true })
.type("purple", { force: true });
cy.wait("@updateLayout");
cy.wait(2000);
cy.PublishtheApp();
cy.wait(4000);
// Verify the cell background color is purple
cy.readTabledataValidateCSS(
"1",
"1",
"background",
"rgb(128, 0, 128) none repeat scroll 0% 0% / auto padding-box border-box",
);
cy.get(publish.backToEditor).click();
});
}); });

View File

@ -13,7 +13,7 @@ describe("Table Widget property pane feature validation", function() {
// To be done: // To be done:
// Column Data type: Video // Column Data type: Video
it("Verify default array data", function() { it("1. Verify default array data", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Open Widget side bar // Open Widget side bar
@ -31,7 +31,7 @@ describe("Table Widget property pane feature validation", function() {
cy.ClearSearch(); cy.ClearSearch();
}); });
it("Verify empty columnName in data", () => { it("2. Verify empty columnName in data", () => {
cy.get(widgetsPage.addWidget).click(); cy.get(widgetsPage.addWidget).click();
// Drag and drop table widget // Drag and drop table widget
cy.dragAndDropToCanvas("tablewidget", { x: 300, y: 200 }); cy.dragAndDropToCanvas("tablewidget", { x: 300, y: 200 });
@ -56,7 +56,7 @@ describe("Table Widget property pane feature validation", function() {
cy.deleteWidget(widgetsPage.tableWidget); cy.deleteWidget(widgetsPage.tableWidget);
}); });
it("Verify On Row Selected Action", function() { it("3. Verify On Row Selected Action", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Select show message in the "on selected row" dropdown // Select show message in the "on selected row" dropdown
@ -70,7 +70,7 @@ describe("Table Widget property pane feature validation", function() {
cy.get(publish.backToEditor).click(); cy.get(publish.backToEditor).click();
}); });
it("Check On Page Change Action", function() { it("4. Check On Page Change Action", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Select show message in the "on selected row" dropdown // Select show message in the "on selected row" dropdown
@ -83,7 +83,8 @@ describe("Table Widget property pane feature validation", function() {
cy.get(commonlocators.toastmsg).contains("Page Changed"); cy.get(commonlocators.toastmsg).contains("Page Changed");
cy.get(publish.backToEditor).click(); cy.get(publish.backToEditor).click();
}); });
it("Verify On Search Text Change Action", function() {
it("5. Verify On Search Text Change Action", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Show Message on Search text change Action // Show Message on Search text change Action
@ -97,7 +98,7 @@ describe("Table Widget property pane feature validation", function() {
cy.get(publish.backToEditor).click(); cy.get(publish.backToEditor).click();
}); });
it("Check open section and column data in property pane", function() { it("6. Check open section and column data in property pane", function() {
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Validate the columns are visible in the property pane // Validate the columns are visible in the property pane
@ -125,7 +126,7 @@ describe("Table Widget property pane feature validation", function() {
cy.get(".draggable-header:contains('CustomColumn')").should("be.visible"); cy.get(".draggable-header:contains('CustomColumn')").should("be.visible");
}); });
it("Column Detail - Edit column name and validate test for computed value based on column type selected", function() { it("7. Column Detail - Edit column name and validate test for computed value based on column type selected", function() {
cy.wait(1000); cy.wait(1000);
cy.makeColumnVisible("email"); cy.makeColumnVisible("email");
cy.makeColumnVisible("userName"); cy.makeColumnVisible("userName");
@ -208,18 +209,20 @@ describe("Table Widget property pane feature validation", function() {
}); });
// Changing Column data type from "Date" to "URl" // Changing Column data type from "Date" to "URl"
cy.readTabledataPublish("1", "1").then(() => { cy.readTabledataPublish("1", "1").then((actualEmail) => {
cy.changeColumnType("URL"); cy.changeColumnType("URL");
// "Image" to "url" // "Image" to "url"
cy.updateComputedValue(testdata.currentRowEmail); cy.updateComputedValue(testdata.currentRowEmail);
cy.readTabledataPublish("1", "0", true).then((tabData2) => { cy.readTabledataPublish("1", "0").then((tabData2) => {
expect(tabData2).not.to.equal("lindsay.ferguson@reqres.in"); expect(tabData2)
.to.equal("lindsay.ferguson@reqres.in")
.to.eq(actualEmail);
cy.log("computed value of URL is " + tabData2); cy.log("computed value of URL is " + tabData2);
}); });
}); });
}); });
it("Test to validate text allignment", function() { it("8. Test to validate text allignment", function() {
// Verifying Center Alignment // Verifying Center Alignment
cy.get(widgetsPage.centerAlign) cy.get(widgetsPage.centerAlign)
.first() .first()
@ -245,7 +248,7 @@ describe("Table Widget property pane feature validation", function() {
); );
}); });
it("Test to validate text format", function() { it("9. Test to validate text format", function() {
// Validate Bold text // Validate Bold text
cy.get(widgetsPage.bold).click({ force: true }); cy.get(widgetsPage.bold).click({ force: true });
cy.readTabledataValidateCSS("1", "0", "font-weight", "700"); cy.readTabledataValidateCSS("1", "0", "font-weight", "700");
@ -254,7 +257,7 @@ describe("Table Widget property pane feature validation", function() {
cy.readTabledataValidateCSS("0", "0", "font-style", "italic"); cy.readTabledataValidateCSS("0", "0", "font-style", "italic");
}); });
it("Test to validate vertical allignment", function() { it("10. Test to validate vertical allignment", function() {
// Validate vertical alignemnt of Cell text to TOP // Validate vertical alignemnt of Cell text to TOP
cy.get(widgetsPage.verticalTop).click({ force: true }); cy.get(widgetsPage.verticalTop).click({ force: true });
cy.readTabledataValidateCSS("1", "0", "align-items", "flex-start", true); cy.readTabledataValidateCSS("1", "0", "align-items", "flex-start", true);
@ -270,12 +273,14 @@ describe("Table Widget property pane feature validation", function() {
cy.readTabledataValidateCSS("0", "0", "align-items", "flex-end", true); cy.readTabledataValidateCSS("0", "0", "align-items", "flex-end", true);
}); });
it("Test to validate text color and text background", function() { it("11. Test to validate text color and text background", function() {
cy.get(widgetsPage.textColor) cy.get(widgetsPage.textColor)
.first() .first()
.click({ force: true }); .click({ force: true });
// Changing text color to GREEN and validate // Changing text color to GREEN and validate
cy.xpath(widgetsPage.greenColor).click(); cy.get(widgetsPage.greenColor)
.last()
.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting // eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000); cy.wait(5000);
cy.wait("@updateLayout"); cy.wait("@updateLayout");
@ -289,7 +294,9 @@ describe("Table Widget property pane feature validation", function() {
cy.get(widgetsPage.backgroundColor) cy.get(widgetsPage.backgroundColor)
.first() .first()
.click({ force: true }); .click({ force: true });
cy.xpath(widgetsPage.greenColor).click(); cy.get(widgetsPage.greenColor)
.last()
.click();
cy.wait("@updateLayout"); cy.wait("@updateLayout");
cy.readTabledataValidateCSS( cy.readTabledataValidateCSS(
"1", "1",
@ -313,7 +320,7 @@ describe("Table Widget property pane feature validation", function() {
cy.closePropertyPane(); cy.closePropertyPane();
}); });
it("Verify default search text", function() { it("12. Verify default search text", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Chage deat search text value to "data" // Chage deat search text value to "data"
@ -324,7 +331,7 @@ describe("Table Widget property pane feature validation", function() {
cy.get(publish.backToEditor).click(); cy.get(publish.backToEditor).click();
}); });
it("Verify default selected row", function() { it("13. Verify default selected row", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
cy.testJsontext("defaultsearchtext", ""); cy.testJsontext("defaultsearchtext", "");
@ -341,7 +348,7 @@ describe("Table Widget property pane feature validation", function() {
cy.get(publish.backToEditor).click(); cy.get(publish.backToEditor).click();
}); });
it("Table-Delete Verification", function() { it("14. Table-Delete Verification", function() {
// Open property pane // Open property pane
cy.openPropertyPane("tablewidget"); cy.openPropertyPane("tablewidget");
// Delete the Table widget // Delete the Table widget

View File

@ -200,6 +200,9 @@ describe("Table Widget property pane feature validation", function() {
}); });
// validate icon // validate icon
cy.get(".t--widget-tablewidget .tbody .bp3-icon-airplane").should("exist"); cy.get(".t--widget-tablewidget .tbody .bp3-icon-airplane").should("exist");
cy.get(".editable-text-container")
.eq(1)
.click();
// validate label // validate label
cy.contains("Menu button").should("exist"); cy.contains("Menu button").should("exist");

View File

@ -74,7 +74,9 @@ describe("Text Widget color/font/alignment Functionality", function() {
cy.get(widgetsPage.textColor) cy.get(widgetsPage.textColor)
.first() .first()
.click({ force: true }); .click({ force: true });
cy.xpath(widgetsPage.greenColor).click(); cy.get(widgetsPage.greenColor)
.last()
.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting // eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500); cy.wait(500);
cy.wait("@updateLayout"); cy.wait("@updateLayout");
@ -89,8 +91,8 @@ describe("Text Widget color/font/alignment Functionality", function() {
.click({ force: true }); .click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting // eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500); cy.wait(500);
cy.xpath(widgetsPage.greenColor) cy.get(widgetsPage.greenColor)
.first() .last()
.click(); .click();
// eslint-disable-next-line cypress/no-unnecessary-waiting // eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500); cy.wait(500);

View File

@ -36,7 +36,9 @@ describe("Entity explorer Drag and Drop widgets testcases", function() {
cy.get(widgetsPage.backgroundcolorPickerNew) cy.get(widgetsPage.backgroundcolorPickerNew)
.first() .first()
.click({ force: true }); .click({ force: true });
cy.xpath(widgetsPage.greenColor).click(); cy.get(widgetsPage.greenColor)
.last()
.click();
cy.get(formWidgetsPage.formD) cy.get(formWidgetsPage.formD)
.should("have.css", "background-color") .should("have.css", "background-color")
.and("eq", "rgb(3, 179, 101)"); .and("eq", "rgb(3, 179, 101)");

View File

@ -1,15 +1,12 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json"); const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const dsl = require("../../../../fixtures/datePicker2dsl.json"); const dsl = require("../../../../fixtures/datePicker2dsl.json");
const publishPage = require("../../../../locators/publishWidgetspage.json");
const pages = require("../../../../locators/Pages.json");
describe("DatePicker Widget Property pane tests with js bindings", function() { describe("DatePicker Widget Property pane tests with js bindings", function() {
before(() => { before(() => {
cy.addDsl(dsl); cy.addDsl(dsl);
}); });
it("Datepicker default date validation with js binding and default date", function() { it("1. Datepicker default date validation with js binding and default date", function() {
cy.openPropertyPane("datepickerwidget2"); cy.openPropertyPane("datepickerwidget2");
cy.get(".t--property-control-defaultdate .bp3-input").clear(); cy.get(".t--property-control-defaultdate .bp3-input").clear();
cy.get(formWidgetsPage.toggleJsDefaultDate).click(); cy.get(formWidgetsPage.toggleJsDefaultDate).click();
@ -19,7 +16,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
); );
}); });
it("Datepicker default time picker validation by Time precision", function() { it("2. Datepicker default time picker validation by Time precision", function() {
// default value in property pane // default value in property pane
cy.openPropertyPane("datepickerwidget2"); cy.openPropertyPane("datepickerwidget2");
cy.get(".t--property-control-timeprecision span[type='p1']").should( cy.get(".t--property-control-timeprecision span[type='p1']").should(
@ -39,7 +36,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
cy.closePropertyPane(); cy.closePropertyPane();
}); });
it("Hide Time picker from Datepicker", function() { it("3. Hide Time picker from Datepicker", function() {
// default value in property pane // default value in property pane
cy.openPropertyPane("datepickerwidget2"); cy.openPropertyPane("datepickerwidget2");
@ -64,7 +61,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
cy.closePropertyPane(); cy.closePropertyPane();
}); });
it("set second field in time picker for Datepicker", function() { it("4. set second field in time picker for Datepicker", function() {
// default value in property pane // default value in property pane
cy.openPropertyPane("datepickerwidget2"); cy.openPropertyPane("datepickerwidget2");
@ -89,7 +86,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
cy.closePropertyPane(); cy.closePropertyPane();
}); });
it("Text widgets binding with datepicker", function() { it("5. Text widgets binding with datepicker", function() {
cy.SearchEntityandOpen("Text1"); cy.SearchEntityandOpen("Text1");
cy.testJsontext("text", "{{DatePicker1.formattedDate}}"); cy.testJsontext("text", "{{DatePicker1.formattedDate}}");
cy.closePropertyPane(); cy.closePropertyPane();
@ -98,7 +95,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
cy.closePropertyPane(); cy.closePropertyPane();
}); });
it("Text widgets binding with datepicker", function() { it("6. Text widgets binding with datepicker", function() {
cy.openPropertyPane("datepickerwidget2"); cy.openPropertyPane("datepickerwidget2");
cy.selectDateFormat("DD/MM/YYYY"); cy.selectDateFormat("DD/MM/YYYY");
cy.assertDateFormat(); cy.assertDateFormat();
@ -106,8 +103,12 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
cy.assertDateFormat(); cy.assertDateFormat();
}); });
it("Datepicker default date validation with js binding and default date with moment object", function() { it("7. Datepicker default date validation with js binding and default date with moment object", function() {
cy.openPropertyPane("datepickerwidget2"); cy.openPropertyPane("datepickerwidget2");
cy.get(formWidgetsPage.toggleJsDefaultDate)
.click()
.wait(1000); //disable
cy.get(formWidgetsPage.toggleJsDefaultDate).click(); //enable
cy.testJsontext("defaultdate", `{{moment("1/1/2012")}}`); cy.testJsontext("defaultdate", `{{moment("1/1/2012")}}`);
cy.get(".t--widget-datepickerwidget2 .bp3-input").should( cy.get(".t--widget-datepickerwidget2 .bp3-input").should(
"contain.value", "contain.value",
@ -115,7 +116,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
); );
}); });
it("Datepicker default date validation with js binding", function() { it("8. Datepicker default date validation with js binding", function() {
cy.PublishtheApp(); cy.PublishtheApp();
// eslint-disable-next-line cypress/no-unnecessary-waiting // eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(10000); cy.wait(10000);

View File

@ -48,7 +48,8 @@ describe("Form Widget Functionality", function() {
cy.wait(1000); cy.wait(1000);
cy.get(".t--entity").should("contain", "Form"); cy.get(".t--entity").should("contain", "Form");
}); });
it("Form Widget Functionality", function() {
//it("Form Widget Functionality", function() {
// cy.openPropertyPane("formwidget"); // cy.openPropertyPane("formwidget");
// /** // /**
// * @param{Text} Random Text // * @param{Text} Random Text
@ -68,7 +69,7 @@ describe("Form Widget Functionality", function() {
// cy.get(widgetsPage.backgroundcolorPicker) // cy.get(widgetsPage.backgroundcolorPicker)
// .first() // .first()
// .click({ force: true }); // .click({ force: true });
// cy.xpath(widgetsPage.greenColor).click(); // cy.get(widgetsPage.greenColor).last().click();
// // Verify the form background color // // Verify the form background color
// cy.get(formWidgetsPage.formD) // cy.get(formWidgetsPage.formD)
// .should("have.css", "background-color") // .should("have.css", "background-color")
@ -83,7 +84,8 @@ describe("Form Widget Functionality", function() {
// .should("be.visible"); // .should("be.visible");
// // Close the form propert pane // // Close the form propert pane
// cy.get(commonlocators.editPropCrossButton).click({ force: true }); // cy.get(commonlocators.editPropCrossButton).click({ force: true });
}); //});
it("Form Widget Functionality To Verify The Colour", function() { it("Form Widget Functionality To Verify The Colour", function() {
cy.PublishtheApp(); cy.PublishtheApp();
cy.get(formWidgetsPage.formD) cy.get(formWidgetsPage.formD)

View File

@ -38,7 +38,9 @@ describe("Container Widget Functionality", function() {
cy.get(widgetsPage.backgroundcolorPickerNew) cy.get(widgetsPage.backgroundcolorPickerNew)
.first() .first()
.click({ force: true }); .click({ force: true });
cy.xpath(widgetsPage.greenColor).click(); cy.get(widgetsPage.greenColor)
.last()
.click();
cy.get(widgetsPage.containerD) cy.get(widgetsPage.containerD)
.should("have.css", "background-color") .should("have.css", "background-color")
.and("eq", "rgb(3, 179, 101)"); .and("eq", "rgb(3, 179, 101)");

View File

@ -170,11 +170,12 @@ describe("Undo/Redo functionality", function() {
it("checks undo/redo for color picker", function() { it("checks undo/redo for color picker", function() {
cy.dragAndDropToCanvas("textwidget", { x: 100, y: 100 }); cy.dragAndDropToCanvas("textwidget", { x: 100, y: 100 });
cy.get(widgetsPage.textColor) cy.get(widgetsPage.textColor)
.first() .first()
.click({ force: true }); .click({ force: true });
cy.xpath(widgetsPage.greenColor).click(); cy.get(widgetsPage.greenColor)
.last()
.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting // eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500); cy.wait(500);
cy.wait("@updateLayout"); cy.wait("@updateLayout");

View File

@ -5,7 +5,7 @@ describe("Widget Selection", function() {
cy.addDsl(dsl); cy.addDsl(dsl);
}); });
it("Multi Select widgets using cmd + click", function() { it("1. Multi Select widgets using cmd + click", function() {
cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ cy.get(`#${dsl.dsl.children[0].widgetId}`).click({
ctrlKey: true, ctrlKey: true,
}); });
@ -25,7 +25,7 @@ describe("Widget Selection", function() {
cy.get(`.t--multi-selection-box`).should("have.length", 1); cy.get(`.t--multi-selection-box`).should("have.length", 1);
}); });
it("Select widgets using cmd + click and open property pane by clicking on the widget from right side panel", function() { it("2. Select widgets using cmd + click and open property pane by clicking on the widget from right side panel", function() {
// Selection // Selection
cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ cy.get(`#${dsl.dsl.children[0].widgetId}`).click({
ctrlKey: true, ctrlKey: true,
@ -38,11 +38,8 @@ describe("Widget Selection", function() {
//select on one of the widgets from the right side panel //select on one of the widgets from the right side panel
cy.get(`.t-multi-widget-property-pane`).should("have.length", 1); cy.get(`.t-multi-widget-property-pane`).should("have.length", 1);
cy.get(`.t-multi-widget-button-${dsl.dsl.children[2].widgetId}`).should( cy.get(`#${dsl.dsl.children[2].widgetId}`).should("have.length", 1);
"have.length", cy.get(`#${dsl.dsl.children[2].widgetId}`).click({
1,
);
cy.get(`.t-multi-widget-button-${dsl.dsl.children[2].widgetId}`).click({
force: true, force: true,
}); });

View File

@ -19,18 +19,14 @@ describe("Add widget - Postgress DataSource", function() {
.first() .first()
.focus() .focus()
.type("select * from configs"); .type("select * from configs");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.WaitAutoSave(); cy.WaitAutoSave();
cy.runQuery(); cy.runQuery();
cy.get(queryEditor.suggestedTableWidget).click(); cy.get(queryEditor.suggestedTableWidget).click();
//cy.SearchEntityandOpen("Table1"); cy.selectEntityByName("Table1");
cy.selectEntityByName("WIDGETS");
cy.actionContextMenuByEntityName("Table1");
cy.isSelectRow(1); cy.isSelectRow(1);
cy.readTabledataPublish("1", "0").then((tabData) => { cy.readTabledataPublish("1", "0").then((tabData) => {
const tabValue = tabData; cy.log("the value is " + tabData);
expect(tabValue).to.be.equal("5"); expect(tabData).to.be.equal("5");
cy.log("the value is " + tabValue);
}); });
}); });
}); });

View File

@ -3,8 +3,10 @@ const generatePage = require("../../../../locators/GeneratePage.json");
const datasource = require("../../../../locators/DatasourcesEditor.json"); const datasource = require("../../../../locators/DatasourcesEditor.json");
import homePage from "../../../../locators/HomePage"; import homePage from "../../../../locators/HomePage";
const explorer = require("../../../../locators/explorerlocators.json"); const explorer = require("../../../../locators/explorerlocators.json");
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
let datasourceName; let datasourceName;
const agHelper = new AggregateHelper();
describe("Create a query with a mongo datasource, run, save and then delete the query", function() { describe("Create a query with a mongo datasource, run, save and then delete the query", function() {
beforeEach(() => { beforeEach(() => {
@ -202,18 +204,16 @@ describe("Create a query with a mongo datasource, run, save and then delete the
"response.body.responseMeta.status", "response.body.responseMeta.status",
409, 409,
); );
cy.actionContextMenuByEntityName("ListingAndReviews"); //cy.actionContextMenuByEntityName("listingAndReviews");
}); });
it("9. Bug 7399: Validate Form based & Raw command based templates", function() { it("9. Bug 7399: Validate Form based & Raw command based templates", function() {
let id; let id;
cy.NavigateToActiveDSQueryPane(datasourceName); agHelper.expandCollapseEntity(`${datasourceName}`);
cy.validateNSelectDropdown("Commands", "Find Document(s)"); cy.xpath(queryLocators.listingAndReviewContext)
cy.get(`.t--entity.datasource:contains(${datasourceName})`) .invoke("show")
.find(explorer.collapse) .click({ force: true });
.first()
.click();
cy.xpath(queryLocators.listingAndReviewContext).click({ force: true });
cy.xpath("//div[text()='Find']") cy.xpath("//div[text()='Find']")
.click() .click()
.wait(100); //wait for Find form to open .wait(100); //wait for Find form to open
@ -281,7 +281,6 @@ describe("Create a query with a mongo datasource, run, save and then delete the
); );
}); });
cy.actionContextMenuByEntityName("Query1"); cy.actionContextMenuByEntityName("Query1");
cy.actionContextMenuByEntityName("Query2");
}); });
it("10. Delete the datasource after NewPage deletion is success", () => { it("10. Delete the datasource after NewPage deletion is success", () => {

View File

@ -31,5 +31,5 @@
"suggestedWidgetText": "//div[contains(@class, 't--suggested-widget-TEXT_WIDGET')]", "suggestedWidgetText": "//div[contains(@class, 't--suggested-widget-TEXT_WIDGET')]",
"suggestedWidgetChart": ".t--suggested-widget-CHART_WIDGET", "suggestedWidgetChart": ".t--suggested-widget-CHART_WIDGET",
"queryTimeout": "//input[@name='actionConfiguration.timeoutInMillisecond']", "queryTimeout": "//input[@name='actionConfiguration.timeoutInMillisecond']",
"listingAndReviewContext": "//div[text()='listingAndReviews']/ancestor::div/following-sibling::div/div[contains(@class, 'entity-context-menu')]" "listingAndReviewContext": "//div[text()='listingAndReviews']/ancestor::div/following-sibling::div/div[contains(@class, 'entity-context-menu')]//span[text()='Add']"
} }

View File

@ -99,7 +99,7 @@
"boxShadow": ".t--property-control-boxshadow .bp3-button-group", "boxShadow": ".t--property-control-boxshadow .bp3-button-group",
"backgroundcolorPicker": ".t--property-control-backgroundcolour input", "backgroundcolorPicker": ".t--property-control-backgroundcolour input",
"backgroundcolorPickerNew": ".t--property-control-backgroundcolor input", "backgroundcolorPickerNew": ".t--property-control-backgroundcolor input",
"greenColor": "//div[@color='#03b365']", "greenColor": "div[color='#03B365']",
"transparent": "//div[@color='transparent']", "transparent": "//div[@color='transparent']",
"yellowColor": "//div[@color='#FFC13D']", "yellowColor": "//div[@color='#FFC13D']",
"blueColor": "//div[@color='#3366FF']", "blueColor": "//div[@color='#3366FF']",

View File

@ -71,7 +71,7 @@ export class AggregateHelper {
} }
public SelectEntityByName(entityNameinLeftSidebar: string) { public SelectEntityByName(entityNameinLeftSidebar: string) {
cy.xpath(locator._entityNameInExplorer(entityNameinLeftSidebar), {timeout: 30000}) cy.xpath(locator._entityNameInExplorer(entityNameinLeftSidebar), { timeout: 30000 })
.last() .last()
.click({ multiple: true }) .click({ multiple: true })
this.Sleep() this.Sleep()
@ -110,9 +110,15 @@ export class AggregateHelper {
cy.log("Pagename: " + localStorage.getItem("PageName")); cy.log("Pagename: " + localStorage.getItem("PageName"));
} }
public expandCollapseEntity(entityName: string) { public expandCollapseEntity(entityName: string, expand = true) {
cy.xpath(locator._expandCollapseArrow(entityName)) cy.xpath(locator._expandCollapseArrow(entityName)).invoke('attr', 'name').then((arrow) => {
.click({ multiple: true }).wait(500); if (expand && arrow == 'arrow-right')
cy.xpath(locator._expandCollapseArrow(entityName)).click({ multiple: true }).wait(500);
else if (!expand && arrow == 'arrow-down')
cy.xpath(locator._expandCollapseArrow(entityName)).click({ multiple: true }).wait(500);
else
cy.wait(500)
})
} }
public AddNewPage() { public AddNewPage() {
@ -156,7 +162,7 @@ export class AggregateHelper {
} }
public WaitUntilEleAppear(selector: string, timeout = 500) { public WaitUntilEleAppear(selector: string, timeout = 500) {
cy.waitUntil(() => cy.get(selector, { timeout: 30000 }).should("have.length.greaterThan", 0), cy.waitUntil(() => cy.get(selector, { timeout: 50000 }).should("have.length.greaterThan", 0),
{ {
errorMsg: "Element did not appear", errorMsg: "Element did not appear",
timeout: 5000, timeout: 5000,

View File

@ -1712,16 +1712,6 @@ Cypress.Commands.add("editColumn", (colId) => {
cy.wait(1500); cy.wait(1500);
}); });
Cypress.Commands.add(
"readTabledataValidateCSS",
(rowNum, colNum, cssProperty, cssValue, shouldNotGotOneLeveDeeper) => {
const selector = `.t--widget-tablewidget .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}] div ${
!shouldNotGotOneLeveDeeper ? "div" : ""
}`;
cy.get(selector).should("have.css", cssProperty, cssValue);
},
);
Cypress.Commands.add("readTextDataValidateCSS", (cssProperty, cssValue) => { Cypress.Commands.add("readTextDataValidateCSS", (cssProperty, cssValue) => {
cy.get(commonlocators.headingTextStyle).should( cy.get(commonlocators.headingTextStyle).should(
"have.css", "have.css",
@ -2855,13 +2845,6 @@ Cypress.Commands.add("isSelectRow", (index) => {
.click({ force: true }); .click({ force: true });
}); });
Cypress.Commands.add("readTabledata", (rowNum, colNum) => {
// const selector = `.t--draggable-tablewidget .e-gridcontent.e-lib.e-droppable td[index=${rowNum}][aria-colindex=${colNum}]`;
const selector = `.tbody .td[data-rowindex="${rowNum}"][data-colindex="${colNum}"] div div`;
const tabVal = cy.get(selector).invoke("text");
return tabVal;
});
Cypress.Commands.add("getDate", (date, dateFormate) => { Cypress.Commands.add("getDate", (date, dateFormate) => {
const eDate = dayjs() const eDate = dayjs()
.add(date, "days") .add(date, "days")
@ -3058,18 +3041,35 @@ Cypress.Commands.add("getTableDataSelector", (rowNum, colNum) => {
return selector; return selector;
}); });
Cypress.Commands.add("readTabledata", (rowNum, colNum) => {
// const selector = `.t--draggable-tablewidget .e-gridcontent.e-lib.e-droppable td[index=${rowNum}][aria-colindex=${colNum}]`;
const selector = `.tbody .td[data-rowindex="${rowNum}"][data-colindex="${colNum}"] div div`;
const tabVal = cy.get(selector).invoke("text");
return tabVal;
});
Cypress.Commands.add( Cypress.Commands.add(
"readTabledataPublish", "readTabledataPublish",
(rowNum, colNum, shouldNotGotOneLeveDeeper) => { (rowNum, colNum, shouldNotGoOneLeveDeeper) => {
// const selector = `.t--widget-tablewidget .e-gridcontent.e-lib.e-droppable td[index=${rowNum}][aria-colindex=${colNum}]`; // const selector = `.t--widget-tablewidget .e-gridcontent.e-lib.e-droppable td[index=${rowNum}][aria-colindex=${colNum}]`;
const selector = `.t--widget-tablewidget .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}] div ${ const selector = `.t--widget-tablewidget .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}] div ${
!shouldNotGotOneLeveDeeper ? "div" : "" !shouldNotGoOneLeveDeeper ? "div" : ""
}`; }`;
const tabVal = cy.get(selector).invoke("text"); const tabVal = cy.get(selector).invoke("text");
return tabVal; return tabVal;
}, },
); );
Cypress.Commands.add(
"readTabledataValidateCSS",
(rowNum, colNum, cssProperty, cssValue, shouldNotGotOneLeveDeeper) => {
const selector = `.t--widget-tablewidget .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}] div ${
!shouldNotGotOneLeveDeeper ? "div" : ""
}`;
cy.get(selector).should("have.css", cssProperty, cssValue);
},
);
Cypress.Commands.add( Cypress.Commands.add(
"readTabledataFromSpecificIndex", "readTabledataFromSpecificIndex",
(rowNum, colNum, index) => { (rowNum, colNum, index) => {