From d7a456424137e82f8dd20850fea8c6f9dc57b9d0 Mon Sep 17 00:00:00 2001 From: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:07:44 +0530 Subject: [PATCH] test: Cypress | Api_pane_navigation_spec.ts method reference fix (#26264) ## Description - This PR updates the AssertElementVisibility() references that got missed from a new file --- .../Debugger/Api_pane_navigation_spec.ts | 8 +++++--- .../ClientSide/Linting/BasicLint_spec.ts | 2 +- .../ServerSide/GenerateCRUD/MongoURI_Spec.ts | 2 +- .../ServerSide/GenerateCRUD/MySQL2_Spec.ts | 2 +- .../ServerSide/GenerateCRUD/Postgres2_Spec.ts | 2 +- .../ServerSide/OnLoadTests/JSOnLoad1_Spec.ts | 8 ++++---- .../ServerSide/OnLoadTests/JsOnLoad3_Spec.ts | 14 +++++++------- app/client/cypress/support/Pages/DebuggerHelper.ts | 2 +- app/client/cypress/support/Pages/PropertyPane.ts | 7 +++++-- 9 files changed, 26 insertions(+), 21 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts index 66b43182b9..9cdd291137 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts @@ -26,13 +26,14 @@ describe("excludeForAirgap", "Api pane navigation", () => { debuggerHelper.ClickDebuggerIcon(); debuggerHelper.ClicklogEntityLink(); - agHelper.AssertElementVisible(apiPage._nextCursorValue); + agHelper.AssertElementVisibility(apiPage._nextCursorValue); debuggerHelper.CloseBottomBar(); entityExplorer.ActionContextMenuByEntityName({ entityNameinLeftSidebar: "Api1", entityType: entityItems.Api, }); }); + it("2. Navigation to rest api pagination field", () => { apiPage.CreateApi("Api2"); apiPage.SelectPaneTab("Body"); @@ -49,13 +50,14 @@ describe("excludeForAirgap", "Api pane navigation", () => { debuggerHelper.ClickDebuggerIcon(); debuggerHelper.ClicklogEntityLink(); - agHelper.AssertElementVisible(apiPage._bodyValue(0)); + agHelper.AssertElementVisibility(apiPage._bodyValue(0)); debuggerHelper.CloseBottomBar(); entityExplorer.ActionContextMenuByEntityName({ entityNameinLeftSidebar: "Api2", entityType: entityItems.Api, }); }); + it("3. Navigation to a grapql settings field", () => { apiPage.CreateGraphqlApi("Api3"); apiPage.SelectPaneTab("Settings"); @@ -67,7 +69,7 @@ describe("excludeForAirgap", "Api pane navigation", () => { debuggerHelper.ClickLogsTab(); debuggerHelper.ClicklogEntityLink(true); - agHelper.AssertElementVisible(dataSources._queryTimeout); + agHelper.AssertElementVisibility(dataSources._queryTimeout); debuggerHelper.CloseBottomBar(); entityExplorer.ActionContextMenuByEntityName({ entityNameinLeftSidebar: "Api3", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts index 609511be4b..ab7c354b73 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts @@ -37,7 +37,7 @@ const clickButtonAndAssertLintError = ( //Reload and Check for presence/ absence of lint error agHelper.RefreshPage(); - // agHelper.AssertElementVisible(locators._visibleTextDiv("Explorer")); + // agHelper.AssertElementVisibility(locators._visibleTextDiv("Explorer")); // agHelper.Sleep(2500); entityExplorer.SelectEntityByName("Button1", "Widgets"); shouldExist diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts index ed77a41176..005bd2f19f 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts @@ -106,7 +106,7 @@ describe("Validate Mongo URI CRUD with JSON Form", () => { it("3. Verify Add/Insert from Deploy page - on MongoMart - new record - few validations", () => { agHelper.GetNClick(dataSources._addIcon); agHelper.Sleep(); - //agHelper.AssertElementVisible(locators._jsonFormWidget, 1); //Insert Modal + //agHelper.AssertElementVisibility(locators._jsonFormWidget, 1); //Insert Modal agHelper.AssertElementVisibility( locators._visibleTextDiv("Insert Document"), ); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts index 104a5e44bb..ed3154296e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts @@ -245,7 +245,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { agHelper.GetNClick(dataSources._addIcon); agHelper.Sleep(1000); //time for new Modal to settle - //agHelper.AssertElementVisible(locator._jsonFormWidget, 1); //Insert Modal at index 1 + //agHelper.AssertElementVisibility(locator._jsonFormWidget, 1); //Insert Modal at index 1 agHelper.AssertElementVisibility(locators._visibleTextDiv("Insert Row")); agHelper.ClickButton("Submit"); agHelper.AssertContains("Column 'store_id' cannot be null"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts index 515a43c9b6..d4e6ecb038 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts @@ -450,7 +450,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { agHelper.GetNClick(dataSources._addIcon); agHelper.Sleep(); - //agHelper.AssertElementVisible(locators._jsonFormWidget, 1); //Insert Modal + //agHelper.AssertElementVisibility(locators._jsonFormWidget, 1); //Insert Modal agHelper.AssertElementVisibility(locators._visibleTextDiv("Insert Row")); //Checking Required field validations diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad1_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad1_Spec.ts index 6b7c857bf6..e548567422 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad1_Spec.ts @@ -147,8 +147,8 @@ describe("JSObjects OnLoad Actions tests", function () { it("6. Tc 55 - Verify OnPage Load - Enabling & Before Function calling Enabling for JSOBject & deleting testdata", function () { // deployMode.DeployApp(locators._widgetInDeployed("tablewidget"), false); // agHelper.WaitUntilAllToastsDisappear(); //incase toast appears, GetEmployee failure toast is appearing - // agHelper.AssertElementVisible(jsEditor._dialog("Confirmation dialog")); - // agHelper.AssertElementVisible( + // agHelper.AssertElementVisibility(jsEditor._dialog("Confirmation dialog")); + // agHelper.AssertElementVisibility( // jsEditor._dialogBody((jsName as string) + ".getEmployee"), // ); // jsEditor.ConfirmationClick("Yes"); @@ -159,8 +159,8 @@ describe("JSObjects OnLoad Actions tests", function () { // }); // //agHelper.AssertNetworkExecutionSuccess("@postExecute"); // deployMode.NavigateBacktoEditor(); - // agHelper.AssertElementVisible(jsEditor._dialog("Confirmation dialog")); - // agHelper.AssertElementVisible( + // agHelper.AssertElementVisibility(jsEditor._dialog("Confirmation dialog")); + // agHelper.AssertElementVisibility( // jsEditor._dialogBody((jsName as string) + ".getEmployee"), // ); // jsEditor.ConfirmationClick("Yes"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts index c8706de4ec..f74de2b94e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts @@ -112,7 +112,7 @@ describe("JSObjects OnLoad Actions tests", function () { //Commenting & changnig flow since either of confirmation modals can appear first! // //Confirmation - first JSObj then API - // agHelper.AssertElementVisible( + // agHelper.AssertElementVisibility( // jsEditor._dialogBody((jsName as string) + ".callTrump"), // ); // jsEditor.ConfirmationClick("No"); @@ -123,7 +123,7 @@ describe("JSObjects OnLoad Actions tests", function () { jsEditor.ConfirmationClick("No"); agHelper.AssertContains("cancelled"); //Quotes //One Quotes confirmation - for API true - // agHelper.AssertElementVisible(jsEditor._dialogBody("Quotes")); + // agHelper.AssertElementVisibility(jsEditor._dialogBody("Quotes")); // jsEditor.ConfirmationClick("No"); agHelper.WaitUntilAllToastsDisappear(); @@ -131,14 +131,14 @@ describe("JSObjects OnLoad Actions tests", function () { agHelper.AssertContains("cancelled"); //callTrump // //Another for API called via JS callQuotes() - // agHelper.AssertElementVisible(jsEditor._dialogBody("Quotes")); + // agHelper.AssertElementVisibility(jsEditor._dialogBody("Quotes")); // jsEditor.ConfirmationClick("No"); //agHelper.WaitUntilToastDisappear('The action "Quotes" has failed');No toast appears! agHelper.AssertElementAbsence(jsEditor._dialogBody("WhatTrumpThinks")); //Since JS call is NO, dependent API confirmation should not appear agHelper.RefreshPage("viewPage"); - // agHelper.AssertElementVisible( + // agHelper.AssertElementVisibility( // jsEditor._dialogBody((jsName as string) + ".callTrump"), // ); agHelper.AssertElementExist(jsEditor._dialogInDeployView); @@ -147,17 +147,17 @@ describe("JSObjects OnLoad Actions tests", function () { //agHelper.GetNClick(".ads-v2-button__content-children", 1, true); agHelper.Sleep(2000); - //agHelper.AssertElementVisible(jsEditor._dialogBody("WhatTrumpThinks")); //Since JS call is Yes, dependent confirmation should appear aswell! + //agHelper.AssertElementVisibility(jsEditor._dialogBody("WhatTrumpThinks")); //Since JS call is Yes, dependent confirmation should appear aswell! agHelper.AssertElementExist(jsEditor._dialogInDeployView); jsEditor.ConfirmationClick("Yes"); //trumpy - api agHelper.Sleep(3000); - //agHelper.AssertElementVisible(jsEditor._dialogBody("Quotes")); + //agHelper.AssertElementVisibility(jsEditor._dialogBody("Quotes")); agHelper.AssertElementExist(jsEditor._dialogInDeployView); jsEditor.ConfirmationClick("Yes"); //quotes - api //agHelper.Sleep(2000); - //agHelper.AssertElementVisible(jsEditor._dialogBody("Quotes")); + //agHelper.AssertElementVisibility(jsEditor._dialogBody("Quotes")); //agHelper.AssertElementExist(jsEditor._dialogInDeployView); //agHelper.GetNClick(".ads-v2-button__content-children", 1, true); agHelper.Sleep(4000); //to let the api's call be finished & populate the text fields before validation! diff --git a/app/client/cypress/support/Pages/DebuggerHelper.ts b/app/client/cypress/support/Pages/DebuggerHelper.ts index c1cf63c242..9bfd8b2f17 100644 --- a/app/client/cypress/support/Pages/DebuggerHelper.ts +++ b/app/client/cypress/support/Pages/DebuggerHelper.ts @@ -111,7 +111,7 @@ export class DebuggerHelper { break; // case PageType.Query: // case PageType.DataSources: - // this.agHelper.AssertElementVisible( + // this.agHelper.AssertElementVisibility( // this.locators._bottomPaneContainer[pageType], // ); // // this.agHelper.AssertHeight( diff --git a/app/client/cypress/support/Pages/PropertyPane.ts b/app/client/cypress/support/Pages/PropertyPane.ts index edc21d553d..9d3420afac 100644 --- a/app/client/cypress/support/Pages/PropertyPane.ts +++ b/app/client/cypress/support/Pages/PropertyPane.ts @@ -167,7 +167,7 @@ export class PropertyPane { if (assertElementVisible) { this.agHelper.AssertElementVisibility(this._copyWidget); } - //this.agHelper.AssertElementVisible(this._deleteWidget); //extra valisation, hence commenting! + //this.agHelper.AssertElementVisibility(this._deleteWidget); //extra valisation, hence commenting! } public CopyPasteWidgetFromPropertyPane(widgetName: string) { @@ -528,7 +528,10 @@ export class PropertyPane { } public AssertIfPropertyIsNotVisible(property: string) { - this.agHelper.AssertElementNotVisible(this._propertyControl(property)); + this.agHelper.AssertElementVisibility( + this._propertyControl(property), + false, + ); } public AddAction(property: string) {