Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixes mergeviaremote_spec flakiness #38635

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 3 additions & 2 deletions app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 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/MergeViaRemote_spec.ts

# 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.
Loading