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

View File

@ -61,11 +61,32 @@ describe("Addwidget from Query and bind with other widgets", function() {
200,
);
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.readTabledataPublish("1", "0").then((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");
cy.log("Verified that JSObject is visible for Public viewing");
});

View File

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

View File

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

View File

@ -4,20 +4,21 @@ const widgetsPage = require("../../../../locators/Widgets.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableNewDsl.json");
const testdata = require("../../../../fixtures/testdata.json");
const publish = require("../../../../locators/publishWidgetspage.json");
describe("Table Widget property pane feature validation", function() {
before(() => {
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
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-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
cy.openPropertyPane("tablewidget");
// 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");
});
it("Test to validate column heading allignment", function() {
it("3. Test to validate column heading allignment", function() {
// cy.openPropertyPane("tablewidget");
// Change the text align to center
cy.get(widgetsPage.centerAlign)
@ -68,7 +69,7 @@ describe("Table Widget property pane feature validation", function() {
.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
cy.get(widgetsPage.bold).click({ force: true });
// 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");
});
it("Test to validate vertical allignment", function() {
it("5. Test to validate vertical allignment", function() {
cy.openPropertyPane("tablewidget");
// Select the top vertical alignment
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");
});
it("Table widget toggle test for text alignment", function() {
it("6. Table widget toggle test for text alignment", function() {
// Click on text align JS
cy.get(widgetsPage.toggleTextAlign)
.first()
@ -121,7 +122,7 @@ describe("Table Widget property pane feature validation", function() {
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
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");
});
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
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 });
// Open email property pane
cy.editColumn("email");
@ -184,70 +185,88 @@ describe("Table Widget property pane feature validation", function() {
cy.get(commonlocators.editPropBackButton).click({ force: true });
});
// it("Edit Row height and test table for changes", function() {
// cy.openPropertyPane("tablewidget");
// cy.get(widgetsPage.rowHeight)
// .last()
// .click({ force: true });
// cy.get(".t--dropdown-option")
// .contains("Short")
// .click({ force: true });
// cy.wait(1000);
// cy.readTabledataValidateCSS("0", "1", "height", "19px", true);
// });
it("10. Edit Row height and test table for changes", function() {
cy.openPropertyPane("tablewidget");
cy.get(widgetsPage.rowHeight)
.last()
.click({ force: true });
cy.get(".t--dropdown-option")
.contains("Short")
.click({ force: true });
cy.wait(2000);
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() {
// // Open property pane
// cy.openPropertyPane("tablewidget");
// // Click on text color input field
// cy.get(widgetsPage.textColor)
// .first()
// .click({ force: true });
// // Select green color
// cy.xpath(widgetsPage.greenColor).click();
// // eslint-disable-next-line cypress/no-unnecessary-waiting
// cy.wait(500);
// cy.wait("@updateLayout");
// // Verify the text color is green
// cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)");
// // Change the text color and enter purple in input field
// cy.get(widgetsPage.textColor)
// .scrollIntoView()
// .clear({ force: true })
// .type("purple", { force: true });
// cy.wait("@updateLayout");
// // Verify the text color is purple
// cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)");
// // Click on cell background color
// cy.get(`${widgetsPage.cellBackground} input`)
// .first()
// .scrollIntoView()
// .click({ force: true });
// // eslint-disable-next-line cypress/no-unnecessary-waiting
// cy.wait(500);
// // select the green color
// cy.xpath(widgetsPage.greenColor)
// .first()
// .click();
// cy.wait("@updateLayout");
// // Verify the cell background color is green
// cy.readTabledataValidateCSS(
// "1",
// "0",
// "background",
// "rgb(3, 179, 101) 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");
// // Verify the cell background color is purple
// cy.readTabledataValidateCSS(
// "1",
// "0",
// "background",
// "rgb(128, 0, 128) none repeat scroll 0% 0% / auto padding-box border-box",
// );
// });
it("11. Test to validate text color and text background", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// Click on text color input field
cy.get(widgetsPage.textColor)
.first()
.click({ force: true });
// Select green color
cy.get(widgetsPage.greenColor)
.last()
.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.wait("@updateLayout");
// Verify the text color is green
cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)");
// Change the text color and enter purple in input field
cy.get(widgetsPage.textColor)
.scrollIntoView()
.clear({ force: true })
.type("purple", { force: true });
cy.wait("@updateLayout");
// Verify the text color is purple
cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)");
// Click on cell background color
cy.get(`${widgetsPage.cellBackground} input`)
.first()
.scrollIntoView()
.click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
// select the green color
cy.get(widgetsPage.greenColor)
.last()
.click();
cy.wait("@updateLayout");
cy.wait(2000);
cy.PublishtheApp();
cy.wait(4000);
// Verify the cell background color is green
cy.readTabledataValidateCSS(
"1",
"1",
"background",
"rgb(3, 179, 101) none repeat scroll 0% 0% / auto padding-box border-box",
);
cy.get(publish.backToEditor).click();
cy.openPropertyPane("tablewidget");
// 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:
// Column Data type: Video
it("Verify default array data", function() {
it("1. Verify default array data", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// Open Widget side bar
@ -31,7 +31,7 @@ describe("Table Widget property pane feature validation", function() {
cy.ClearSearch();
});
it("Verify empty columnName in data", () => {
it("2. Verify empty columnName in data", () => {
cy.get(widgetsPage.addWidget).click();
// Drag and drop table widget
cy.dragAndDropToCanvas("tablewidget", { x: 300, y: 200 });
@ -56,7 +56,7 @@ describe("Table Widget property pane feature validation", function() {
cy.deleteWidget(widgetsPage.tableWidget);
});
it("Verify On Row Selected Action", function() {
it("3. Verify On Row Selected Action", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// 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();
});
it("Check On Page Change Action", function() {
it("4. Check On Page Change Action", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// 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(publish.backToEditor).click();
});
it("Verify On Search Text Change Action", function() {
it("5. Verify On Search Text Change Action", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// Show Message on Search text change Action
@ -97,7 +98,7 @@ describe("Table Widget property pane feature validation", function() {
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");
// 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");
});
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.makeColumnVisible("email");
cy.makeColumnVisible("userName");
@ -208,18 +209,20 @@ describe("Table Widget property pane feature validation", function() {
});
// Changing Column data type from "Date" to "URl"
cy.readTabledataPublish("1", "1").then(() => {
cy.readTabledataPublish("1", "1").then((actualEmail) => {
cy.changeColumnType("URL");
// "Image" to "url"
cy.updateComputedValue(testdata.currentRowEmail);
cy.readTabledataPublish("1", "0", true).then((tabData2) => {
expect(tabData2).not.to.equal("lindsay.ferguson@reqres.in");
cy.readTabledataPublish("1", "0").then((tabData2) => {
expect(tabData2)
.to.equal("lindsay.ferguson@reqres.in")
.to.eq(actualEmail);
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
cy.get(widgetsPage.centerAlign)
.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
cy.get(widgetsPage.bold).click({ force: true });
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");
});
it("Test to validate vertical allignment", function() {
it("10. Test to validate vertical allignment", function() {
// Validate vertical alignemnt of Cell text to TOP
cy.get(widgetsPage.verticalTop).click({ force: 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);
});
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)
.first()
.click({ force: true });
// 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
cy.wait(5000);
cy.wait("@updateLayout");
@ -289,7 +294,9 @@ describe("Table Widget property pane feature validation", function() {
cy.get(widgetsPage.backgroundColor)
.first()
.click({ force: true });
cy.xpath(widgetsPage.greenColor).click();
cy.get(widgetsPage.greenColor)
.last()
.click();
cy.wait("@updateLayout");
cy.readTabledataValidateCSS(
"1",
@ -313,7 +320,7 @@ describe("Table Widget property pane feature validation", function() {
cy.closePropertyPane();
});
it("Verify default search text", function() {
it("12. Verify default search text", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// Chage deat search text value to "data"
@ -324,7 +331,7 @@ describe("Table Widget property pane feature validation", function() {
cy.get(publish.backToEditor).click();
});
it("Verify default selected row", function() {
it("13. Verify default selected row", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
cy.testJsontext("defaultsearchtext", "");
@ -341,7 +348,7 @@ describe("Table Widget property pane feature validation", function() {
cy.get(publish.backToEditor).click();
});
it("Table-Delete Verification", function() {
it("14. Table-Delete Verification", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// Delete the Table widget

View File

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

View File

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

View File

@ -36,7 +36,9 @@ describe("Entity explorer Drag and Drop widgets testcases", function() {
cy.get(widgetsPage.backgroundcolorPickerNew)
.first()
.click({ force: true });
cy.xpath(widgetsPage.greenColor).click();
cy.get(widgetsPage.greenColor)
.last()
.click();
cy.get(formWidgetsPage.formD)
.should("have.css", "background-color")
.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 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() {
before(() => {
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.get(".t--property-control-defaultdate .bp3-input").clear();
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
cy.openPropertyPane("datepickerwidget2");
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();
});
it("Hide Time picker from Datepicker", function() {
it("3. Hide Time picker from Datepicker", function() {
// default value in property pane
cy.openPropertyPane("datepickerwidget2");
@ -64,7 +61,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
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
cy.openPropertyPane("datepickerwidget2");
@ -89,7 +86,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
cy.closePropertyPane();
});
it("Text widgets binding with datepicker", function() {
it("5. Text widgets binding with datepicker", function() {
cy.SearchEntityandOpen("Text1");
cy.testJsontext("text", "{{DatePicker1.formattedDate}}");
cy.closePropertyPane();
@ -98,7 +95,7 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
cy.closePropertyPane();
});
it("Text widgets binding with datepicker", function() {
it("6. Text widgets binding with datepicker", function() {
cy.openPropertyPane("datepickerwidget2");
cy.selectDateFormat("DD/MM/YYYY");
cy.assertDateFormat();
@ -106,8 +103,12 @@ describe("DatePicker Widget Property pane tests with js bindings", function() {
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.get(formWidgetsPage.toggleJsDefaultDate)
.click()
.wait(1000); //disable
cy.get(formWidgetsPage.toggleJsDefaultDate).click(); //enable
cy.testJsontext("defaultdate", `{{moment("1/1/2012")}}`);
cy.get(".t--widget-datepickerwidget2 .bp3-input").should(
"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();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(10000);

View File

@ -48,42 +48,44 @@ describe("Form Widget Functionality", function() {
cy.wait(1000);
cy.get(".t--entity").should("contain", "Form");
});
it("Form Widget Functionality", function() {
// cy.openPropertyPane("formwidget");
// /**
// * @param{Text} Random Text
// * @param{FormWidget}Mouseover
// * @param{FormPre Css} Assertion
// */
// // Change the form name
// cy.widgetText(
// "FormTest",
// formWidgetsPage.formWidget,
// formWidgetsPage.formInner,
// );
// /**
// * @param{Text} Random Colour
// */
// // Change the form background color
// cy.get(widgetsPage.backgroundcolorPicker)
// .first()
// .click({ force: true });
// cy.xpath(widgetsPage.greenColor).click();
// // Verify the form background color
// cy.get(formWidgetsPage.formD)
// .should("have.css", "background-color")
// .and("eq", "rgb(128, 128, 128)");
// /**
// * @param{toggleButton Css} Assert to be checked
// */
// // Check the Scroll and verify
// cy.togglebar(commonlocators.scrollView);
// cy.get(formWidgetsPage.formD)
// .scrollTo("bottom")
// .should("be.visible");
// // Close the form propert pane
// cy.get(commonlocators.editPropCrossButton).click({ force: true });
});
//it("Form Widget Functionality", function() {
// cy.openPropertyPane("formwidget");
// /**
// * @param{Text} Random Text
// * @param{FormWidget}Mouseover
// * @param{FormPre Css} Assertion
// */
// // Change the form name
// cy.widgetText(
// "FormTest",
// formWidgetsPage.formWidget,
// formWidgetsPage.formInner,
// );
// /**
// * @param{Text} Random Colour
// */
// // Change the form background color
// cy.get(widgetsPage.backgroundcolorPicker)
// .first()
// .click({ force: true });
// cy.get(widgetsPage.greenColor).last().click();
// // Verify the form background color
// cy.get(formWidgetsPage.formD)
// .should("have.css", "background-color")
// .and("eq", "rgb(128, 128, 128)");
// /**
// * @param{toggleButton Css} Assert to be checked
// */
// // Check the Scroll and verify
// cy.togglebar(commonlocators.scrollView);
// cy.get(formWidgetsPage.formD)
// .scrollTo("bottom")
// .should("be.visible");
// // Close the form propert pane
// cy.get(commonlocators.editPropCrossButton).click({ force: true });
//});
it("Form Widget Functionality To Verify The Colour", function() {
cy.PublishtheApp();
cy.get(formWidgetsPage.formD)

View File

@ -38,7 +38,9 @@ describe("Container Widget Functionality", function() {
cy.get(widgetsPage.backgroundcolorPickerNew)
.first()
.click({ force: true });
cy.xpath(widgetsPage.greenColor).click();
cy.get(widgetsPage.greenColor)
.last()
.click();
cy.get(widgetsPage.containerD)
.should("have.css", "background-color")
.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() {
cy.dragAndDropToCanvas("textwidget", { x: 100, y: 100 });
cy.get(widgetsPage.textColor)
.first()
.click({ force: true });
cy.xpath(widgetsPage.greenColor).click();
cy.get(widgetsPage.greenColor)
.last()
.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.wait("@updateLayout");

View File

@ -5,7 +5,7 @@ describe("Widget Selection", function() {
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({
ctrlKey: true,
});
@ -25,7 +25,7 @@ describe("Widget Selection", function() {
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
cy.get(`#${dsl.dsl.children[0].widgetId}`).click({
ctrlKey: true,
@ -38,11 +38,8 @@ describe("Widget Selection", function() {
//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-button-${dsl.dsl.children[2].widgetId}`).should(
"have.length",
1,
);
cy.get(`.t-multi-widget-button-${dsl.dsl.children[2].widgetId}`).click({
cy.get(`#${dsl.dsl.children[2].widgetId}`).should("have.length", 1);
cy.get(`#${dsl.dsl.children[2].widgetId}`).click({
force: true,
});

View File

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

View File

@ -3,8 +3,10 @@ const generatePage = require("../../../../locators/GeneratePage.json");
const datasource = require("../../../../locators/DatasourcesEditor.json");
import homePage from "../../../../locators/HomePage";
const explorer = require("../../../../locators/explorerlocators.json");
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
let datasourceName;
const agHelper = new AggregateHelper();
describe("Create a query with a mongo datasource, run, save and then delete the query", function() {
beforeEach(() => {
@ -202,18 +204,16 @@ describe("Create a query with a mongo datasource, run, save and then delete the
"response.body.responseMeta.status",
409,
);
cy.actionContextMenuByEntityName("ListingAndReviews");
//cy.actionContextMenuByEntityName("listingAndReviews");
});
it("9. Bug 7399: Validate Form based & Raw command based templates", function() {
let id;
cy.NavigateToActiveDSQueryPane(datasourceName);
cy.validateNSelectDropdown("Commands", "Find Document(s)");
cy.get(`.t--entity.datasource:contains(${datasourceName})`)
.find(explorer.collapse)
.first()
.click();
cy.xpath(queryLocators.listingAndReviewContext).click({ force: true });
agHelper.expandCollapseEntity(`${datasourceName}`);
cy.xpath(queryLocators.listingAndReviewContext)
.invoke("show")
.click({ force: true });
cy.xpath("//div[text()='Find']")
.click()
.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("Query2");
});
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')]",
"suggestedWidgetChart": ".t--suggested-widget-CHART_WIDGET",
"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",
"backgroundcolorPicker": ".t--property-control-backgroundcolour input",
"backgroundcolorPickerNew": ".t--property-control-backgroundcolor input",
"greenColor": "//div[@color='#03b365']",
"greenColor": "div[color='#03B365']",
"transparent": "//div[@color='transparent']",
"yellowColor": "//div[@color='#FFC13D']",
"blueColor": "//div[@color='#3366FF']",

View File

@ -71,7 +71,7 @@ export class AggregateHelper {
}
public SelectEntityByName(entityNameinLeftSidebar: string) {
cy.xpath(locator._entityNameInExplorer(entityNameinLeftSidebar), {timeout: 30000})
cy.xpath(locator._entityNameInExplorer(entityNameinLeftSidebar), { timeout: 30000 })
.last()
.click({ multiple: true })
this.Sleep()
@ -110,9 +110,15 @@ export class AggregateHelper {
cy.log("Pagename: " + localStorage.getItem("PageName"));
}
public expandCollapseEntity(entityName: string) {
cy.xpath(locator._expandCollapseArrow(entityName))
.click({ multiple: true }).wait(500);
public expandCollapseEntity(entityName: string, expand = true) {
cy.xpath(locator._expandCollapseArrow(entityName)).invoke('attr', 'name').then((arrow) => {
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() {
@ -156,7 +162,7 @@ export class AggregateHelper {
}
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",
timeout: 5000,

View File

@ -1712,16 +1712,6 @@ Cypress.Commands.add("editColumn", (colId) => {
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) => {
cy.get(commonlocators.headingTextStyle).should(
"have.css",
@ -2855,13 +2845,6 @@ Cypress.Commands.add("isSelectRow", (index) => {
.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) => {
const eDate = dayjs()
.add(date, "days")
@ -3058,18 +3041,35 @@ Cypress.Commands.add("getTableDataSelector", (rowNum, colNum) => {
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(
"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 .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}] div ${
!shouldNotGotOneLeveDeeper ? "div" : ""
!shouldNotGoOneLeveDeeper ? "div" : ""
}`;
const tabVal = cy.get(selector).invoke("text");
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(
"readTabledataFromSpecificIndex",
(rowNum, colNum, index) => {