Skip to content

Commit

Permalink
chore: fixes mergeviaremote_spec flakiness (appsmithorg#38635)
Browse files Browse the repository at this point in the history
## Description
Fixes flakiness for merge via remote spec

## Automation

/ok-to-test tags="@tag.Git"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/12765495211>
> Commit: 7f83e90
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12765495211&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Git`
> Spec:
> <hr>Tue, 14 Jan 2025 11:18:09 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Tests**
	- Updated Git synchronization test suite for merging changes
	- Modified test file to streamline page creation and merging process
	- Added new test path for Anvil Widgets tests
	- Removed commented test file path and related comment
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
brayn003 authored Jan 14, 2025
1 parent 0a43046 commit 1f6f464
Showing 1 changed file with 13 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,12 @@ import {
} from "../../../../../support/Pages/EditorNavigation";
import PageList from "../../../../../support/Pages/PageList";

let tempBranch = "tempBranch",
tempBranch0 = "tempBranch0",
tempBranch1 = "tempBranch1",
tempBranch2 = "tempBranch2",
tempBranch3 = "tempBranch3";

const buttonNameMainBranch = "buttonMainBranch";
const buttonNameMainBranchEdited = "buttonMainBranchEdited";
const buttonNameTemp0Branch = "buttonTemp0Branch";
const buttonNameTempBranch1 = "buttonTempBranch1";
let tempBranch2 = "tempBranch2";
const mainBranch = "master";

const inputNameTempBranch3 = "inputNameTempBranch3";
const inputNameTempBranch31 = "inputNameTempBranch31";

const cleanUrlBranch = "feat/clean_url";

let applicationId: any;
let applicationName: any;
let repoName: any;
let newPageName: string;

describe(
"Git sync: Merge changes via remote",
Expand All @@ -49,7 +35,6 @@ describe(
cy.get("@guid").then((uid: any) => {
cy.get("@workspaceName").then((workspaceName: any) => {
_.homePage.CreateAppInWorkspace(workspaceName, uid);
applicationName = uid;
cy.get("@applicationId").then(
(currentAppId) => (applicationId = currentAppId),
);
Expand All @@ -62,17 +47,15 @@ describe(
});

it("1. Supports merging head to base branch", function () {
//cy.switchGitBranch(mainBranch);
_.gitSync.CreateGitBranch(tempBranch2, true);
PageLeftPane.switchSegment(PagePaneSegment.UI);
cy.Createpage("NewPage");
cy.commitAndPush();
cy.merge(mainBranch);
_.gitSync.CloseOpsModal();
cy.wait(4000);
cy.switchGitBranch(mainBranch);
cy.wait(4000); // wait for switch branch
cy.contains("NewPage");
PageList.AddNewPage("New blank page")?.then((pageName) => {
newPageName = pageName.toString();
_.gitSync.CommitAndPush();
_.gitSync.MergeToMaster();
_.gitSync.SwitchGitBranch(mainBranch);
PageList.assertPresence(newPageName);
});
});

it("2. Clicking '+' icon on bottom bar should open deploy popup", function () {
Expand All @@ -86,8 +69,7 @@ describe(
});

it("3. Checks clean url updates across branches", () => {
PageList.DeletePage("NewPage");
cy.wait(1000);
PageList.DeletePage(newPageName);
let legacyPathname = "";
let newPathname = "";
// question to qa can we remove this assertion
Expand All @@ -96,7 +78,8 @@ describe(
}).as("appAndPages");
cy.reload();
cy.wait("@getConsolidatedData").then((intercept2) => {
const { application, pages } = intercept2.response.body.data.pages.data;
const { application, pages } =
intercept2?.response?.body?.data?.pages?.data;
const defaultPage = pages.find((p) => p.isDefault);
legacyPathname = `/applications/${application.baseId}/pages/${defaultPage.baseId}`;
newPathname = `/app/${application.slug}/${defaultPage.slug}-${defaultPage.baseId}`;
Expand All @@ -116,7 +99,7 @@ describe(
expect(location.pathname).includes(legacyPathname);
});

cy.switchGitBranch(mainBranch);
_.gitSync.SwitchGitBranch(mainBranch);

cy.get(".t--upgrade").click({ force: true });

Expand Down

0 comments on commit 1f6f464

Please sign in to comment.