From d71a873e162bc6cd179ba1c29092b84fc3e8adcb Mon Sep 17 00:00:00 2001 From: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com> Date: Fri, 31 Dec 2021 11:58:47 +0530 Subject: [PATCH] test: Automated tests for Flakiness fixes (#10040) * Bugs #9069, #9201, #6975, #9922 - Scripted * Mongo DS update from Cloud to Localhost * Updating command.js * Ignoring Mongo until Localhost is fixed * S3 fixes * S3 fix * Mongo Cloud to Localhost transition * Bug #6375 scripted * Failure fix * S3 fix + testSaveDs method flow update * Refresh datasource structure script fix * Entity explorer datasource structure script fix * testSaveDs method flow update fixes * testSaveDs method flow update fixes - set 2 * S3, Mongo Skipping cases fix * Custom Chart failure fix * Button-Call-Query Validation case script fix * Confirm run action failure fix * Confirm run action script fix * Dropdown-Call-Query Validation script fix * S3 - Delete icon issue fix * S3 - Delete icon locator updated * actionContextMenuByEntityName method call update * Table widget add new menu button column - rgb fix * Commenting BG color verify - to override flakiness * Mongo skipping script fix * Commenting Cypress.runner.stop() * Removing .skip * Bind_tableApi_spec.js failure fix * Slash command failure fix --- .../Binding/Bind_tableApi_spec.js | 9 ++---- .../Table_Button_Icon_validation_spec.js | 7 ++--- .../FormWidgets/Autocomplete_spec.js | 31 +++++++++---------- app/client/cypress/support/commands.js | 2 +- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js index bc32d9f9a0..29497bedb9 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js @@ -1,9 +1,6 @@ const commonlocators = require("../../../../locators/commonlocators.json"); const dsl = require("../../../../fixtures/tableWidgetDsl.json"); -const pages = require("../../../../locators/Pages.json"); const apiPage = require("../../../../locators/ApiEditor.json"); -const publishPage = require("../../../../locators/publishWidgetspage.json"); -const widgetsPage = require("../../../../locators/Widgets.json"); describe("Test Create Api and Bind to Table widget", function() { let apiData; @@ -11,7 +8,7 @@ describe("Test Create Api and Bind to Table widget", function() { cy.addDsl(dsl); }); - it("Test_Add users api and execute api", function() { + it("1. Test_Add users api and execute api", function() { cy.createAndFillApi(this.data.userApi, "/users"); cy.RunAPI(); cy.get(apiPage.responseBody) @@ -27,7 +24,7 @@ describe("Test Create Api and Bind to Table widget", function() { }); }); - it("Test_Validate the Api data is updated on Table widget", function() { + it("2. Test_Validate the Api data is updated on Table widget", function() { cy.SearchEntityandOpen("Table1"); //cy.openPropertyPane("tablewidget"); cy.testJsontext("tabledata", "{{Api1.data.users}}"); @@ -46,7 +43,7 @@ describe("Test Create Api and Bind to Table widget", function() { cy.get(commonlocators.backToEditor).click(); }); - it("Validate onSearchTextChanged function is called when configured for search text", function() { + it("3. Validate onSearchTextChanged function is called when configured for search text", function() { cy.SearchEntityandOpen("Table1"); cy.get(".t--widget-tablewidget .t--search-input") .first() diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Button_Icon_validation_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Button_Icon_validation_spec.js index 94256c545a..596fd11350 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Button_Icon_validation_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Button_Icon_validation_spec.js @@ -1,11 +1,8 @@ const widgetsPage = require("../../../../locators/Widgets.json"); const commonlocators = require("../../../../locators/commonlocators.json"); -const publish = require("../../../../locators/publishWidgetspage.json"); const dsl = require("../../../../fixtures/tableNewDsl.json"); -const pages = require("../../../../locators/Pages.json"); const testdata = require("../../../../fixtures/testdata.json"); const color = "rgb(151, 0, 0)"; -const newcolor = "rgb(250, 0, 0)"; describe("Table Widget property pane feature validation", function() { before(() => { @@ -77,7 +74,7 @@ describe("Table Widget property pane feature validation", function() { cy.clearPropertyValue(1); }); - it.skip("Table widget column reorder and reload function", function() { + it("Table widget column reorder and reload function", function() { cy.openPropertyPane("tablewidget"); cy.get(commonlocators.editPropBackButton).click({ force: true }); cy.hideColumn("email"); @@ -90,7 +87,7 @@ describe("Table Widget property pane feature validation", function() { cy.reload(); cy.wait(3000); cy.readTabledataPublish("2", "2").then((tabDataNew) => { - expect(tabValue).not.to.be.equal("Tobias Funke"); + expect(tabDataNew).to.be.equal("Tobias Funke"); }); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Autocomplete_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Autocomplete_spec.js index f316c0a7bf..1239a55293 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Autocomplete_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Autocomplete_spec.js @@ -8,23 +8,19 @@ describe("Autocomplete using slash command and mustache tests", function() { it("Slash command and mustache autocomplete validation for button widget", function() { cy.openPropertyPane("buttonwidget"); - cy.testCodeMirror("/"); - cy.get(dynamicInputLocators.input) - .first() - .click({ force: true }) - .then(() => { - cy.get(dynamicInputLocators.hints).should("exist"); - // validates all autocomplete commands on entering / in label field - cy.get(`${dynamicInputLocators.hints} li`) - .eq(1) - .should("have.text", "New Binding"); - cy.get(`${dynamicInputLocators.hints} li`) - .eq(2) - .should("have.text", "Insert Snippet"); - cy.get(`${dynamicInputLocators.hints} li`) - .last() - .should("have.text", "New Datasource"); - }); + cy.testCodeMirror("/").then(() => { + cy.get(dynamicInputLocators.hints).should("exist"); + // validates all autocomplete commands on entering / in label field + cy.get(`${dynamicInputLocators.hints} li`) + .eq(1) + .should("have.text", "New Binding"); + cy.get(`${dynamicInputLocators.hints} li`) + .eq(2) + .should("have.text", "Insert Snippet"); + cy.get(`${dynamicInputLocators.hints} li`) + .last() + .should("have.text", "New Datasource"); + }); cy.get(dynamicInputLocators.input) .first() .click({ force: true }) @@ -81,6 +77,7 @@ describe("Autocomplete using slash command and mustache tests", function() { .should("have.text", "showAlert()"); }); }); + it("Slash command and mustache autocomplete validation for textbox widget", function() { cy.openPropertyPane("textwidget"); cy.testCodeMirror("/"); diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 2404a60cc0..14ebcbb1b3 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -1516,7 +1516,7 @@ Cypress.Commands.add("testJsontext", (endp, value, paste = true) => { }); }); // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1000); + cy.wait(2500); //Allowing time for Evaluate value to capture value }); /**