fix(cypress) Catch resizeObserverLoop globally and fix setThemeV2 (#13288)

This commit is contained in:
Chris Collins 2025-04-22 14:12:42 -04:00 committed by GitHub
parent 169c982b4d
commit fa531d70c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 14 deletions

View File

@ -4,7 +4,6 @@ describe("auto-complete", () => {
cy.skipIntroducePage();
cy.hideOnboardingTour();
cy.login();
cy.ignoreResizeObserverLoop();
// look for a dataset
cy.visit("/");
cy.wait(2000);

View File

@ -90,7 +90,6 @@ describe("Verify nested domains test functionalities", () => {
cy.setIsThemeV2Enabled(false);
cy.loginWithCredentials();
cy.goToDomainList();
cy.ignoreResizeObserverLoop();
});
it("Verify Create a new domain", () => {

View File

@ -1,8 +1,4 @@
describe("manage tags", () => {
beforeEach(() => {
cy.ignoreResizeObserverLoop();
});
it("Manage Tags Page - Verify search bar placeholder", () => {
cy.login();
cy.visit("/tags");

View File

@ -9,7 +9,6 @@ const ingestion_source_name = `ingestion source ${number}`;
describe("managing secrets for ingestion creation", () => {
it("create a secret, create ingestion source using a secret, remove a secret", () => {
// Navigate to the manage ingestion page → secrets
cy.ignoreResizeObserverLoop();
cy.loginWithCredentials();
cy.goToIngestionPage();
cy.clickOptionWithText("Secrets");

View File

@ -531,17 +531,22 @@ Cypress.Commands.add("setIsThemeV2Enabled", (isEnabled) => {
res.body.data.appConfig.featureFlags.themeV2Default = isEnabled;
res.body.data.appConfig.featureFlags.showNavBarRedesign = isEnabled;
});
} else if (hasOperationName(req, "getMe")) {
req.alias = "gqlgetMeQuery";
req.on("response", (res) => {
res.body.data.me.corpUser.settings.appearance.showThemeV2 = isEnabled;
});
}
});
});
Cypress.Commands.add("ignoreResizeObserverLoop", () => {
const resizeObserverLoopErrRe = "ResizeObserver loop limit exceeded";
cy.on("uncaught:exception", (err) => {
if (err.message.includes(resizeObserverLoopErrRe)) {
Cypress.on("uncaught:exception", (err) => {
const resizeObserverLoopErrMessage = "ResizeObserver loop limit exceeded";
/* returning false here prevents Cypress from failing the test */
if (err.message.includes(resizeObserverLoopErrMessage)) {
return false;
}
});
});
//