From 36db171a17b856e91987a5f8e8915ce03fc0c9a8 Mon Sep 17 00:00:00 2001 From: Saroj <43822041+sarojsarab@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:07:23 +0530 Subject: [PATCH] test: Fixing Gsheet Tests (#29427) ## Description - Fixing Gsheet Tests due to the latest changes to the page #### Type of change - Cypress ## Testing - [x] Cypress #### QA activity: - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed ## Summary by CodeRabbit - **New Features** - Enhanced the test suite to cover new interactions with the page's left pane, including expanding/collapsing items and generating new pages. - **Refactor** - Simplified the `CreateQueryAfterDSSaved` method by removing the need for a `datasourceName` parameter, indicating a more streamlined process. - **Tests** - Added new end-to-end test cases to validate the functionality of the left pane in the user interface. --- app/client/cypress/e2e/GSheet/Misc_Spec.ts | 5 +++++ app/client/cypress/support/Pages/DataSources.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/client/cypress/e2e/GSheet/Misc_Spec.ts b/app/client/cypress/e2e/GSheet/Misc_Spec.ts index 403678d7ac..d8b0600ce6 100644 --- a/app/client/cypress/e2e/GSheet/Misc_Spec.ts +++ b/app/client/cypress/e2e/GSheet/Misc_Spec.ts @@ -14,6 +14,7 @@ import { import PageList from "../../support/Pages/PageList"; import EditorNavigation, { EntityType, + PageLeftPane, } from "../../support/Pages/EditorNavigation"; const workspaceName = "gsheet apps"; @@ -110,6 +111,10 @@ describe("GSheet Miscellaneous Tests", function () { EditorNavigation.SelectEntityByName(dataSourceName, EntityType.Datasource); // Select the spreadsheet and sheet name + PageLeftPane.expandCollapseItem(spreadSheetName); + PageLeftPane.assertPresence("Sheet1"); + PageLeftPane.expandCollapseItem("Sheet1"); + agHelper.ClickButton("Generate new page"); agHelper.GetNClick(dataSources._selectTableDropdown, 0, true); agHelper.GetNClickByContains(dataSources._dropdownOption, spreadSheetName); agHelper.Sleep(1000); diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index 52708a1d28..eb55fc0b78 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -1808,7 +1808,7 @@ export class DataSources { new RegExp("^" + datasourceName + "$"), ); this.agHelper.WaitUntilEleAppear(this._createQuery); - this.CreateQueryAfterDSSaved(datasourceName); + this.CreateQueryAfterDSSaved(); } public AssertDataSourceInfo(info: string[]) {