The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Fix multiple flaky e2e tests (#64728)
Kamil Mielnik6773707b3e73
diff --git a/e2e/test/scenarios/admin-2/people.cy.spec.js b/e2e/test/scenarios/admin-2/people.cy.spec.jsindex b68c5c18153..1716424f26f 100644--- a/e2e/test/scenarios/admin-2/people.cy.spec.js+++ b/e2e/test/scenarios/admin-2/people.cy.spec.js@@ -819,19 +819,16 @@ describe("scenarios > admin > people > group managers", () => {});// Demote myself from being manager- H.popover().within(() => {- cy.icon("arrow_down").eq(0).click();- });+ H.popover().findByLabelText("collection").click();confirmLosingAbilityToManageGroup();+ H.popover().findByLabelText("collection").should("not.exist");// Remove myself from another group- H.popover().within(() => {- cy.findByText("data").click();- });+ H.popover().findByLabelText("data").click();confirmLosingAbilityToManageGroup();// Redirected to the home page- cy.url().should("match", /\/$/);+ cy.location("pathname").should("eq", "/");});});diff --git a/e2e/test/scenarios/admin/admin-reproductions.cy.spec.js b/e2e/test/scenarios/admin/admin-reproductions.cy.spec.jsindex eb69d5a5e94..35cc5a09667 100644--- a/e2e/test/scenarios/admin/admin-reproductions.cy.spec.js+++ b/e2e/test/scenarios/admin/admin-reproductions.cy.spec.js@@ -115,35 +115,38 @@ describe("issue 41765", { tags: "@external" }, () => {});}- it.skip(- "re-syncing a database should invalidate the table cache (metabase#41765)",- { tags: "@flaky" },- () => {- cy.visit("/");+ it("re-syncing a database should invalidate the table cache (metabase#41765)", () => {+ cy.visit("/");+ cy.findByTestId("loading-indicator").should("not.exist");- H.queryWritableDB(- `ALTER TABLE ${TEST_TABLE} ADD ${COLUMN_NAME} text;`,- "postgres",- );+ openWritableDatabaseQuestion();- openWritableDatabaseQuestion();+ H.getNotebookStep("data").button("Pick columns").click();+ H.popover().findByText(COLUMN_DISPLAY_NAME).should("not.exist");- H.getNotebookStep("data").button("Pick columns").click();- H.popover().findByText(COLUMN_DISPLAY_NAME).should("not.exist");+ enterAdmin();- enterAdmin();+ H.appBar().findByText("Databases").click();+ cy.findAllByRole("link").contains(WRITABLE_DB_DISPLAY_NAME).click();- H.appBar().findByText("Databases").click();- cy.findAllByRole("link").contains(WRITABLE_DB_DISPLAY_NAME).click();- cy.button("Sync database schema").click();+ H.queryWritableDB(+ `ALTER TABLE ${TEST_TABLE} ADD ${COLUMN_NAME} text;`,+ "postgres",+ );- exitAdmin();- openWritableDatabaseQuestion();+ cy.button("Sync database schema").click();+ H.waitForSyncToFinish({+ iteration: 0,+ dbId: WRITABLE_DB_ID,+ tableName: TEST_TABLE,+ });++ exitAdmin();+ openWritableDatabaseQuestion();- H.getNotebookStep("data").button("Pick columns").click();- H.popover().findByText(COLUMN_DISPLAY_NAME).should("be.visible");- },- );+ H.getNotebookStep("data").button("Pick columns").click();+ H.popover().findByText(COLUMN_DISPLAY_NAME).should("be.visible");+ });});describe("(metabase#45042)", () => {diff --git a/e2e/test/scenarios/admin/datamodel/reproductions.cy.spec.ts b/e2e/test/scenarios/admin/datamodel/reproductions.cy.spec.tsindex 542e6871822..b529afe8390 100644--- a/e2e/test/scenarios/admin/datamodel/reproductions.cy.spec.ts+++ b/e2e/test/scenarios/admin/datamodel/reproductions.cy.spec.ts@@ -403,68 +403,66 @@ describe("issue 55619", () => {cy.signInAsAdmin();});- it(- "should allow you to change the currency where you can set a semantic type (metabase#55619)",- { tags: "@flaky" },- () => {- cy.log("set a non-default value");- cy.request("PUT", `/api/field/${ORDERS.DISCOUNT}`, {- settings: { currency: "CAD" },- });-- cy.log("data reference - field list");- cy.visit(- `/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}/fields`,- );- H.main().within(() => {- cy.button(/Edit/).click();- cy.findByDisplayValue("Canadian Dollar").click();- });- H.popover().findByText("Euro").click();- H.main().within(() => {- cy.findByDisplayValue("Euro").should("be.visible");- cy.button(/Save/).click();- cy.button(/Edit/).should("be.visible");- });-- cy.log("data reference - field details");- H.main().within(() => {- cy.findByRole("link", { name: /Discount/ }).click();- cy.button(/Edit/).click();- cy.findByDisplayValue("Euro").click();- });- H.popover().findByText("Australian Dollar").click();- H.main().within(() => {- cy.findByDisplayValue("Australian Dollar").should("be.visible");- cy.button(/Save/).click();- cy.button(/Edit/).should("be.visible");- });-- cy.log("model metadata");- H.navigationSidebar().findByText("Models").click();- H.main().within(() => {- cy.findByLabelText("Create a new model").click();- cy.findByText("Use the notebook editor").click();- });- H.entityPickerModal().within(() => {- H.entityPickerModalTab("Tables").click();- cy.findByText("Orders").click();- });- H.runButtonOverlay().click();- cy.findByTestId("editor-tabs-columns-name").click();- H.openColumnOptions("Discount");- cy.findByTestId("sidebar-content")- .findByDisplayValue("Australian Dollar")- .click();- H.popover().findByText("Euro").click();- cy.findByTestId("sidebar-content")- .findByDisplayValue("Euro")- .should("be.visible");- H.datasetEditBar().button("Save").click();- H.modal().button("Save").click();- H.tableHeaderColumn("Discount (€)").should("be.visible");- },- );+ it("should allow you to change the currency where you can set a semantic type (metabase#55619)", () => {+ cy.log("set a non-default value");+ cy.request("PUT", `/api/field/${ORDERS.DISCOUNT}`, {+ settings: { currency: "CAD" },+ });++ cy.log("data reference - field list");+ cy.visit(`/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}/fields`);+ H.main().within(() => {+ cy.button(/Edit/).click();+ cy.findByDisplayValue("Canadian Dollar").click();+ });+ H.popover().findByText("Euro").click();+ H.main().within(() => {+ cy.findByDisplayValue("Euro").should("be.visible");+ cy.button(/Save/).click();+ cy.button(/Edit/).should("be.visible");+ });++ cy.log("data reference - field details");+ H.main().within(() => {+ cy.findByRole("link", { name: /Discount/ }).click();+ cy.button(/Edit/).click();+ cy.findByDisplayValue("Euro").click();+ });+ H.popover().findByText("Australian Dollar").click();+ H.main().within(() => {+ cy.findByDisplayValue("Australian Dollar").should("be.visible");+ cy.button(/Save/).click();+ cy.button(/Edit/).should("be.visible");+ });++ cy.log("model metadata");+ H.navigationSidebar().findByText("Models").click();+ H.main().within(() => {+ cy.findByLabelText("Create a new model").click();+ cy.findByText("Use the notebook editor").click();+ });+ H.entityPickerModal().within(() => {+ H.entityPickerModalTab("Tables").click();+ cy.findByText("Orders").click();+ });+ H.runButtonOverlay().click();+ H.tableInteractive().should("contain", "37.65");+ cy.findByTestId("editor-tabs-columns-name").click();+ H.openColumnOptions("Discount");+ cy.findByTestId("sidebar-content")+ .findByDisplayValue("Australian Dollar")+ .click();+ H.popover().findByText("Euro").click();+ cy.findByTestId("sidebar-content")+ .findByDisplayValue("Euro")+ .should("be.visible");+ H.datasetEditBar().button("Save").click();+ H.modal().button("Save").click();+ H.modal().should("not.exist"); // wait for modal to disappear+ H.queryBuilderHeader().findByText("Orders").should("be.visible"); // wait for qb to turn into view-mode+ cy.findByTestId("loading-indicator").should("not.exist"); // wait for query to complete+ H.tableHeaderColumn("Discount (€)").should("be.visible");+ });});function waitForFieldSyncToFinish(iteration = 0) {diff --git a/e2e/test/scenarios/admin/troubleshooting.cy.spec.js b/e2e/test/scenarios/admin/troubleshooting.cy.spec.jsindex 3f8c642c5b9..8e29f0af8b7 100644--- a/e2e/test/scenarios/admin/troubleshooting.cy.spec.js+++ b/e2e/test/scenarios/admin/troubleshooting.cy.spec.js@@ -51,14 +51,6 @@ describe("issue 14636", () => {const total = 57;const limit = 50;- function shouldNotBeDisabled(selector) {- cy.get(selector).should("be.enabled");- }-- function shouldBeDisabled(selector) {- cy.get(selector).should("be.disabled");- }-/*** @param {Object} payload* @param {(0|1)} payload.page@@ -70,15 +62,14 @@ describe("issue 14636", () => {cy.intercept("GET",`/api/task?limit=${limit}&offset=${offset}&sort_column=started_at&sort_direction=desc`,- (req) => {- req.reply((res) => {- res.body = {- data: stubPageRows(page),- limit,- offset,- total,- };- });+ {+ status: 200,+ body: {+ data: stubPageRows(page),+ limit,+ offset,+ total,+ },},).as(alias);}@@ -130,7 +121,7 @@ describe("issue 14636", () => {stubPageResponses({ page: 1, alias: "second" });});- it("pagination should work (metabase#14636)", { tags: "@flaky" }, () => {+ it("pagination should work (metabase#14636)", () => {cy.visit("/admin/tools/tasks");cy.wait("@first");@@ -138,8 +129,6 @@ describe("issue 14636", () => {// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usagecy.findByText("Troubleshooting logs");- cy.findByLabelText("Previous page").as("previous");- cy.findByLabelText("Next page").as("next");cy.findByLabelText("pagination").findByText("1 - 50").should("be.visible");// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage@@ -147,10 +136,8 @@ describe("issue 14636", () => {// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usagecy.contains("513");- shouldBeDisabled("@previous");- shouldNotBeDisabled("@next");-- cy.get("@next").click();+ cy.findByLabelText("Previous page").should("be.disabled");+ cy.findByLabelText("Next page").should("not.be.disabled").click();cy.wait("@second");cy.location("search").should("eq", "?page=1");@@ -164,10 +151,8 @@ describe("issue 14636", () => {// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usagecy.contains("200");- shouldNotBeDisabled("@previous");- shouldBeDisabled("@next");-- cy.get("@previous").click();+ cy.findByLabelText("Next page").should("be.disabled");+ cy.findByLabelText("Previous page").should("not.be.disabled").click();cy.location("search").should("eq", "");diff --git a/e2e/test/scenarios/collections/uploads.cy.spec.js b/e2e/test/scenarios/collections/uploads.cy.spec.jsindex f4f07acc4e1..c62661e231a 100644--- a/e2e/test/scenarios/collections/uploads.cy.spec.js+++ b/e2e/test/scenarios/collections/uploads.cy.spec.js@@ -15,84 +15,87 @@ H.describeWithSnowplow(cy.intercept("POST", "/api/table/*/replace-csv").as("replaceCSV");});- it(- "Can upload a CSV file to an empty postgres schema",- { tags: "@flaky" },- () => {- const testFile = VALID_CSV_FILES[0];- const EMPTY_SCHEMA_NAME = "empty_uploads";+ it("Can upload a CSV file to an empty postgres schema", () => {+ const testFile = VALID_CSV_FILES[0];+ const EMPTY_SCHEMA_NAME = "empty_uploads";- cy.intercept("PUT", "/api/setting/*").as("saveSettings");- cy.intercept("GET", "/api/database").as("databaseList");+ cy.intercept("PUT", "/api/setting/*").as("saveSettings");+ cy.intercept("GET", "/api/database").as("databaseList");- H.restore("postgres-writable");- cy.signInAsAdmin();-- H.queryWritableDB(- "DROP SCHEMA IF EXISTS empty_uploads CASCADE;",- "postgres",- );- H.queryWritableDB(- "CREATE SCHEMA IF NOT EXISTS empty_uploads;",- "postgres",- );+ H.restore("postgres-writable");+ cy.signInAsAdmin();- cy.request("POST", "/api/collection", {- name: "Uploads Collection",- parent_id: null,- }).then(({ body: { id: collectionId } }) => {- cy.wrap(collectionId).as("collectionId");- });- cy.visit("/admin/settings/uploads");+ H.queryWritableDB(+ "DROP SCHEMA IF EXISTS empty_uploads CASCADE;",+ "postgres",+ );+ H.queryWritableDB(+ "CREATE SCHEMA IF NOT EXISTS empty_uploads;",+ "postgres",+ );+ // create a table because H.resyncDatabase has a check relying on tables count > 0+ H.queryWritableDB(+ "CREATE TABLE empty_uploads.empty_table ();",+ "postgres",+ );+ // Make sure to resync the db because otherwise "public" schema sometimes is there but sometimes is not+ H.resyncDatabase({ dbId: WRITABLE_DB_ID });++ cy.request("POST", "/api/collection", {+ name: "Uploads Collection",+ parent_id: null,+ }).then(({ body: { id: collectionId } }) => {+ cy.wrap(collectionId).as("collectionId");+ });+ cy.visit("/admin/settings/uploads");+ cy.findByTestId("loading-indicator").should("not.exist");- cy.findByLabelText("Upload Settings Form")- .findByPlaceholderText("Select a database")- .click();- H.popover().findByText("Writable Postgres12").click();- cy.findByLabelText("Upload Settings Form")- .findByPlaceholderText("Select a schema")- .click();+ cy.findByLabelText("Upload Settings Form")+ .findByPlaceholderText("Select a database")+ .click();+ H.popover().findByText("Writable Postgres12").click();+ cy.findByLabelText("Upload Settings Form")+ .findByPlaceholderText("Select a schema")+ .click();- H.popover().findByText(EMPTY_SCHEMA_NAME).click();+ H.popover().findByText(EMPTY_SCHEMA_NAME).click();- cy.findByLabelText("Upload Settings Form")- .button("Enable uploads")- .click();+ cy.findByLabelText("Upload Settings Form")+ .button("Enable uploads")+ .click();- cy.wait(["@saveSettings", "@databaseList"]);+ cy.wait(["@saveSettings", "@databaseList"]);- uploadFileToCollection(testFile);+ uploadFileToCollection(testFile);- const tableQuery = `SELECT * FROM information_schema.tables WHERE table_name LIKE '%${testFile.tableName}_%' ORDER BY table_name DESC LIMIT 1;`;+ const tableQuery = `SELECT * FROM information_schema.tables WHERE table_name LIKE '%${testFile.tableName}_%' ORDER BY table_name DESC LIMIT 1;`;- H.queryWritableDB(tableQuery, "postgres").then((result) => {- expect(result.rows.length).to.equal(1);- const tableName = result.rows[0].table_name;- H.queryWritableDB(- `SELECT count(*) FROM ${EMPTY_SCHEMA_NAME}.${tableName};`,- "postgres",- ).then((result) => {- expect(Number(result.rows[0].count)).to.equal(testFile.rowCount);- });+ H.queryWritableDB(tableQuery, "postgres").then((result) => {+ expect(result.rows.length).to.equal(1);+ const tableName = result.rows[0].table_name;+ H.queryWritableDB(+ `SELECT count(*) FROM ${EMPTY_SCHEMA_NAME}.${tableName};`,+ "postgres",+ ).then((result) => {+ expect(Number(result.rows[0].count)).to.equal(testFile.rowCount);});+ });- cy.log(- "Ensure that table is visible in admin without refreshing (metabase#38041)",- );+ cy.log(+ "Ensure that table is visible in admin without refreshing (metabase#38041)",+ );- cy.findByTestId("app-bar")- .findByRole("button", { name: "Settings" })- .click();- H.popover().findByText("Admin settings").click();+ cy.findByTestId("app-bar")+ .findByRole("button", { name: "Settings" })+ .click();+ H.popover().findByText("Admin settings").click();- cy.findByRole("link", { name: "Table Metadata" }).click();+ cy.findByRole("link", { name: "Table Metadata" }).click();- H.DataModel.TablePicker.getDatabase("Writable Postgres12").click();- H.DataModel.TablePicker.getSchema(EMPTY_SCHEMA_NAME).click();- H.DataModel.TablePicker.getTables().should("have.length", 1);- H.DataModel.TablePicker.getTable("Dog Breeds").should("be.visible");- },- );+ H.DataModel.TablePicker.getDatabase("Writable Postgres12").click();+ H.DataModel.TablePicker.getTables().should("have.length", 2);+ H.DataModel.TablePicker.getTable("Dog Breeds").should("be.visible");+ });["postgres", "mysql"].forEach((dialect) => {describe(`CSV Uploading (${dialect})`, () => {diff --git a/e2e/test/scenarios/dashboard/dashboard.cy.spec.js b/e2e/test/scenarios/dashboard/dashboard.cy.spec.jsindex 2c1506aef67..bf2344f09c4 100644--- a/e2e/test/scenarios/dashboard/dashboard.cy.spec.js+++ b/e2e/test/scenarios/dashboard/dashboard.cy.spec.js@@ -25,6 +25,12 @@ import {const { ORDERS, ORDERS_ID, PRODUCTS, PEOPLE, PEOPLE_ID } = SAMPLE_DATABASE;+// There's a race condition when saving a dashboard+// and then immediately editing it again. After saving,+// we exit the edit mode and that can happen after+// `H.editDashboard` is called for some reason+const DASHBOARD_SAVE_WAIT_TIME = 450;+describe("scenarios > dashboard", () => {beforeEach(() => {H.restore();@@ -1238,13 +1244,14 @@ describe("scenarios > dashboard", () => {cy.findByTestId("dashcard").findByText("Orders");});- describe("warn before leave", { tags: "@flaky" }, () => {+ describe("warn before leave", () => {beforeEach(() => {cy.intercept("GET", "/api/card/*/query_metadata").as("queryMetadata");});it("should warn a user before leaving after adding, editing, or removing a card on a dashboard", () => {cy.visit("/");+ cy.findByTestId("loading-indicator").should("not.exist");cy.findByTestId("home-page").should("contain",@@ -1267,7 +1274,7 @@ describe("scenarios > dashboard", () => {.eq(0);dragOnXAxis(card(), 100);assertPreventLeave();- H.saveDashboard();+ H.saveDashboard({ waitMs: DASHBOARD_SAVE_WAIT_TIME });// removeH.editDashboard();@@ -1275,8 +1282,9 @@ describe("scenarios > dashboard", () => {assertPreventLeave();});- it("should warn a user before leaving after adding, removed, moving, or duplicating a tab", () => {+ it("should warn a user before leaving after adding, removing, moving, or duplicating a tab", () => {cy.visit("/");+ cy.findByTestId("loading-indicator").should("not.exist");// add tabcreateNewDashboard();@@ -1314,7 +1322,7 @@ describe("scenarios > dashboard", () => {// can be a side effectcy.url().should("include", "tab-1");assertPreventLeave();- H.saveDashboard({ waitMs: 100 });+ H.saveDashboard({ waitMs: DASHBOARD_SAVE_WAIT_TIME });// rename tabH.editDashboard();diff --git a/e2e/test/scenarios/dashboard/visualizer/basics.cy.spec.ts b/e2e/test/scenarios/dashboard/visualizer/basics.cy.spec.tsindex bc5dc1a9185..504915fd742 100644--- a/e2e/test/scenarios/dashboard/visualizer/basics.cy.spec.ts+++ b/e2e/test/scenarios/dashboard/visualizer/basics.cy.spec.ts@@ -224,8 +224,12 @@ describe("scenarios > dashboard > visualizer > basics", () => {H.modal().button("Save").should("be.disabled");});- it("should allow clicking on the title", { tags: "@flaky" }, () => {+ it("should allow clicking on the title", () => {createDashboardWithVisualizerDashcards();+ cy.findByTestId("loading-indicator").should("not.exist");+ H.getDashboardCard(0).within(() => {+ H.chartGridLines().should("exist"); // wait for charts to load to prevent flakiness+ });// Click on both series of the first chart// Series 1diff --git a/e2e/test/scenarios/dashboard/visualizer/drillthrough.cy.spec.ts b/e2e/test/scenarios/dashboard/visualizer/drillthrough.cy.spec.tsindex ccc4fbef0fe..5974e70a9aa 100644--- a/e2e/test/scenarios/dashboard/visualizer/drillthrough.cy.spec.ts+++ b/e2e/test/scenarios/dashboard/visualizer/drillthrough.cy.spec.ts@@ -66,7 +66,7 @@ describe("scenarios > dashboard > visualizer > drillthrough", () => {});});- it("should work", { tags: "@flaky" }, () => {+ it("should work", () => {createDashboardWithVisualizerDashcards();const ORDERS_SERIES_COLOR = "#88BF4D";@@ -181,7 +181,7 @@ describe("scenarios > dashboard > visualizer > drillthrough", () => {// 4. Funnel (regular)H.getDashboardCard(4).get("polygon").first().click();- cy.wait(200); // HACK: wait for popover to appear+ H.tooltip().should("not.exist");H.clickActionsPopover().button("=").click();cy.wait("@dataset");@@ -194,7 +194,7 @@ describe("scenarios > dashboard > visualizer > drillthrough", () => {// 5. Funnel (scalar)H.getDashboardCard(5).get("polygon").first().click();- cy.wait(200); // HACK: wait for popover to appear+ H.tooltip().should("not.exist");H.clickActionsPopover().button("=").click();cy.wait("@dataset");diff --git a/e2e/test/scenarios/question-reproductions/reproductions-2.cy.spec.js b/e2e/test/scenarios/question-reproductions/reproductions-2.cy.spec.jsindex 2ad1cf6e932..e8192e5646c 100644--- a/e2e/test/scenarios/question-reproductions/reproductions-2.cy.spec.js+++ b/e2e/test/scenarios/question-reproductions/reproductions-2.cy.spec.js@@ -631,38 +631,58 @@ describe("issue 43216", () => {});});- it(- "should update source question metadata when it changes (metabase#43216)",- { tags: "@flaky" },- () => {- cy.visit("/");-- cy.log("Create target question");- H.newButton("Question").click();- H.entityPickerModal().within(() => {- H.entityPickerModalTab("Collections").click();- cy.findByText("Source question").click();- });- H.saveQuestion("Target question");-- cy.log("Update source question");- H.commandPaletteButton().click();- H.commandPalette().findByText("Source question").click();- cy.findByTestId("native-query-editor-container")- .findByText("Open Editor")- .click();- H.NativeEditor.focus().type(" , 4 as D");- H.saveSavedQuestion();-- cy.log("Assert updated metadata in target question");- H.commandPaletteButton().click();- H.commandPalette().findByText("Target question").click();- cy.findAllByTestId("header-cell").eq(3).should("have.text", "D");- H.openNotebook();- H.getNotebookStep("data").button("Pick columns").click();- H.popover().findByText("D").should("be.visible");- },- );+ it("should update source question metadata when it changes (metabase#43216)", () => {+ cy.intercept("GET", "/api/activity/recents?*").as("recents");+ cy.intercept("GET", "/api/card/**/query_metadata").as("queryMetadata");++ cy.visit("/");+ H.waitForLoaderToBeRemoved();+ cy.wait("@recents");++ cy.log("Create target question");+ H.newButton("Question").click();+ cy.wait("@recents");+ H.entityPickerModal().within(() => {+ H.entityPickerModalTab("Collections").click();+ H.waitForLoaderToBeRemoved();+ cy.findByText("Source question").click();+ });+ H.saveQuestion("Target question");+ cy.wait("@queryMetadata");++ cy.log("Update source question");+ H.commandPaletteButton().click();+ cy.wait("@recents");+ H.commandPalette()+ .findAllByRole("option")+ .should("have.length", 3)+ .eq(2)+ .should("contain.text", "Source question");+ H.commandPalette().findByText("Source question").click();+ cy.wait("@queryMetadata");+ cy.findByTestId("native-query-editor-container")+ .findByText("Open Editor")+ .click();+ H.NativeEditor.focus().type(" , 4 as D;");+ H.saveSavedQuestion();+ cy.wait(["@recents", "@queryMetadata"]);+ cy.wait(450); // let react process things (flaky test)++ cy.log("Assert updated metadata in target question");+ H.commandPaletteButton().click();+ cy.wait("@recents");+ H.commandPalette()+ .findAllByRole("option")+ .should("have.length", 3)+ .eq(2)+ .should("contain.text", "Target question");+ H.commandPalette().findByText("Target question").click();+ cy.wait("@queryMetadata");+ cy.findAllByTestId("header-cell").eq(3).should("have.text", "D");+ H.openNotebook();+ H.getNotebookStep("data").button("Pick columns").click();+ H.popover().findByText("D").should("be.visible");+ });});function updateQuestion() {diff --git a/e2e/test/scenarios/search/recently-viewed.cy.spec.js b/e2e/test/scenarios/search/recently-viewed.cy.spec.jsindex 91595da6f09..1e5c4752108 100644--- a/e2e/test/scenarios/search/recently-viewed.cy.spec.js+++ b/e2e/test/scenarios/search/recently-viewed.cy.spec.js@@ -4,6 +4,8 @@ import {ORDERS_QUESTION_ID,} from "e2e/support/cypress_sample_instance_data";+import { advanceServerClockBy } from "../admin/performance/helpers/e2e-performance-helpers";+describe("search > recently viewed", () => {beforeEach(() => {H.restore();@@ -13,9 +15,11 @@ describe("search > recently viewed", () => {cy.findByTextEnsureVisible("Address");// "Orders" question+ advanceServerClockBy(100);H.visitQuestion(ORDERS_QUESTION_ID);// "Orders in a dashboard" dashboard+ advanceServerClockBy(100);H.visitDashboard(ORDERS_DASHBOARD_ID);cy.findByTextEnsureVisible("Product ID");@@ -61,6 +65,7 @@ describe("search > recently viewed", () => {cy.intercept("/api/dataset").as("dataset");+ advanceServerClockBy(100);cy.findAllByTestId("recently-viewed-item-title").eq(2).click();cy.wait("@dataset");