From a02fd24c3a1f8395b76182343fb17e826eef61c3 Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Wed, 8 May 2024 11:36:09 +0530 Subject: [PATCH 1/7] gitsynced spec fixes --- .../Git/GitSync/GitSyncedApps_spec.js | 140 +++++------------- app/client/cypress/support/Pages/PageList.ts | 10 ++ app/client/cypress/support/gitSync.js | 2 +- 3 files changed, 46 insertions(+), 106 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js index 357ee4e477d9..c8cc013280ce 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js @@ -2,6 +2,8 @@ import EditorNavigation, { EntityType, PageLeftPane, PagePaneSegment, + AppSidebar, + AppSidebarButton, } from "../../../../../support/Pages/EditorNavigation"; const generatePage = require("../../../../../locators/GeneratePage.json"); @@ -99,7 +101,7 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { cy.get("@gitRepoName").then((repName) => { repoName = repName; }); - table.ReadTableRowColumnData(0, 1).then((cellData) => { + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); // rename page to crud_page @@ -109,20 +111,11 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { false, EntityItems.Page, ); - EditorNavigation.SelectEntityByName(pageName, EntityType.Page); - // create a clone of page - cy.get(`.t--entity-item:contains(${pageName})`).within(() => { - cy.get(".t--context-menu").click({ force: true }); - }); - cy.selectAction("Clone"); + PageList.ClonePage(pageName); - cy.wait("@clonePage").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); + PageList.ShowList(); PageLeftPane.assertPresence(`${pageName} Copy`); - table.ReadTableRowColumnData(0, 1).then((cellData) => { + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); }); @@ -130,10 +123,9 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { it("2. Create api queries from api pane and cURL import , bind it to widget and clone page from page settings", () => { cy.fixture("datasources").then((datasourceFormData) => { cy.Createpage(newPage); - cy.get(`.t--entity-item:contains(${newPage})`).click(); - cy.wait("@getConsolidatedData"); - // create a get api call + EditorNavigation.SelectEntityByName(newPage, EntityType.Page); + // create a get api call apiPage.CreateAndFillApi(datasourceFormData["echoApiUrl"], "get_data"); apiPage.EnterHeader("info", "This is a test"); apiPage.RunAPI(); @@ -172,17 +164,8 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { "will be executed automatically on page load", ); // clone the page from page settings - cy.get(`.t--entity-item:contains(${newPage})`).within(() => { - cy.get(".t--context-menu").click({ force: true }); - }); - cy.selectAction("Clone"); - cy.wait("@clonePage").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); - cy.get(`.t--entity-item:contains(${newPage} Copy)`).click(); - cy.wait("@getConsolidatedData"); + PageList.ClonePage(newPage); + EditorNavigation.SelectEntityByName(newPage, EntityType.Page); }); }); @@ -199,8 +182,9 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { .find(".bp3-input") .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(`.t--entity-item:contains(${newPage})`).first().click(); - cy.wait("@getConsolidatedData"); + + PageList.ShowList(); + EditorNavigation.SelectEntityByName(newPage, EntityType.Page); cy.get(".t--draggable-inputwidgetv2") .first() .find(".bp3-input") @@ -210,34 +194,30 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { .find(".bp3-input") .should("have.value", "This is a test"); - cy.get(`.t--entity-item:contains(${pageName})`).first().click(); - cy.wait("@getConsolidatedData"); - cy.readTabledataPublish("0", "1").then((cellData) => { + PageList.ShowList(); + EditorNavigation.SelectEntityByName(pageName, EntityType.Page); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); - cy.get(`.t--entity-item:contains(${pageName} Copy)`).click(); - cy.wait("@getConsolidatedData"); - cy.readTabledataPublish("0", "1").then((cellData) => { + PageList.ShowList(); + EditorNavigation.SelectEntityByName(`${pageName} Copy`, EntityType.Page); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); // commit and push the changes gitSync.CommitAndPush(true); // verify data binding on all pages in deploy mode cy.latestDeployPreview(); - cy.get(".t--page-switch-tab") - .contains(`${pageName}`) - .click({ force: true }); - cy.readTabledataPublish("0", "1").then((cellData) => { + agHelper.GetNClickByContains(locators._deployedPage, pageName); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); - cy.get(".t--page-switch-tab") - .contains(`${pageName} Copy`) - .click({ force: true }); - cy.readTabledataPublish("0", "1").then((cellData) => { + agHelper.GetNClickByContains(locators._deployedPage, `${pageName} Copy`); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); - cy.get(".t--page-switch-tab").contains(`${newPage}`).click({ force: true }); + agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); agHelper.RefreshPage("getConsolidatedData"); cy.get(".bp3-input") .first() @@ -266,7 +246,6 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { }); it("4. Create a new branch tempBranch, add jsObject and datasource query, move them to new page i.e. Child_Page and bind to widgets", () => { - //cy.createGitBranch(tempBranch); gitSync.CreateGitBranch(tempBranch, true); cy.get("@gitbranchName").then((branName) => { tempBranch = branName; @@ -338,21 +317,15 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { .last() .invoke("val") .should("be.oneOf", ["Success", "Test user 7"]); - cy.get(".t--page-switch-tab") - .contains(`${pageName}`) - .click({ force: true }); - table.WaitUntilTableLoad(); - cy.readTabledataPublish("0", "1").then((cellData) => { + agHelper.GetNClickByContains(locators._deployedPage, `${pageName}`); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); - cy.get(".t--page-switch-tab") - .contains(`${pageName} Copy`) - .click({ force: true }); - table.WaitUntilTableLoad(); - cy.readTabledataPublish("0", "1").then((cellData) => { + agHelper.GetNClickByContains(locators._deployedPage, `${pageName} Copy`); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { expect(cellData).to.be.equal("New Config"); }); - cy.get(".t--page-switch-tab").contains(`${newPage}`).click({ force: true }); + agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); cy.get(".bp3-input") .first() .invoke("val") @@ -361,9 +334,8 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { .last() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(".t--page-switch-tab") - .contains(`${newPage} Copy`) - .click({ force: true }); + + agHelper.GetNClickByContains(locators._deployedPage, `${newPage} Copy`); cy.get(".bp3-input") .first() .invoke("val") @@ -373,46 +345,6 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); deployMode.NavigateBacktoEditor(); - // verfiy data binding on all pages in edit mode - /* cy.get(".t--draggable-inputwidgetv2").first().find(".bp3-input").should("have.value", "morpheus"); - cy.get(".t--draggable-inputwidgetv2") - .last() - .find(".bp3-input") - .should("have.value", "This is a test"); - cy.get(`.t--entity-item:contains(Child_Page)`) - .first() - .click(); - cy.wait("@getPage"); - cy.reload(); - cy.wait(3000); - cy.get(".bp3-input") - .first() - .should("have.value", "Success"); - cy.get(".bp3-input") - .last() - .should("have.value", "Test user 7"); - cy.get(`.t--entity-item:contains(${newPage})`) - .first() - .click(); - cy.wait("@getPage"); - cy.get(".t--draggable-inputwidgetv2").first().find(".bp3-input").should("have.value", "morpheus"); - cy.get(".t--draggable-inputwidgetv2") - .last() - .find(".bp3-input") - .should("have.value", "This is a test"); - - cy.get(`.t--entity-item:contains(${pageName} Copy)`).click(); - cy.wait("@getPage"); - cy.readTabledataPublish("0", "1").then((cellData) => { - expect(cellData).to.be.equal("New Config"); - }); - cy.get(`.t--entity-item:contains(${pageName})`) - .first() - .click(); - cy.wait("@getPage"); - cy.readTabledataPublish("0", "1").then((cellData) => { - expect(cellData).to.be.equal("New Config"); - }); */ }); it("6. Switch to master and verify no uncommitted changes should be shown on master", () => { @@ -432,10 +364,7 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { PageList.ClonePage("Child_Page"); // change cloned page visiblity to hidden EditorNavigation.SelectEntityByName("Child_Page Copy", EntityType.Page); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Child_Page", - action: "Hide", - }); + PageList.HidePage("Child_Page"); EditorNavigation.SelectEntityByName("Child_Page", EntityType.Page); cy.wait("@getConsolidatedData"); @@ -443,8 +372,9 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); cy.get(gitSyncLocators.commitButton).click(); cy.get(gitSyncLocators.closeGitSyncModal).click(); - cy.merge(mainBranch); - cy.get(gitSyncLocators.closeGitSyncModal).click(); + + gitSync.MergeToMaster(); + cy.latestDeployPreview(); // verify page is hidden on deploy mode agHelper.AssertContains("Child_Page Copy", "not.exist"); diff --git a/app/client/cypress/support/Pages/PageList.ts b/app/client/cypress/support/Pages/PageList.ts index f08d4ac520e4..e073cf25b2de 100644 --- a/app/client/cypress/support/Pages/PageList.ts +++ b/app/client/cypress/support/Pages/PageList.ts @@ -112,6 +112,16 @@ class PageList { .should("eq", 200); this.HideList(); } + + public HidePage(pageName = "Page1") { + AppSidebar.navigate(AppSidebarButton.Editor); + EditorNavigation.SelectEntityByName(pageName, EntityType.Page); + ObjectsRegistry.EntityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: pageName, + action: "Hide", + entityType: EntityItems.Page, + }); + } } export default new PageList(); diff --git a/app/client/cypress/support/gitSync.js b/app/client/cypress/support/gitSync.js index 3994de984547..79c25b3d7985 100644 --- a/app/client/cypress/support/gitSync.js +++ b/app/client/cypress/support/gitSync.js @@ -51,7 +51,7 @@ Cypress.Commands.add("latestDeployPreview", () => { window.location.target = "_self"; }); }); - cy.get(gitSyncLocators.bottomBarCommitButton).click(); + agHelper.GetNClick(gitSync._bottomBarCommit); cy.wait(2000); // wait for modal to load cy.xpath("//span[text()='Latest deployed preview']").click(); cy.log("pagename: " + localStorage.getItem("PageName")); From fb27b3bf2878f24adace37a2175b21d4b4e680cf Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Wed, 8 May 2024 13:37:11 +0530 Subject: [PATCH 2/7] default page name added --- app/client/cypress/support/Pages/PageList.ts | 7 +++++-- app/client/src/ce/constants/messages.ts | 2 ++ .../src/pages/Editor/IDE/EditorPane/PagesSection.tsx | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/client/cypress/support/Pages/PageList.ts b/app/client/cypress/support/Pages/PageList.ts index e073cf25b2de..09d94e37ff8e 100644 --- a/app/client/cypress/support/Pages/PageList.ts +++ b/app/client/cypress/support/Pages/PageList.ts @@ -5,6 +5,7 @@ import EditorNavigation, { EntityType, } from "./EditorNavigation"; import { EntityItems } from "./AssertHelper"; +import { PAGE_ENTITY_NAME } from "../../../src/ce/constants/messages"; class PageList { private locators = { @@ -15,6 +16,8 @@ class PageList { switcher: `.t--pages-switcher`, }; + public DefaultPageName = PAGE_ENTITY_NAME + "1"; + public AddNewPage( option: | "New blank page" @@ -50,7 +53,7 @@ class PageList { this.HideList(); } - public ClonePage(pageName = "Page1") { + public ClonePage(pageName = this.DefaultPageName) { AppSidebar.navigate(AppSidebarButton.Editor); EditorNavigation.SelectEntityByName(pageName, EntityType.Page); ObjectsRegistry.EntityExplorer.ActionContextMenuByEntityName({ @@ -113,7 +116,7 @@ class PageList { this.HideList(); } - public HidePage(pageName = "Page1") { + public HidePage(pageName = this.DefaultPageName) { AppSidebar.navigate(AppSidebarButton.Editor); EditorNavigation.SelectEntityByName(pageName, EntityType.Page); ObjectsRegistry.EntityExplorer.ActionContextMenuByEntityName({ diff --git a/app/client/src/ce/constants/messages.ts b/app/client/src/ce/constants/messages.ts index eec5df90ef09..1cea1196df12 100644 --- a/app/client/src/ce/constants/messages.ts +++ b/app/client/src/ce/constants/messages.ts @@ -2498,3 +2498,5 @@ export const EMPTY_CANVAS_HINTS = { export const BETA_TAG = () => `Beta`; export const BUTTON_WIDGET_DEFAULT_LABEL = () => "Do something"; + +export const PAGE_ENTITY_NAME = "Page"; diff --git a/app/client/src/pages/Editor/IDE/EditorPane/PagesSection.tsx b/app/client/src/pages/Editor/IDE/EditorPane/PagesSection.tsx index fe9e115ad942..117381cd764d 100644 --- a/app/client/src/pages/Editor/IDE/EditorPane/PagesSection.tsx +++ b/app/client/src/pages/Editor/IDE/EditorPane/PagesSection.tsx @@ -19,6 +19,7 @@ import { getCurrentWorkspaceId } from "@appsmith/selectors/selectedWorkspaceSele import { getInstanceId } from "@appsmith/selectors/tenantSelectors"; import { PageElement } from "pages/Editor/IDE/EditorPane/components/PageElement"; import { IDEHeaderDropdown } from "IDE"; +import { PAGE_ENTITY_NAME } from "@appsmith/constants/messages"; const PagesSection = ({ onItemSelected }: { onItemSelected: () => void }) => { const dispatch = useDispatch(); @@ -42,7 +43,7 @@ const PagesSection = ({ onItemSelected }: { onItemSelected: () => void }) => { const createPageCallback = useCallback(() => { const name = getNextEntityName( - "Page", + PAGE_ENTITY_NAME, pages.map((page: Page) => page.pageName), ); dispatch( From 060a409c8f66347e6747387c78063ea379821c5a Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Wed, 8 May 2024 14:21:28 +0530 Subject: [PATCH 3/7] using function to create default value --- app/client/cypress/support/Pages/PageList.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/client/cypress/support/Pages/PageList.ts b/app/client/cypress/support/Pages/PageList.ts index 09d94e37ff8e..eda865893992 100644 --- a/app/client/cypress/support/Pages/PageList.ts +++ b/app/client/cypress/support/Pages/PageList.ts @@ -6,7 +6,7 @@ import EditorNavigation, { } from "./EditorNavigation"; import { EntityItems } from "./AssertHelper"; import { PAGE_ENTITY_NAME } from "../../../src/ce/constants/messages"; - +import { getNextEntityName } from "../../../src/utils/AppsmithUtils"; class PageList { private locators = { pageListItem: (pageName: string) => @@ -16,7 +16,7 @@ class PageList { switcher: `.t--pages-switcher`, }; - public DefaultPageName = PAGE_ENTITY_NAME + "1"; + public DefaultPageName = getNextEntityName(PAGE_ENTITY_NAME, []); public AddNewPage( option: From 54e61a588de183128c2660cdf483bc20a18242f9 Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Wed, 8 May 2024 16:49:04 +0530 Subject: [PATCH 4/7] reverted the change --- app/client/cypress/support/Pages/PageList.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/client/cypress/support/Pages/PageList.ts b/app/client/cypress/support/Pages/PageList.ts index eda865893992..2ba5eeffb4d4 100644 --- a/app/client/cypress/support/Pages/PageList.ts +++ b/app/client/cypress/support/Pages/PageList.ts @@ -6,7 +6,6 @@ import EditorNavigation, { } from "./EditorNavigation"; import { EntityItems } from "./AssertHelper"; import { PAGE_ENTITY_NAME } from "../../../src/ce/constants/messages"; -import { getNextEntityName } from "../../../src/utils/AppsmithUtils"; class PageList { private locators = { pageListItem: (pageName: string) => @@ -16,7 +15,7 @@ class PageList { switcher: `.t--pages-switcher`, }; - public DefaultPageName = getNextEntityName(PAGE_ENTITY_NAME, []); + public DefaultPageName = PAGE_ENTITY_NAME + "1"; public AddNewPage( option: From 278afd4d954e8dda88fb0ae7510e04d786cb0ec1 Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Thu, 9 May 2024 11:28:08 +0530 Subject: [PATCH 5/7] committing changes --- .../ClientSide/Git/GitSync/GitSyncedApps_spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js index c8cc013280ce..d100e899e1f6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js @@ -303,7 +303,8 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { it("5. Commit and push changes, validate data binding on all pages in edit and deploy mode on tempBranch", () => { // commit and push changes cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + // cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + agHelper.TypeText(gitSyncLocators.commitCommentInput, "Initial commit"); cy.get(gitSyncLocators.commitButton).click(); cy.get(gitSyncLocators.closeGitSyncModal).click(); // verfiy data binding on all pages in deploy mode @@ -369,7 +370,8 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { EditorNavigation.SelectEntityByName("Child_Page", EntityType.Page); cy.wait("@getConsolidatedData"); cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + // cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + agHelper.TypeText(gitSyncLocators.commitCommentInput, "Initial commit"); cy.get(gitSyncLocators.commitButton).click(); cy.get(gitSyncLocators.closeGitSyncModal).click(); @@ -396,7 +398,8 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { cy.wait("@getConsolidatedData"); PageList.DeletePage("Child_Page Copy"); cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + // cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + agHelper.TypeText(gitSyncLocators.commitCommentInput, "Initial commit"); cy.get(gitSyncLocators.commitButton).click(); cy.get(gitSyncLocators.closeGitSyncModal).click(); cy.merge(mainBranch); From 9036a43b5fb55e941c0092f3655c38e25ade0c3e Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Thu, 9 May 2024 13:01:11 +0530 Subject: [PATCH 6/7] reverting change --- .../ClientSide/Git/GitSync/GitSyncedApps_spec.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js index d100e899e1f6..c8cc013280ce 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js @@ -303,8 +303,7 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { it("5. Commit and push changes, validate data binding on all pages in edit and deploy mode on tempBranch", () => { // commit and push changes cy.get(homePageLocators.publishButton).click(); - // cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - agHelper.TypeText(gitSyncLocators.commitCommentInput, "Initial commit"); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); cy.get(gitSyncLocators.commitButton).click(); cy.get(gitSyncLocators.closeGitSyncModal).click(); // verfiy data binding on all pages in deploy mode @@ -370,8 +369,7 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { EditorNavigation.SelectEntityByName("Child_Page", EntityType.Page); cy.wait("@getConsolidatedData"); cy.get(homePageLocators.publishButton).click(); - // cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - agHelper.TypeText(gitSyncLocators.commitCommentInput, "Initial commit"); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); cy.get(gitSyncLocators.commitButton).click(); cy.get(gitSyncLocators.closeGitSyncModal).click(); @@ -398,8 +396,7 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { cy.wait("@getConsolidatedData"); PageList.DeletePage("Child_Page Copy"); cy.get(homePageLocators.publishButton).click(); - // cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - agHelper.TypeText(gitSyncLocators.commitCommentInput, "Initial commit"); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); cy.get(gitSyncLocators.commitButton).click(); cy.get(gitSyncLocators.closeGitSyncModal).click(); cy.merge(mainBranch); From 7d8517d8c40a1ed37d14641ba23725ac74a15dfb Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Fri, 10 May 2024 10:50:20 +0530 Subject: [PATCH 7/7] PR comment fix --- .../Git/GitSync/GitSyncedApps_spec.js | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js index c8cc013280ce..d46899e99e22 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js @@ -12,6 +12,7 @@ const dynamicInputLocators = require("../../../../../locators/DynamicInput.json" import gitSyncLocators from "../../../../../locators/gitSyncLocators"; import homePageLocators from "../../../../../locators/HomePage"; import datasource from "../../../../../locators/DatasourcesEditor.json"; +import widgetsPage from "../../../../../locators/Widgets.json"; import { agHelper, @@ -171,27 +172,27 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { it("3. Commit and push changes, validate data binding on all pages in edit and deploy mode on master", () => { // verfiy data binding on all pages in edit mode - cy.get(".t--draggable-inputwidgetv2").should("be.visible"); - cy.get(".t--draggable-inputwidgetv2") + cy.get(widgetsPage.inputWidget).should("be.visible"); + cy.get(widgetsPage.inputWidget) .first() - .find(".bp3-input") + .find(widgetsPage.dataclass) .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(".t--draggable-inputwidgetv2") + cy.get(widgetsPage.inputWidget) .last() - .find(".bp3-input") + .find(widgetsPage.dataclass) .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); PageList.ShowList(); EditorNavigation.SelectEntityByName(newPage, EntityType.Page); - cy.get(".t--draggable-inputwidgetv2") + cy.get(widgetsPage.inputWidget) .first() - .find(".bp3-input") + .find(widgetsPage.dataclass) .should("have.value", "morpheus"); - cy.get(".t--draggable-inputwidgetv2") + cy.get(widgetsPage.inputWidget) .last() - .find(".bp3-input") + .find(widgetsPage.dataclass) .should("have.value", "This is a test"); PageList.ShowList(); @@ -219,22 +220,22 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { }); agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); agHelper.RefreshPage("getConsolidatedData"); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .first() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .last() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); cy.get(".t--page-switch-tab") .contains(`${newPage} Copy`) .click({ force: true }); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .first() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .last() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); @@ -308,12 +309,12 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { cy.get(gitSyncLocators.closeGitSyncModal).click(); // verfiy data binding on all pages in deploy mode cy.latestDeployPreview(); - cy.get(".bp3-input").should("be.visible"); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass).should("be.visible"); + cy.get(widgetsPage.dataclass) .first() .invoke("val") .should("be.oneOf", ["Success", "Test user 7"]); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .last() .invoke("val") .should("be.oneOf", ["Success", "Test user 7"]); @@ -326,21 +327,21 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () { expect(cellData).to.be.equal("New Config"); }); agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .first() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .last() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); agHelper.GetNClickByContains(locators._deployedPage, `${newPage} Copy`); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .first() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(".bp3-input") + cy.get(widgetsPage.dataclass) .last() .invoke("val") .should("be.oneOf", ["morpheus", "This is a test"]);