diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js index e935bf114258..269f09da8df1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js @@ -8,6 +8,7 @@ import { gitSync, apiPage, dataSources, + locators, } from "../../../../../support/Objects/ObjectsCore"; import EditorNavigation, { EntityType, @@ -114,9 +115,10 @@ describe( // A switch here should not show a 404 page cy.switchGitBranch(parentBranchKey); + // When entity not found, takes them to the home page PageList.VerifyIsCurrentPage("Page1"); - + cy.wait(2000); EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); PageList.assertAbsence("ChildPage1"); PageLeftPane.switchSegment(PagePaneSegment.Queries); @@ -128,7 +130,7 @@ describe( // rename entities it("3. makes branch specific resource updates", function () { gitSync.SwitchGitBranch(childBranchKey); - EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); + EditorNavigation.NavigateToPage("ParentPage1", true); entityExplorer.RenameEntityFromExplorer( "ParentPage1", "ParentPageRenamed", @@ -181,8 +183,19 @@ describe( "response.body.responseMeta.status", 200, ); - cy.get(".t--page-switch-tab").contains("ParentPage1").click(); - cy.get(".t--widget-tablewidgetv2").should("exist"); + cy.get(".t--page-switch-tab") + .contains("Page1") + .click({ force: true }); + agHelper.AssertElementExist(".t--widget-tablewidgetv2"); + + cy.get(".t--page-switch-tab") + .contains("ParentPage1") + .click({ force: true }); + agHelper.WaitUntilEleDisappear(locators._spinnerHead, 5000); + cy.get(".t--page-switch-tab").each(($el) => { + cy.wrap($el).should("not.have.text", "ChildPage1"); + cy.wrap($el).should("not.have.text", "ParentPageRenamed"); + }); }); }); }); diff --git a/app/client/cypress/limited-tests.txt b/app/client/cypress/limited-tests.txt index 8b8460be7ddb..1581ac02c918 100644 --- a/app/client/cypress/limited-tests.txt +++ b/app/client/cypress/limited-tests.txt @@ -1,7 +1,7 @@ # To run only limited tests - give the spec names in below format: -#cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js +cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js # For running all specs - uncomment below: #cypress/e2e/**/**/* -cypress/e2e/Regression/ClientSide/Anvil/Widgets/* +#cypress/e2e/Regression/ClientSide/Anvil/Widgets/* #ci-test-limit uses this file to run minimum of specs. Do not run entire suite with this command. \ No newline at end of file diff --git a/app/client/cypress/support/Objects/CommonLocators.ts b/app/client/cypress/support/Objects/CommonLocators.ts index f10c896d3b45..77ea343c4588 100644 --- a/app/client/cypress/support/Objects/CommonLocators.ts +++ b/app/client/cypress/support/Objects/CommonLocators.ts @@ -355,4 +355,5 @@ export class CommonLocators { _dropdownActiveOption = ".rc-select-dropdown .rc-select-item-option-active"; _homeIcon = "[data-testid='t--default-home-icon']"; _widget = (widgetName: string) => `.t--widget-${widgetName}`; + _spinnerHead = ".bp3-spinner-head"; } diff --git a/app/client/cypress/support/Pages/PageList.ts b/app/client/cypress/support/Pages/PageList.ts index 5d48942cf12f..13e593fab2c1 100644 --- a/app/client/cypress/support/Pages/PageList.ts +++ b/app/client/cypress/support/Pages/PageList.ts @@ -70,7 +70,7 @@ class PageList { .parent() .attr("data-state"); if (isActive === "closed") { - cy.get(this.locators.switcher).click(); + cy.get(this.locators.switcher).click({ force: true }); } }); }