Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

remove flaky tag (#65741)

Fraserba35c6640ac5
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index 7b75a813e54..3e3e4544cad 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -137,7 +137,7 @@ jobs:
run: |
echo "Running tests with specs: $SPEC_PATH"
node e2e/runner/run_cypress_ci.js e2e \
- --env grepTags="-@mongo+-@python+-@flaky+-@OSS+-@skip",grepOmitFiltered=true \
+ --env grepTags="-@mongo+-@python+-@OSS+-@skip",grepOmitFiltered=true \
--spec "$SPEC_PATH" \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
# Trunk Quarantine controls the final state of the run in the CI!
diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml
index aecadc80ee2..623e7e70181 100644
--- a/.github/workflows/e2e-tests.yml
+++ b/.github/workflows/e2e-tests.yml
@@ -73,20 +73,6 @@ jobs:
tags: ${{ matrix.tags }}
runner: ${{ matrix.runner }}
- # run this separately to make it non-blocking
- flaky-e2e-tests:
- name: Flaky e2e Tests
- uses: ./.github/workflows/e2e-test.yml
- needs:
- - e2e-matrix-builder
- # skip flaky test run if only e2e specs changed as an optimization
- if: |
- !cancelled() && !inputs.skip && needs.e2e-matrix-builder.outputs.isDefaultSpecPattern == 'true'
- secrets: inherit
- with:
- name: Flaky
- tags: "@flaky"
-
collect-timings:
name: Collect E2E Timings
runs-on: ubuntu-22.04
@@ -152,14 +138,12 @@ jobs:
e2e-tests-result:
needs:
- e2e-tests
- - flaky-e2e-tests
runs-on: ubuntu-latest
timeout-minutes: 5
name: e2e-tests-result
if: always() && !cancelled()
env:
E2E_TESTS_RESULT: ${{ needs.e2e-tests.result }}
- FLAKY_E2E_TESTS_RESULT: ${{ needs.flaky-e2e-tests.result }}
steps:
- name: Stub
if: ${{ needs.e2e-tests.result == 'skipped' }}
@@ -169,7 +153,6 @@ jobs:
if: ${{ needs.e2e-tests.result != 'skipped' }}
run: | # sh
echo "E2E Tests: ${{ needs.e2e-tests.result }}"
- echo "Flaky E2E Tests: ${{ needs.flaky-e2e-tests.result }}"
if [ "${{ needs.e2e-tests.result }}" != "success" ]; then
echo "E2E Tests failed"
diff --git a/e2e/test/scenarios/admin-2/people.cy.spec.js b/e2e/test/scenarios/admin-2/people.cy.spec.js
index 1716424f26f..8dcb377a891 100644
--- a/e2e/test/scenarios/admin-2/people.cy.spec.js
+++ b/e2e/test/scenarios/admin-2/people.cy.spec.js
@@ -778,7 +778,7 @@ describe("scenarios > admin > people > group managers", () => {
cy.url().should("match", /\/$/);
});
- it("can manage members from the people page", { tags: "@flaky" }, () => {
+ it("can manage members from the people page", () => {
// Open membership select for a user
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText(noCollectionUserName)
diff --git a/e2e/test/scenarios/custom-column/cc-shortcuts.cy.spec.ts b/e2e/test/scenarios/custom-column/cc-shortcuts.cy.spec.ts
index ff3e41674a5..b5afca72c73 100644
--- a/e2e/test/scenarios/custom-column/cc-shortcuts.cy.spec.ts
+++ b/e2e/test/scenarios/custom-column/cc-shortcuts.cy.spec.ts
@@ -32,165 +32,161 @@ function selectColumn(index: number, table: string, name?: string) {
});
}
-describe(
- "scenarios > question > custom column > expression shortcuts > extract",
- { tags: "@flaky" },
- () => {
- const DATE_EXTRACTIONS = [
- {
- table: ORDERS_ID,
- column: "Created At",
- name: "Hour of day",
- fn: "hour",
- },
- {
- table: ORDERS_ID,
- column: "Created At",
- name: "Day of month",
- fn: "day",
- },
- {
- table: ORDERS_ID,
- column: "Created At",
- name: "Day of week",
- fn: "weekday",
- },
- {
- table: ORDERS_ID,
- column: "Created At",
- name: "Month of year",
- fn: "month",
- },
- {
- table: ORDERS_ID,
- column: "Created At",
- name: "Quarter of year",
- fn: "quarter",
- },
- {
- table: ORDERS_ID,
- column: "Created At",
- name: "Year",
- fn: "year",
- },
- ];
-
- const EMAIL_EXTRACTIONS = [
- {
- table: ORDERS_ID,
- column: "Email",
- name: "Domain",
- fn: "domain",
- },
- {
- table: ORDERS_ID,
- column: "Email",
- name: "Host",
- fn: "host",
- },
- ];
-
- const URL_EXRACTIONS = [
- {
- table: ORDERS_ID,
- column: "Product ID",
- name: "Domain",
- fn: "domain",
- },
- {
- table: ORDERS_ID,
- column: "Product ID",
- name: "Subdomain",
- fn: "subdomain",
- },
- {
- table: ORDERS_ID,
- column: "Product ID",
- name: "Host",
- fn: "host",
- },
- ];
-
- const EXTRACTIONS = [
- ...EMAIL_EXTRACTIONS,
- ...DATE_EXTRACTIONS,
- ...URL_EXRACTIONS,
- ];
+describe("scenarios > question > custom column > expression shortcuts > extract", () => {
+ const DATE_EXTRACTIONS = [
+ {
+ table: ORDERS_ID,
+ column: "Created At",
+ name: "Hour of day",
+ fn: "hour",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Created At",
+ name: "Day of month",
+ fn: "day",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Created At",
+ name: "Day of week",
+ fn: "weekday",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Created At",
+ name: "Month of year",
+ fn: "month",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Created At",
+ name: "Quarter of year",
+ fn: "quarter",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Created At",
+ name: "Year",
+ fn: "year",
+ },
+ ];
+
+ const EMAIL_EXTRACTIONS = [
+ {
+ table: ORDERS_ID,
+ column: "Email",
+ name: "Domain",
+ fn: "domain",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Email",
+ name: "Host",
+ fn: "host",
+ },
+ ];
+
+ const URL_EXRACTIONS = [
+ {
+ table: ORDERS_ID,
+ column: "Product ID",
+ name: "Domain",
+ fn: "domain",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Product ID",
+ name: "Subdomain",
+ fn: "subdomain",
+ },
+ {
+ table: ORDERS_ID,
+ column: "Product ID",
+ name: "Host",
+ fn: "host",
+ },
+ ];
+
+ const EXTRACTIONS = [
+ ...EMAIL_EXTRACTIONS,
+ ...DATE_EXTRACTIONS,
+ ...URL_EXRACTIONS,
+ ];
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
+ beforeEach(() => {
+ H.restore();
+ cy.signInAsAdmin();
- // Make the PRODUCT_ID column a URL column for these tests, to avoid having to create a new model
- cy.request("PUT", `/api/field/${ORDERS.PRODUCT_ID}`, {
- semantic_type: "type/URL",
- });
+ // Make the PRODUCT_ID column a URL column for these tests, to avoid having to create a new model
+ cy.request("PUT", `/api/field/${ORDERS.PRODUCT_ID}`, {
+ semantic_type: "type/URL",
});
+ });
- for (const extraction of EXTRACTIONS) {
- it(`should be possible to use the ${extraction.name} extraction on ${extraction.column}`, () => {
- H.openTable({ mode: "notebook", limit: 1, table: extraction.table });
- H.addCustomColumn();
- selectExtractColumn();
-
- cy.findAllByTestId("dimension-list-item")
- .contains(extraction.column)
- .click();
- H.popover().findAllByRole("button").contains(extraction.name).click();
-
- H.CustomExpressionEditor.value().should("contain", `${extraction.fn}(`);
-
- H.expressionEditorWidget()
- .findByTestId("expression-name")
- .should("have.value", extraction.name);
- });
- }
-
- it("should be possible to create the same extraction multiple times", () => {
- H.openOrdersTable({ mode: "notebook", limit: 5 });
+ for (const extraction of EXTRACTIONS) {
+ it(`should be possible to use the ${extraction.name} extraction on ${extraction.column}`, () => {
+ H.openTable({ mode: "notebook", limit: 1, table: extraction.table });
H.addCustomColumn();
selectExtractColumn();
- cy.findAllByTestId("dimension-list-item").contains("Created At").click();
- H.popover().findAllByRole("button").contains("Hour of day").click();
+ cy.findAllByTestId("dimension-list-item")
+ .contains(extraction.column)
+ .click();
+ H.popover().findAllByRole("button").contains(extraction.name).click();
+
+ H.CustomExpressionEditor.value().should("contain", `${extraction.fn}(`);
H.expressionEditorWidget()
.findByTestId("expression-name")
- .should("have.value", "Hour of day");
+ .should("have.value", extraction.name);
+ });
+ }
- H.expressionEditorWidget().button("Done").click();
+ it("should be possible to create the same extraction multiple times", () => {
+ H.openOrdersTable({ mode: "notebook", limit: 5 });
+ H.addCustomColumn();
+ selectExtractColumn();
- // eslint-disable-next-line no-unsafe-element-filtering
- cy.findAllByTestId("notebook-cell-item").last().click();
- selectExtractColumn();
+ cy.findAllByTestId("dimension-list-item").contains("Created At").click();
+ H.popover().findAllByRole("button").contains("Hour of day").click();
- cy.findAllByTestId("dimension-list-item").contains("Created At").click();
- H.popover().findAllByRole("button").contains("Hour of day").click();
+ H.expressionEditorWidget()
+ .findByTestId("expression-name")
+ .should("have.value", "Hour of day");
- H.expressionEditorWidget()
- .findByTestId("expression-name")
- .should("have.value", "Hour of day (1)");
- });
+ H.expressionEditorWidget().button("Done").click();
- it("should be possible to edit a previous stages' columns when an aggregation is present (metabase#43226)", () => {
- H.openOrdersTable({ mode: "notebook", limit: 5 });
+ // eslint-disable-next-line no-unsafe-element-filtering
+ cy.findAllByTestId("notebook-cell-item").last().click();
+ selectExtractColumn();
- cy.button("Summarize").click();
- H.popover().findByText("Count of rows").click();
+ cy.findAllByTestId("dimension-list-item").contains("Created At").click();
+ H.popover().findAllByRole("button").contains("Hour of day").click();
- // add custom column
- cy.findAllByTestId("action-buttons").first().icon("add_data").click();
- selectExtractColumn();
+ H.expressionEditorWidget()
+ .findByTestId("expression-name")
+ .should("have.value", "Hour of day (1)");
+ });
- cy.findAllByTestId("dimension-list-item").contains("Created At").click();
- H.popover().findAllByRole("button").contains("Hour of day").click();
+ it("should be possible to edit a previous stages' columns when an aggregation is present (metabase#43226)", () => {
+ H.openOrdersTable({ mode: "notebook", limit: 5 });
- H.expressionEditorWidget()
- .findByTestId("expression-name")
- .should("have.value", "Hour of day");
- });
- },
-);
+ cy.button("Summarize").click();
+ H.popover().findByText("Count of rows").click();
+
+ // add custom column
+ cy.findAllByTestId("action-buttons").first().icon("add_data").click();
+ selectExtractColumn();
+
+ cy.findAllByTestId("dimension-list-item").contains("Created At").click();
+ H.popover().findAllByRole("button").contains("Hour of day").click();
+
+ H.expressionEditorWidget()
+ .findByTestId("expression-name")
+ .should("have.value", "Hour of day");
+ });
+});
H.describeWithSnowplow(
"scenarios > question > custom column > expression shortcuts > extract",
diff --git a/e2e/test/scenarios/dashboard-cards/click-behavior.cy.spec.js b/e2e/test/scenarios/dashboard-cards/click-behavior.cy.spec.js
index a750cd891b1..85d673c0a46 100644
--- a/e2e/test/scenarios/dashboard-cards/click-behavior.cy.spec.js
+++ b/e2e/test/scenarios/dashboard-cards/click-behavior.cy.spec.js
@@ -1297,144 +1297,138 @@ describe("scenarios > dashboard > dashboard cards > click behavior", () => {
.should("have.text", "Open the drill-through menu");
});
- it(
- "should allow setting dashboard and saved question as custom destination for different columns",
- { tags: "@flaky" },
- () => {
- H.createQuestion(TARGET_QUESTION);
- H.createDashboard(
- {
- ...TARGET_DASHBOARD,
- parameters: [DASHBOARD_FILTER_TEXT, DASHBOARD_FILTER_TIME],
- dashcards: [
- createMockDashboardCard({
- card_id: ORDERS_QUESTION_ID,
- parameter_mappings: [
- createTextFilterMapping({ card_id: ORDERS_QUESTION_ID }),
- createTimeFilterMapping({ card_id: ORDERS_QUESTION_ID }),
- ],
- }),
- ],
- },
- {
- wrapId: true,
- idAlias: "targetDashboardId",
- },
- );
- H.createQuestionAndDashboard({ questionDetails }).then(
- ({ body: card }) => {
- H.visitDashboard(card.dashboard_id);
- },
+ it("should allow setting dashboard and saved question as custom destination for different columns", () => {
+ H.createQuestion(TARGET_QUESTION);
+ H.createDashboard(
+ {
+ ...TARGET_DASHBOARD,
+ parameters: [DASHBOARD_FILTER_TEXT, DASHBOARD_FILTER_TIME],
+ dashcards: [
+ createMockDashboardCard({
+ card_id: ORDERS_QUESTION_ID,
+ parameter_mappings: [
+ createTextFilterMapping({ card_id: ORDERS_QUESTION_ID }),
+ createTimeFilterMapping({ card_id: ORDERS_QUESTION_ID }),
+ ],
+ }),
+ ],
+ },
+ {
+ wrapId: true,
+ idAlias: "targetDashboardId",
+ },
+ );
+ H.createQuestionAndDashboard({ questionDetails }).then(
+ ({ body: card }) => {
+ H.visitDashboard(card.dashboard_id);
+ },
+ );
+
+ H.editDashboard();
+
+ H.getDashboardCard().realHover().icon("click").click();
+
+ (function addCustomDashboardDestination() {
+ cy.log("custom destination (dashboard) behavior for 'Count' column");
+
+ getCountToDashboardMapping().should("not.exist");
+ cy.get("aside").findByText(COUNT_COLUMN_NAME).click();
+ addDashboardDestination();
+ cy.get("aside")
+ .findByText("Select a dashboard tab")
+ .should("not.exist");
+ cy.get("aside").findByText("No available targets").should("not.exist");
+ addTextParameter();
+ addTimeParameter();
+ customizeLinkText(`Count: {{${COUNT_COLUMN_ID}}}`);
+
+ cy.icon("chevronleft").click();
+
+ getCountToDashboardMapping().should("exist");
+ H.getDashboardCard()
+ .button()
+ .should("have.text", "1 column has custom behavior");
+ })();
+
+ (function addCustomQuestionDestination() {
+ cy.log(
+ "custom destination (question) behavior for 'Created at' column",
);
- H.editDashboard();
-
- H.getDashboardCard().realHover().icon("click").click();
-
- (function addCustomDashboardDestination() {
- cy.log("custom destination (dashboard) behavior for 'Count' column");
-
- getCountToDashboardMapping().should("not.exist");
- cy.get("aside").findByText(COUNT_COLUMN_NAME).click();
- addDashboardDestination();
- cy.get("aside")
- .findByText("Select a dashboard tab")
- .should("not.exist");
- cy.get("aside")
- .findByText("No available targets")
- .should("not.exist");
- addTextParameter();
- addTimeParameter();
- customizeLinkText(`Count: {{${COUNT_COLUMN_ID}}}`);
-
- cy.icon("chevronleft").click();
-
- getCountToDashboardMapping().should("exist");
- H.getDashboardCard()
- .button()
- .should("have.text", "1 column has custom behavior");
- })();
-
- (function addCustomQuestionDestination() {
- cy.log(
- "custom destination (question) behavior for 'Created at' column",
- );
+ getCreatedAtToQuestionMapping().should("not.exist");
+ cy.get("aside").findByText(CREATED_AT_COLUMN_NAME).click();
+ addSavedQuestionDestination();
+ addSavedQuestionCreatedAtParameter();
+ addSavedQuestionQuantityParameter();
+ customizeLinkText(`Created at: {{${CREATED_AT_COLUMN_ID}}}`);
- getCreatedAtToQuestionMapping().should("not.exist");
- cy.get("aside").findByText(CREATED_AT_COLUMN_NAME).click();
- addSavedQuestionDestination();
- addSavedQuestionCreatedAtParameter();
- addSavedQuestionQuantityParameter();
- customizeLinkText(`Created at: {{${CREATED_AT_COLUMN_ID}}}`);
-
- cy.icon("chevronleft").click();
-
- getCreatedAtToQuestionMapping().should("exist");
- H.getDashboardCard()
- .button()
- .should("have.text", "2 columns have custom behavior");
- })();
-
- cy.get("aside").button("Done").click();
- H.saveDashboard({ waitMs: 500 });
-
- (function testDashboardDestinationClick() {
- cy.log("it handles 'Count' column click");
-
- getTableCell(COLUMN_INDEX.COUNT)
- .should("have.text", `Count: ${POINT_COUNT}`)
- .click();
-
- cy.get("@targetDashboardId").then((targetDashboardId) => {
- cy.location().should(({ pathname, search }) => {
- expect(pathname).to.equal(`/dashboard/${targetDashboardId}`);
- expect(search).to.equal(
- `?${DASHBOARD_FILTER_TEXT.slug}=${POINT_COUNT}&${DASHBOARD_FILTER_TIME.slug}=${POINT_CREATED_AT}`,
- );
- });
+ cy.icon("chevronleft").click();
+
+ getCreatedAtToQuestionMapping().should("exist");
+ H.getDashboardCard()
+ .button()
+ .should("have.text", "2 columns have custom behavior");
+ })();
+
+ cy.get("aside").button("Done").click();
+ H.saveDashboard({ waitMs: 500 });
+
+ (function testDashboardDestinationClick() {
+ cy.log("it handles 'Count' column click");
+
+ getTableCell(COLUMN_INDEX.COUNT)
+ .should("have.text", `Count: ${POINT_COUNT}`)
+ .click();
+
+ cy.get("@targetDashboardId").then((targetDashboardId) => {
+ cy.location().should(({ pathname, search }) => {
+ expect(pathname).to.equal(`/dashboard/${targetDashboardId}`);
+ expect(search).to.equal(
+ `?${DASHBOARD_FILTER_TEXT.slug}=${POINT_COUNT}&${DASHBOARD_FILTER_TIME.slug}=${POINT_CREATED_AT}`,
+ );
});
+ });
- cy.findAllByTestId("parameter-widget")
- .should("have.length", 2)
- .should("contain.text", POINT_COUNT)
- .should("contain.text", POINT_CREATED_AT_FORMATTED);
- })();
+ cy.findAllByTestId("parameter-widget")
+ .should("have.length", 2)
+ .should("contain.text", POINT_COUNT)
+ .should("contain.text", POINT_CREATED_AT_FORMATTED);
+ })();
- cy.go("back");
+ cy.go("back");
- (function testQuestionDestinationClick() {
- cy.log("it handles 'Created at' column click");
-
- getTableCell(COLUMN_INDEX.CREATED_AT)
- .should("have.text", `Created at: ${POINT_CREATED_AT_FORMATTED}`)
- .click();
- cy.wait("@dataset");
- cy.findByTestId("qb-filters-panel")
- .should("contain.text", "Created At is Jul 1–31, 2022")
- .should("contain.text", "Quantity is equal to 64");
-
- cy.location("pathname").should("equal", "/question");
- cy.findByTestId("app-bar").should(
- "contain.text",
- `Started from ${TARGET_QUESTION.name}`,
- );
- verifyVizTypeIsLine();
+ (function testQuestionDestinationClick() {
+ cy.log("it handles 'Created at' column click");
- H.openNotebook();
- H.verifyNotebookQuery("Orders", [
- {
- filters: [
- "Created At is Jul 1–31, 2022",
- "Quantity is equal to 64",
- ],
- aggregations: ["Count"],
- breakouts: ["Created At: Month"],
- limit: 5,
- },
- ]);
- })();
- },
- );
+ getTableCell(COLUMN_INDEX.CREATED_AT)
+ .should("have.text", `Created at: ${POINT_CREATED_AT_FORMATTED}`)
+ .click();
+ cy.wait("@dataset");
+ cy.findByTestId("qb-filters-panel")
+ .should("contain.text", "Created At is Jul 1–31, 2022")
+ .should("contain.text", "Quantity is equal to 64");
+
+ cy.location("pathname").should("equal", "/question");
+ cy.findByTestId("app-bar").should(
+ "contain.text",
+ `Started from ${TARGET_QUESTION.name}`,
+ );
+ verifyVizTypeIsLine();
+
+ H.openNotebook();
+ H.verifyNotebookQuery("Orders", [
+ {
+ filters: [
+ "Created At is Jul 1–31, 2022",
+ "Quantity is equal to 64",
+ ],
+ aggregations: ["Count"],
+ breakouts: ["Created At: Month"],
+ limit: 5,
+ },
+ ]);
+ })();
+ });
it("should allow setting dashboard tab with parameter for a column", () => {
H.createQuestion(TARGET_QUESTION);
diff --git a/e2e/test/scenarios/dashboard-filters/dashboard-chained-filters.cy.spec.js b/e2e/test/scenarios/dashboard-filters/dashboard-chained-filters.cy.spec.js
index 912ab831d1e..55aa001a136 100644
--- a/e2e/test/scenarios/dashboard-filters/dashboard-chained-filters.cy.spec.js
+++ b/e2e/test/scenarios/dashboard-filters/dashboard-chained-filters.cy.spec.js
@@ -5,7 +5,7 @@ import { ORDERS_DASHBOARD_ID } from "e2e/support/cypress_sample_instance_data";
const { PEOPLE } = SAMPLE_DATABASE;
-describe("scenarios > dashboard > chained filter", { tags: "@flaky" }, () => {
+describe("scenarios > dashboard > chained filter", () => {
beforeEach(() => {
H.restore();
cy.signInAsAdmin();
diff --git a/e2e/test/scenarios/dashboard-filters/dashboard-filters-reset-clear.cy.spec.ts b/e2e/test/scenarios/dashboard-filters/dashboard-filters-reset-clear.cy.spec.ts
index 3e817e787d2..219f427f42d 100644
--- a/e2e/test/scenarios/dashboard-filters/dashboard-filters-reset-clear.cy.spec.ts
+++ b/e2e/test/scenarios/dashboard-filters/dashboard-filters-reset-clear.cy.spec.ts
@@ -678,7 +678,7 @@ describe("scenarios > dashboard > filters > reset all filters", () => {
cy.signInAsAdmin();
});
- describe("resetting to empty value", { tags: "@flaky" }, () => {
+ describe("resetting to empty value", () => {
it("works across all tabs with 'auto-apply filters' on", () => {
createDashboardWithParameterInEachTab({
autoApplyFilters: true,
@@ -689,19 +689,15 @@ describe("scenarios > dashboard > filters > reset all filters", () => {
});
});
- it(
- "works across all tabs with 'auto-apply filters' off",
- { tags: "@flaky" },
- () => {
- createDashboardWithParameterInEachTab({
- autoApplyFilters: false,
- parameters: [PARAMETER_A, PARAMETER_B],
- });
- checkResetAllFiltersWorksAcrossTabs({
- autoApplyFilters: false,
- });
- },
- );
+ it("works across all tabs with 'auto-apply filters' off", () => {
+ createDashboardWithParameterInEachTab({
+ autoApplyFilters: false,
+ parameters: [PARAMETER_A, PARAMETER_B],
+ });
+ checkResetAllFiltersWorksAcrossTabs({
+ autoApplyFilters: false,
+ });
+ });
});
describe("resetting to default value", () => {
@@ -713,19 +709,15 @@ describe("scenarios > dashboard > filters > reset all filters", () => {
checkResetAllFiltersToDefaultWorksAcrossTabs({ autoApplyFilters: true });
});
- it(
- "works across all tabs with 'auto-apply filters' off",
- { tags: "@flaky" },
- () => {
- createDashboardWithParameterInEachTab({
- autoApplyFilters: false,
- parameters: [PARAMETER_A_DEFAULT_VALUE, PARAMETER_B_DEFAULT_VALUE],
- });
- checkResetAllFiltersToDefaultWorksAcrossTabs({
- autoApplyFilters: false,
- });
- },
- );
+ it("works across all tabs with 'auto-apply filters' off", () => {
+ createDashboardWithParameterInEachTab({
+ autoApplyFilters: false,
+ parameters: [PARAMETER_A_DEFAULT_VALUE, PARAMETER_B_DEFAULT_VALUE],
+ });
+ checkResetAllFiltersToDefaultWorksAcrossTabs({
+ autoApplyFilters: false,
+ });
+ });
});
describe("issue 46177", () => {
diff --git a/e2e/test/scenarios/dashboard-filters/dashboard-filters-sql-text-category.cy.spec.js b/e2e/test/scenarios/dashboard-filters/dashboard-filters-sql-text-category.cy.spec.js
index 5ff0f2095d9..38323c36025 100644
--- a/e2e/test/scenarios/dashboard-filters/dashboard-filters-sql-text-category.cy.spec.js
+++ b/e2e/test/scenarios/dashboard-filters/dashboard-filters-sql-text-category.cy.spec.js
@@ -27,42 +27,38 @@ describe("scenarios > dashboard > filters > SQL > text/category", () => {
H.editDashboard();
});
- it(
- "should work when set through the filter widget",
- { tags: "@flaky" },
- () => {
- Object.entries(DASHBOARD_SQL_TEXT_FILTERS).forEach(([filter]) => {
- cy.log(`Make sure we can connect ${filter} filter`);
- H.setFilter("Text or Category", filter);
-
- cy.findByText("Select…").click();
- H.popover().contains(filter).click();
- });
+ it("should work when set through the filter widget", () => {
+ Object.entries(DASHBOARD_SQL_TEXT_FILTERS).forEach(([filter]) => {
+ cy.log(`Make sure we can connect ${filter} filter`);
+ H.setFilter("Text or Category", filter);
- H.saveDashboard();
+ cy.findByText("Select…").click();
+ H.popover().contains(filter).click();
+ });
- Object.entries(DASHBOARD_SQL_TEXT_FILTERS).forEach(
- ([filter, { value, representativeResult }], index) => {
- // eslint-disable-next-line no-unsafe-element-filtering
- H.filterWidget().eq(index).click();
+ H.saveDashboard();
- if (["Is", "Is not"].includes(filter)) {
- cy.log("Wait for the correct popover to appear");
- cy.findByPlaceholderText(/search the list/i).should("be.visible");
- }
- applyFilterByType(filter, value);
+ Object.entries(DASHBOARD_SQL_TEXT_FILTERS).forEach(
+ ([filter, { value, representativeResult }], index) => {
+ // eslint-disable-next-line no-unsafe-element-filtering
+ H.filterWidget().eq(index).click();
- cy.log(`Make sure ${filter} filter returns correct result`);
- cy.findByTestId("dashcard").within(() => {
- cy.contains(representativeResult);
- });
+ if (["Is", "Is not"].includes(filter)) {
+ cy.log("Wait for the correct popover to appear");
+ cy.findByPlaceholderText(/search the list/i).should("be.visible");
+ }
+ applyFilterByType(filter, value);
- H.clearFilterWidget(index);
- cy.wait("@dashcardQuery");
- },
- );
- },
- );
+ cy.log(`Make sure ${filter} filter returns correct result`);
+ cy.findByTestId("dashcard").within(() => {
+ cy.contains(representativeResult);
+ });
+
+ H.clearFilterWidget(index);
+ cy.wait("@dashcardQuery");
+ },
+ );
+ });
it("should work when set as the default filter and when that filter is removed (metabase#20493)", () => {
H.setFilter("Text or Category", "Is");
diff --git a/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js b/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js
index 28bf0fd0ac6..2a2b93b05e8 100644
--- a/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js
@@ -68,7 +68,7 @@ describe("issue 16621", () => {
});
});
-describe("issue 18770", { tags: "@flaky" }, () => {
+describe("issue 18770", () => {
const questionDetails = {
name: "18770",
query: {
diff --git a/e2e/test/scenarios/filters/filter-bulk.cy.spec.js b/e2e/test/scenarios/filters/filter-bulk.cy.spec.js
index adea1b722c5..05be77929bc 100644
--- a/e2e/test/scenarios/filters/filter-bulk.cy.spec.js
+++ b/e2e/test/scenarios/filters/filter-bulk.cy.spec.js
@@ -133,7 +133,7 @@ describe("scenarios > filters > bulk filtering", () => {
H.assertQueryBuilderRowCount(21);
});
- it("should add a filter for linked tables", { tags: "@flaky" }, () => {
+ it("should add a filter for linked tables", () => {
H.visitQuestionAdhoc(rawQuestionDetails);
H.filter();
H.popover().within(() => {
diff --git a/e2e/test/scenarios/metrics/metrics-collection.cy.spec.js b/e2e/test/scenarios/metrics/metrics-collection.cy.spec.js
index 2fde81a1425..54ca3bb0bd2 100644
--- a/e2e/test/scenarios/metrics/metrics-collection.cy.spec.js
+++ b/e2e/test/scenarios/metrics/metrics-collection.cy.spec.js
@@ -94,50 +94,46 @@ describe("scenarios > metrics > collection", () => {
.should("not.exist");
});
- it(
- "should be possible to add and remove a metric from bookmarks",
- { tags: "@flaky" },
- () => {
- H.createQuestion(ORDERS_SCALAR_METRIC);
- H.createQuestion({
- ...ORDERS_TIMESERIES_METRIC,
- collection_position: null,
- });
- cy.intercept("POST", "/api/card/*/query").as("cardQuery");
-
- cy.visit("/collection/root");
-
- cy.wait("@cardQuery");
- H.getPinnedSection().should("contain", "18,760");
- H.openPinnedItemMenu(ORDERS_SCALAR_METRIC.name);
-
- H.popover().findByText("Bookmark").click();
- H.navigationSidebar()
- .findByText(ORDERS_SCALAR_METRIC.name)
- .should("be.visible");
+ it("should be possible to add and remove a metric from bookmarks", () => {
+ H.createQuestion(ORDERS_SCALAR_METRIC);
+ H.createQuestion({
+ ...ORDERS_TIMESERIES_METRIC,
+ collection_position: null,
+ });
+ cy.intercept("POST", "/api/card/*/query").as("cardQuery");
- cy.log("pinned card should 'blink' to load and later show the data");
- cy.wait("@cardQuery");
- H.getPinnedSection().should("contain", "18,760");
+ cy.visit("/collection/root");
- H.openPinnedItemMenu(ORDERS_SCALAR_METRIC.name);
- H.popover().findByText("Remove from bookmarks").click();
- H.navigationSidebar()
- .findByText(ORDERS_SCALAR_METRIC.name)
- .should("not.exist");
+ cy.wait("@cardQuery");
+ H.getPinnedSection().should("contain", "18,760");
+ H.openPinnedItemMenu(ORDERS_SCALAR_METRIC.name);
- H.openUnpinnedItemMenu(ORDERS_TIMESERIES_METRIC.name);
- H.popover().findByText("Bookmark").click();
- H.navigationSidebar()
- .findByText(ORDERS_TIMESERIES_METRIC.name)
- .should("be.visible");
- H.openUnpinnedItemMenu(ORDERS_TIMESERIES_METRIC.name);
- H.popover().findByText("Remove from bookmarks").click();
- H.navigationSidebar()
- .findByText(ORDERS_TIMESERIES_METRIC.name)
- .should("not.exist");
- },
- );
+ H.popover().findByText("Bookmark").click();
+ H.navigationSidebar()
+ .findByText(ORDERS_SCALAR_METRIC.name)
+ .should("be.visible");
+
+ cy.log("pinned card should 'blink' to load and later show the data");
+ cy.wait("@cardQuery");
+ H.getPinnedSection().should("contain", "18,760");
+
+ H.openPinnedItemMenu(ORDERS_SCALAR_METRIC.name);
+ H.popover().findByText("Remove from bookmarks").click();
+ H.navigationSidebar()
+ .findByText(ORDERS_SCALAR_METRIC.name)
+ .should("not.exist");
+
+ H.openUnpinnedItemMenu(ORDERS_TIMESERIES_METRIC.name);
+ H.popover().findByText("Bookmark").click();
+ H.navigationSidebar()
+ .findByText(ORDERS_TIMESERIES_METRIC.name)
+ .should("be.visible");
+ H.openUnpinnedItemMenu(ORDERS_TIMESERIES_METRIC.name);
+ H.popover().findByText("Remove from bookmarks").click();
+ H.navigationSidebar()
+ .findByText(ORDERS_TIMESERIES_METRIC.name)
+ .should("not.exist");
+ });
it("should be possible to hide the visualization for a pinned metric", () => {
H.createQuestion(ORDERS_SCALAR_METRIC);
diff --git a/e2e/test/scenarios/models/reproductions.cy.spec.js b/e2e/test/scenarios/models/reproductions.cy.spec.js
index ff88ff5aedf..b2c02b883b7 100644
--- a/e2e/test/scenarios/models/reproductions.cy.spec.js
+++ b/e2e/test/scenarios/models/reproductions.cy.spec.js
@@ -539,76 +539,72 @@ describe("issue 22519", { tags: "@skip" }, () => {
});
});
-describe(
- "filtering based on the remapped column name should result in a correct query (metabase#22715)",
- { tags: "@flaky" },
- () => {
- beforeEach(() => {
- cy.intercept("POST", "/api/dataset").as("dataset");
- cy.intercept("PUT", "/api/card/*").as("updateModel");
+describe("filtering based on the remapped column name should result in a correct query (metabase#22715)", () => {
+ beforeEach(() => {
+ cy.intercept("POST", "/api/dataset").as("dataset");
+ cy.intercept("PUT", "/api/card/*").as("updateModel");
- H.restore();
- cy.signInAsAdmin();
+ H.restore();
+ cy.signInAsAdmin();
- H.createNativeQuestion({
- native: {
- query:
- 'select 1 as "ID", current_timestamp::datetime as "ALIAS_CREATED_AT"',
- },
- }).then(({ body: { id } }) => {
- // Visit the question to first load metadata
- H.visitQuestion(id);
+ H.createNativeQuestion({
+ native: {
+ query:
+ 'select 1 as "ID", current_timestamp::datetime as "ALIAS_CREATED_AT"',
+ },
+ }).then(({ body: { id } }) => {
+ // Visit the question to first load metadata
+ H.visitQuestion(id);
- // Turn the question into a model
- cy.request("PUT", `/api/card/${id}`, { type: "model" });
+ // Turn the question into a model
+ cy.request("PUT", `/api/card/${id}`, { type: "model" });
- // Let's go straight to the model metadata editor
- cy.visit(`/model/${id}/columns`);
- cy.findByText("Database column this maps to").should("be.visible");
+ // Let's go straight to the model metadata editor
+ cy.visit(`/model/${id}/columns`);
+ cy.findByText("Database column this maps to").should("be.visible");
- // The first column `ID` is automatically selected
- H.mapColumnTo({ table: "Orders", column: "ID" });
- cy.findByText("ALIAS_CREATED_AT").click();
+ // The first column `ID` is automatically selected
+ H.mapColumnTo({ table: "Orders", column: "ID" });
+ cy.findByText("ALIAS_CREATED_AT").click();
- H.mapColumnTo({ table: "Orders", column: "Created At" });
+ H.mapColumnTo({ table: "Orders", column: "Created At" });
- // Make sure the column name updated before saving
- cy.findByDisplayValue("Created At");
+ // Make sure the column name updated before saving
+ cy.findByDisplayValue("Created At");
- cy.button("Save changes").click();
- cy.wait("@updateModel");
+ cy.button("Save changes").click();
+ cy.wait("@updateModel");
- H.visitModel(id);
- });
+ H.visitModel(id);
});
+ });
- it("when done through the column header action (metabase#22715-1)", () => {
- H.tableHeaderClick("Created At");
- H.popover().within(() => {
- cy.findByText("Filter by this column").click();
- cy.findByText("Today").click();
- });
- cy.wait("@dataset");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Today").should("not.exist");
- cy.get("[data-testid=cell-data]")
- .should("have.length", 4)
- .and("contain", "Created At");
+ it("when done through the column header action (metabase#22715-1)", () => {
+ H.tableHeaderClick("Created At");
+ H.popover().within(() => {
+ cy.findByText("Filter by this column").click();
+ cy.findByText("Today").click();
});
+ cy.wait("@dataset");
+ // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
+ cy.findByText("Today").should("not.exist");
+ cy.get("[data-testid=cell-data]")
+ .should("have.length", 4)
+ .and("contain", "Created At");
+ });
- it("when done through the filter trigger (metabase#22715-2)", () => {
- H.filter();
- H.popover().within(() => {
- cy.findByText("Created At").click();
- cy.findByText("Today").click();
- });
- cy.wait("@dataset");
- cy.get("[data-testid=cell-data]")
- .should("have.length", 4)
- .and("contain", "Created At");
+ it("when done through the filter trigger (metabase#22715-2)", () => {
+ H.filter();
+ H.popover().within(() => {
+ cy.findByText("Created At").click();
+ cy.findByText("Today").click();
});
- },
-);
+ cy.wait("@dataset");
+ cy.get("[data-testid=cell-data]")
+ .should("have.length", 4)
+ .and("contain", "Created At");
+ });
+});
describe("issue 23024", () => {
function addModelToDashboardAndVisit() {
diff --git a/e2e/test/scenarios/models/reproductions.cy.spec.ts b/e2e/test/scenarios/models/reproductions.cy.spec.ts
index 139503e3154..8b66d5ef2ab 100644
--- a/e2e/test/scenarios/models/reproductions.cy.spec.ts
+++ b/e2e/test/scenarios/models/reproductions.cy.spec.ts
@@ -56,56 +56,52 @@ describe("issue 29943", () => {
cy.intercept("POST", "/api/dataset").as("dataset");
});
- it(
- "selects the right column when clicking a column header (metabase#29943)",
- { tags: "@flaky" },
- () => {
- H.createQuestion(
- {
- type: "model",
- query: {
- "source-table": ORDERS_ID,
- expressions: {
- Custom: ["+", 1, 1],
- },
- fields: [
- ["field", ORDERS.ID, { "base-type": "type/BigInteger" }],
- ["field", ORDERS.TOTAL, { "base-type": "type/Float" }],
- ["expression", "Custom", { "base-type": "type/Integer" }],
- ],
- limit: 5, // optimization
+ it("selects the right column when clicking a column header (metabase#29943)", () => {
+ H.createQuestion(
+ {
+ type: "model",
+ query: {
+ "source-table": ORDERS_ID,
+ expressions: {
+ Custom: ["+", 1, 1],
},
+ fields: [
+ ["field", ORDERS.ID, { "base-type": "type/BigInteger" }],
+ ["field", ORDERS.TOTAL, { "base-type": "type/Float" }],
+ ["expression", "Custom", { "base-type": "type/Integer" }],
+ ],
+ limit: 5, // optimization
},
- { visitQuestion: true },
- );
+ },
+ { visitQuestion: true },
+ );
- H.openQuestionActions();
- H.popover().findByText("Edit metadata").click();
- H.waitForLoaderToBeRemoved();
+ H.openQuestionActions();
+ H.popover().findByText("Edit metadata").click();
+ H.waitForLoaderToBeRemoved();
- reorderTotalAndCustomColumns();
- cy.button("Save changes").click();
- cy.wait("@dataset");
+ reorderTotalAndCustomColumns();
+ cy.button("Save changes").click();
+ cy.wait("@dataset");
- H.openQuestionActions();
- H.popover().findByText("Edit metadata").click();
- H.waitForLoaderToBeRemoved();
+ H.openQuestionActions();
+ H.popover().findByText("Edit metadata").click();
+ H.waitForLoaderToBeRemoved();
- assertColumnSelected(0, "ID");
+ assertColumnSelected(0, "ID");
- getHeaderCell(1, "Custom");
- H.tableHeaderClick("Custom");
- assertColumnSelected(1, "Custom");
+ getHeaderCell(1, "Custom");
+ H.tableHeaderClick("Custom");
+ assertColumnSelected(1, "Custom");
- getHeaderCell(2, "Total");
- H.tableHeaderClick("Total");
- assertColumnSelected(2, "Total");
+ getHeaderCell(2, "Total");
+ H.tableHeaderClick("Total");
+ assertColumnSelected(2, "Total");
- getHeaderCell(0, "ID");
- H.tableHeaderClick("ID");
- assertColumnSelected(0, "ID");
- },
- );
+ getHeaderCell(0, "ID");
+ H.tableHeaderClick("ID");
+ assertColumnSelected(0, "ID");
+ });
});
describe("issue 35711", () => {
@@ -143,35 +139,31 @@ describe("issue 35711", () => {
cy.signInAsAdmin();
});
- it(
- "can edit metadata of a model with a custom column (metabase#35711)",
- { tags: "@flaky" },
- () => {
- H.createQuestion(
- {
- type: "model",
- query: {
- "source-table": ORDERS_ID,
- expressions: {
- "Custom column": ["-", DISCOUNT_FIELD_REF, 1],
- },
- limit: 5, // optimization
+ it("can edit metadata of a model with a custom column (metabase#35711)", () => {
+ H.createQuestion(
+ {
+ type: "model",
+ query: {
+ "source-table": ORDERS_ID,
+ expressions: {
+ "Custom column": ["-", DISCOUNT_FIELD_REF, 1],
},
+ limit: 5, // optimization
},
- { visitQuestion: true },
- );
+ },
+ { visitQuestion: true },
+ );
- H.openQuestionActions();
- H.popover().findByText("Edit metadata").click();
- H.waitForLoaderToBeRemoved();
+ H.openQuestionActions();
+ H.popover().findByText("Edit metadata").click();
+ H.waitForLoaderToBeRemoved();
- reorderTaxAndTotalColumns();
- assertNoError();
+ reorderTaxAndTotalColumns();
+ assertNoError();
- cy.findByTestId("editor-tabs-query-name").click();
- assertNoError();
- },
- );
+ cy.findByTestId("editor-tabs-query-name").click();
+ assertNoError();
+ });
});
describe("issues 25884 and 34349", () => {
@@ -980,26 +972,22 @@ describe("issue 39993", () => {
cy.intercept("PUT", "/api/card/*").as("updateModel");
});
- it(
- "should preserve viz settings for models with custom expressions (metabase#39993)",
- { tags: "@flaky" },
- () => {
- H.createQuestion(modelDetails).then(({ body: card }) =>
- H.visitModel(card.id),
- );
- H.openQuestionActions();
- H.popover().findByText("Edit metadata").click();
- H.waitForLoaderToBeRemoved();
- cy.log("drag & drop the custom column 100 px to the left");
- H.moveDnDKitElement(H.tableHeaderColumn(columnName), {
- horizontal: -100,
- });
- cy.button("Save changes").click();
- cy.wait("@updateModel");
- cy.findAllByTestId("header-cell").eq(0).should("have.text", "Exp");
- cy.findAllByTestId("header-cell").eq(1).should("have.text", "ID");
- },
- );
+ it("should preserve viz settings for models with custom expressions (metabase#39993)", () => {
+ H.createQuestion(modelDetails).then(({ body: card }) =>
+ H.visitModel(card.id),
+ );
+ H.openQuestionActions();
+ H.popover().findByText("Edit metadata").click();
+ H.waitForLoaderToBeRemoved();
+ cy.log("drag & drop the custom column 100 px to the left");
+ H.moveDnDKitElement(H.tableHeaderColumn(columnName), {
+ horizontal: -100,
+ });
+ cy.button("Save changes").click();
+ cy.wait("@updateModel");
+ cy.findAllByTestId("header-cell").eq(0).should("have.text", "Exp");
+ cy.findAllByTestId("header-cell").eq(1).should("have.text", "ID");
+ });
});
describe("issue 34574", () => {
@@ -1163,40 +1151,36 @@ describe("issue 36161", () => {
cy.intercept("POST", "/api/dataset").as("dataset");
});
- it(
- "should allow to override metadata for custom columns (metabase#36161)",
- { tags: "@flaky" },
- () => {
- H.visitModel(ORDERS_MODEL_ID);
- cy.wait("@dataset");
+ it("should allow to override metadata for custom columns (metabase#36161)", () => {
+ H.visitModel(ORDERS_MODEL_ID);
+ cy.wait("@dataset");
- H.openQuestionActions("Edit query definition");
- H.getNotebookStep("data").button("Pick columns").click();
- H.popover().findByText("Select all").click();
- H.getNotebookStep("data").button("Custom column").click();
- H.enterCustomColumnDetails({ formula: "[ID]", name: "ID2" });
- H.popover().button("Done").click();
- H.getNotebookStep("expression").icon("add").click();
- H.enterCustomColumnDetails({ formula: "[ID]", name: "ID3" });
- H.popover().button("Done").click();
- H.runButtonOverlay().click();
- cy.wait("@dataset");
- cy.findByTestId("editor-tabs-columns-name").click();
- H.openColumnOptions("ID2");
- H.renameColumn("ID2", "ID2 custom");
- H.openColumnOptions("ID3");
- H.renameColumn("ID3", "ID3 custom");
- H.saveMetadataChanges();
-
- H.openNotebook();
- H.getNotebookStep("data").button("Filter").click();
- H.popover().within(() => {
- cy.findByText("ID").should("be.visible");
- cy.findByText("ID2 custom").should("be.visible");
- cy.findByText("ID3 custom").should("be.visible");
- });
- },
- );
+ H.openQuestionActions("Edit query definition");
+ H.getNotebookStep("data").button("Pick columns").click();
+ H.popover().findByText("Select all").click();
+ H.getNotebookStep("data").button("Custom column").click();
+ H.enterCustomColumnDetails({ formula: "[ID]", name: "ID2" });
+ H.popover().button("Done").click();
+ H.getNotebookStep("expression").icon("add").click();
+ H.enterCustomColumnDetails({ formula: "[ID]", name: "ID3" });
+ H.popover().button("Done").click();
+ H.runButtonOverlay().click();
+ cy.wait("@dataset");
+ cy.findByTestId("editor-tabs-columns-name").click();
+ H.openColumnOptions("ID2");
+ H.renameColumn("ID2", "ID2 custom");
+ H.openColumnOptions("ID3");
+ H.renameColumn("ID3", "ID3 custom");
+ H.saveMetadataChanges();
+
+ H.openNotebook();
+ H.getNotebookStep("data").button("Filter").click();
+ H.popover().within(() => {
+ cy.findByText("ID").should("be.visible");
+ cy.findByText("ID2 custom").should("be.visible");
+ cy.findByText("ID3 custom").should("be.visible");
+ });
+ });
});
describe("issue 34514", () => {
diff --git a/e2e/test/scenarios/organization/content-verification.cy.spec.js b/e2e/test/scenarios/organization/content-verification.cy.spec.js
index 7e7f81029e4..ce39e9e7a7b 100644
--- a/e2e/test/scenarios/organization/content-verification.cy.spec.js
+++ b/e2e/test/scenarios/organization/content-verification.cy.spec.js
@@ -4,365 +4,266 @@ import {
ORDERS_DASHBOARD_ID,
} from "e2e/support/cypress_sample_instance_data";
-describe(
- "scenarios > premium > content verification",
- { tags: "@flaky" },
- () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- });
+describe("scenarios > premium > content verification", () => {
+ beforeEach(() => {
+ H.restore();
+ cy.signInAsAdmin();
+ });
- context("without a token", () => {
- beforeEach(() => H.deleteToken());
-
- it("should not be able to verify a saved question", () => {
- cy.log("Gate the API");
- cy.request({
- method: "POST",
- url: "/api/moderation-review",
- failOnStatusCode: false,
- body: {
- status: "verified",
- moderated_item_id: ORDERS_COUNT_QUESTION_ID,
- moderated_item_type: "card",
- },
- }).then(({ body, status, statusText }) => {
- expect(body).to.deep.include(
- H.getPartialPremiumFeatureError("Content verification"),
- );
- expect(status).to.eq(402);
- expect(statusText).to.eq("Payment Required");
- });
+ context("without a token", () => {
+ beforeEach(() => H.deleteToken());
- cy.log("Gate the UI");
- H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
- H.openQuestionActions();
- H.popover()
- .should("contain", "Add to dashboard")
- .and("not.contain", "Verify this question");
-
- cy.log("Turn the question into a model and try again");
- cy.request("PUT", `/api/card/${ORDERS_COUNT_QUESTION_ID}`, {
- type: "model",
- });
+ it("should not be able to verify a saved question", () => {
+ cy.log("Gate the API");
+ cy.request({
+ method: "POST",
+ url: "/api/moderation-review",
+ failOnStatusCode: false,
+ body: {
+ status: "verified",
+ moderated_item_id: ORDERS_COUNT_QUESTION_ID,
+ moderated_item_type: "card",
+ },
+ }).then(({ body, status, statusText }) => {
+ expect(body).to.deep.include(
+ H.getPartialPremiumFeatureError("Content verification"),
+ );
+ expect(status).to.eq(402);
+ expect(statusText).to.eq("Payment Required");
+ });
- cy.intercept("POST", "/api/dataset").as("dataset");
- cy.visit(`/model/${ORDERS_COUNT_QUESTION_ID}`);
- cy.wait("@dataset");
+ cy.log("Gate the UI");
+ H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
+ H.openQuestionActions();
+ H.popover()
+ .should("contain", "Add to dashboard")
+ .and("not.contain", "Verify this question");
- H.openQuestionActions();
- H.popover()
- .should("contain", "Edit query definition")
- .and("not.contain", "Verify this question");
+ cy.log("Turn the question into a model and try again");
+ cy.request("PUT", `/api/card/${ORDERS_COUNT_QUESTION_ID}`, {
+ type: "model",
});
- it("should not be able to verify a Dashboard", () => {
- cy.log("Gate the API");
- cy.request({
- method: "POST",
- url: "/api/moderation-review",
- failOnStatusCode: false,
- body: {
- status: "verified",
- moderated_item_id: ORDERS_DASHBOARD_ID,
- moderated_item_type: "dashboard",
- },
- }).then(({ body, status, statusText }) => {
- expect(body).to.deep.include(
- H.getPartialPremiumFeatureError("Content verification"),
- );
- expect(status).to.eq(402);
- expect(statusText).to.eq("Payment Required");
- });
+ cy.intercept("POST", "/api/dataset").as("dataset");
+ cy.visit(`/model/${ORDERS_COUNT_QUESTION_ID}`);
+ cy.wait("@dataset");
- cy.log("Gate the UI");
- H.visitDashboard(ORDERS_DASHBOARD_ID);
- H.openDashboardMenu();
- H.popover()
- .should("contain", "Enter fullscreen")
- .and("not.contain", "Verify this question");
+ H.openQuestionActions();
+ H.popover()
+ .should("contain", "Edit query definition")
+ .and("not.contain", "Verify this question");
+ });
+
+ it("should not be able to verify a Dashboard", () => {
+ cy.log("Gate the API");
+ cy.request({
+ method: "POST",
+ url: "/api/moderation-review",
+ failOnStatusCode: false,
+ body: {
+ status: "verified",
+ moderated_item_id: ORDERS_DASHBOARD_ID,
+ moderated_item_type: "dashboard",
+ },
+ }).then(({ body, status, statusText }) => {
+ expect(body).to.deep.include(
+ H.getPartialPremiumFeatureError("Content verification"),
+ );
+ expect(status).to.eq(402);
+ expect(statusText).to.eq("Payment Required");
});
+
+ cy.log("Gate the UI");
+ H.visitDashboard(ORDERS_DASHBOARD_ID);
+ H.openDashboardMenu();
+ H.popover()
+ .should("contain", "Enter fullscreen")
+ .and("not.contain", "Verify this question");
});
+ });
- context("premium token with paid features", () => {
- beforeEach(() => H.activateToken("pro-self-hosted"));
+ context("premium token with paid features", () => {
+ beforeEach(() => H.activateToken("pro-self-hosted"));
- describe("an admin", () => {
- it("should be able to verify and unverify a saved question", () => {
- H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
+ describe("an admin", () => {
+ it("should be able to verify and unverify a saved question", () => {
+ H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
- verifyQuestion();
+ verifyQuestion();
- // 1. Question title
- cy.findByTestId("qb-header").within(() => {
- cy.findByText("Orders, Count");
- cy.icon("verified");
- });
+ // 1. Question title
+ cy.findByTestId("qb-header").within(() => {
+ cy.findByText("Orders, Count");
+ cy.icon("verified");
+ });
- // 2. Question's history
- H.questionInfoButton().click();
- H.sidesheet().within(() => {
- cy.findByText(/You verified this/);
- cy.findByRole("tab", { name: "History" }).click();
- cy.findByText("You verified this");
- });
- cy.findByLabelText("Close").click();
-
- // 3. Recently viewed list
- H.openCommandPalette();
- H.commandPalette()
- .findByRole("option", { name: "Orders, Count" })
- .find(".Icon-verified_filled");
- H.commandPaletteInput().type("Orders");
- H.commandPalette()
- .findByRole("option", { name: "Orders, Count" })
- .find(".Icon-verified_filled");
- H.closeCommandPalette();
-
- // 4. Search results
- H.commandPaletteSearch("orders");
- cy.findAllByTestId("search-result-item")
- .contains("Orders, Count")
- .siblings(".Icon-verified_filled");
-
- // 5. Question's collection
- cy.visit("/collection/root");
- cy.findByRole("table")
- .findByText("Orders, Count")
- .closest("td")
- .icon("verified");
-
- cy.log("Go back to the question and remove the verification");
- H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
-
- removeQuestionVerification();
-
- // 1. Question title
- cy.findByTestId("qb-header-left-side")
- .find(".Icon-verified")
- .should("not.exist");
-
- // 2. Question's history
- H.questionInfoButton().click();
- H.sidesheet().within(() => {
- cy.findByRole("tab", { name: "History" }).click();
- cy.findByText("You removed verification");
- cy.findByText("You verified this"); // Implicit assertion - there can be only one :)
- });
- cy.findByLabelText("Close").click();
-
- // 3. Recently viewed list
- H.openCommandPalette();
- H.commandPalette()
- .findByRole("option", { name: "Orders, Count" })
- .find(".Icon-verified_filled")
- .should("not.exist");
- H.commandPaletteInput().type("Orders");
- H.commandPalette()
- .findByRole("option", { name: "Orders, Count" })
- .find(".Icon-verified_filled")
- .should("not.exist");
- H.closeCommandPalette();
-
- // 4. Search results
- H.commandPaletteSearch("orders");
- cy.findAllByTestId("search-result-item")
- .contains("Orders, Count")
- .siblings(".Icon-verified_filed")
- .should("not.exist");
-
- // 5. Question's collection
- cy.visit("/collection/root");
- cy.findByRole("table")
- .findByText("Orders, Count")
- .closest("td")
- .icon("verified")
- .should("not.exist");
+ // 2. Question's history
+ H.questionInfoButton().click();
+ H.sidesheet().within(() => {
+ cy.findByText(/You verified this/);
+ cy.findByRole("tab", { name: "History" }).click();
+ cy.findByText("You verified this");
});
+ cy.findByLabelText("Close").click();
- it("should be able to verify and unverify a dashboard", () => {
- H.visitDashboard(ORDERS_DASHBOARD_ID);
+ // 3. Recently viewed list
+ H.openCommandPalette();
+ H.commandPalette()
+ .findByRole("option", { name: "Orders, Count" })
+ .find(".Icon-verified_filled");
+ H.commandPaletteInput().type("Orders");
+ H.commandPalette()
+ .findByRole("option", { name: "Orders, Count" })
+ .find(".Icon-verified_filled");
+ H.closeCommandPalette();
- verifyDashboard();
+ // 4. Search results
+ H.commandPaletteSearch("orders");
+ cy.findAllByTestId("search-result-item")
+ .contains("Orders, Count")
+ .siblings(".Icon-verified_filled");
+
+ // 5. Question's collection
+ cy.visit("/collection/root");
+ cy.findByRole("table")
+ .findByText("Orders, Count")
+ .closest("td")
+ .icon("verified");
+
+ cy.log("Go back to the question and remove the verification");
+ H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
- // 1. Question title
- cy.findByTestId("dashboard-header").within(() => {
- cy.findByText("Orders in a dashboard");
- cy.icon("verified");
- });
+ removeQuestionVerification();
- // 2. Question's history
- H.openDashboardInfoSidebar();
- H.sidesheet().within(() => {
- cy.findByText(/You verified this/);
- cy.findByRole("tab", { name: "History" }).click();
- cy.findByText("You verified this");
- });
- cy.findByLabelText("Close").click();
-
- // // 3. Recently viewed list
- H.openCommandPalette();
- H.commandPalette()
- .findByRole("option", { name: "Orders in a dashboard" })
- .find(".Icon-verified_filled");
- H.closeCommandPalette();
-
- // // 4. Search results
- H.commandPaletteSearch("orders");
- cy.findAllByTestId("search-result-item")
- .contains("Orders in a dashboard")
- .siblings(".Icon-verified_filled");
-
- // // 5. Question's collection
- cy.visit("/collection/root");
- cy.findByRole("table")
- .findByText("Orders in a dashboard")
- .closest("td")
- .icon("verified");
-
- cy.log("Go back to the question and remove the verification");
- H.visitDashboard(ORDERS_DASHBOARD_ID);
-
- removeDashboardVerification();
-
- // 1. Question title
- cy.findByTestId("dashboard-header")
- .find(".Icon-verified")
- .should("not.exist");
-
- // 2. Question's history
- H.openDashboardInfoSidebar().click();
- H.sidesheet().within(() => {
- cy.findByRole("tab", { name: "History" }).click();
- cy.findByText("You removed verification");
- cy.findByText("You verified this"); // Implicit assertion - there can be only one :)
- });
- cy.findByLabelText("Close").click();
-
- // 3. Recently viewed list
- H.openCommandPalette();
- H.commandPalette()
- .findByRole("option", { name: "Orders in a dashboard" })
- .find(".Icon-verified_filled")
- .should("not.exist");
- H.closeCommandPalette();
-
- // 4. Search results
- H.commandPaletteSearch("orders");
- cy.findAllByTestId("search-result-item")
- .contains("Orders in a dashboard")
- .siblings(".Icon-verified_filed")
- .should("not.exist");
-
- // 5. Question's collection
- cy.visit("/collection/root");
- cy.findByRole("table")
- .findByText("Orders in a dashboard")
- .closest("td")
- .icon("verified")
- .should("not.exist");
+ // 1. Question title
+ cy.findByTestId("qb-header-left-side")
+ .find(".Icon-verified")
+ .should("not.exist");
+
+ // 2. Question's history
+ H.questionInfoButton().click();
+ H.sidesheet().within(() => {
+ cy.findByRole("tab", { name: "History" }).click();
+ cy.findByText("You removed verification");
+ cy.findByText("You verified this"); // Implicit assertion - there can be only one :)
});
+ cy.findByLabelText("Close").click();
+
+ // 3. Recently viewed list
+ H.openCommandPalette();
+ H.commandPalette()
+ .findByRole("option", { name: "Orders, Count" })
+ .find(".Icon-verified_filled")
+ .should("not.exist");
+ H.commandPaletteInput().type("Orders");
+ H.commandPalette()
+ .findByRole("option", { name: "Orders, Count" })
+ .find(".Icon-verified_filled")
+ .should("not.exist");
+ H.closeCommandPalette();
+
+ // 4. Search results
+ H.commandPaletteSearch("orders");
+ cy.findAllByTestId("search-result-item")
+ .contains("Orders, Count")
+ .siblings(".Icon-verified_filed")
+ .should("not.exist");
+
+ // 5. Question's collection
+ cy.visit("/collection/root");
+ cy.findByRole("table")
+ .findByText("Orders, Count")
+ .closest("td")
+ .icon("verified")
+ .should("not.exist");
});
- describe("non-admin user", () => {
- beforeEach(() => {
- H.createModerationReview({
- status: "verified",
- moderated_item_type: "card",
- moderated_item_id: ORDERS_COUNT_QUESTION_ID,
- });
+ it("should be able to verify and unverify a dashboard", () => {
+ H.visitDashboard(ORDERS_DASHBOARD_ID);
- H.createModerationReview({
- status: "verified",
- moderated_item_type: "dashboard",
- moderated_item_id: ORDERS_DASHBOARD_ID,
- });
+ verifyDashboard();
+
+ // 1. Question title
+ cy.findByTestId("dashboard-header").within(() => {
+ cy.findByText("Orders in a dashboard");
+ cy.icon("verified");
+ });
- cy.signInAsNormalUser();
+ // 2. Question's history
+ H.openDashboardInfoSidebar();
+ H.sidesheet().within(() => {
+ cy.findByText(/You verified this/);
+ cy.findByRole("tab", { name: "History" }).click();
+ cy.findByText("You verified this");
});
+ cy.findByLabelText("Close").click();
- it("should be able to see that a question has been verified but can't moderate the question themselves", () => {
- H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
+ // // 3. Recently viewed list
+ H.openCommandPalette();
+ H.commandPalette()
+ .findByRole("option", { name: "Orders in a dashboard" })
+ .find(".Icon-verified_filled");
+ H.closeCommandPalette();
- cy.findByTestId("qb-header").within(() => {
- cy.findByText("Orders, Count");
- cy.icon("verified");
- });
+ // // 4. Search results
+ H.commandPaletteSearch("orders");
+ cy.findAllByTestId("search-result-item")
+ .contains("Orders in a dashboard")
+ .siblings(".Icon-verified_filled");
+
+ // // 5. Question's collection
+ cy.visit("/collection/root");
+ cy.findByRole("table")
+ .findByText("Orders in a dashboard")
+ .closest("td")
+ .icon("verified");
+
+ cy.log("Go back to the question and remove the verification");
+ H.visitDashboard(ORDERS_DASHBOARD_ID);
- cy.log("Non-admin users cannot change question verification status.");
- H.openQuestionActions();
- H.popover()
- .should("contain", "Add to dashboard")
- .and("not.contain", "Remove verification");
-
- H.questionInfoButton().click();
- H.sidesheet().within(() => {
- cy.findAllByText(/A moderator verified this/); // overview tab
- cy.findByRole("tab", { name: "History" }).click();
- cy.findAllByText("A moderator verified this"); // history tab
- });
- cy.findByLabelText("Close").click();
-
- H.commandPaletteSearch("orders");
- cy.log("Verified content should show up higher in search results");
- cy.findAllByTestId("search-result-item")
- .eq(0)
- .within(() => {
- cy.findByText("Orders, Count");
- cy.icon("verified_filled");
- });
-
- cy.visit("/collection/root");
- cy.findByRole("table")
- .findByText("Orders, Count")
- .closest("td")
- .icon("verified");
+ removeDashboardVerification();
+
+ // 1. Question title
+ cy.findByTestId("dashboard-header")
+ .find(".Icon-verified")
+ .should("not.exist");
+
+ // 2. Question's history
+ H.openDashboardInfoSidebar().click();
+ H.sidesheet().within(() => {
+ cy.findByRole("tab", { name: "History" }).click();
+ cy.findByText("You removed verification");
+ cy.findByText("You verified this"); // Implicit assertion - there can be only one :)
});
+ cy.findByLabelText("Close").click();
- it("should be able to see that a dashboard has been verified but can't moderate the dashboard themselves", () => {
- H.visitDashboard(ORDERS_DASHBOARD_ID);
+ // 3. Recently viewed list
+ H.openCommandPalette();
+ H.commandPalette()
+ .findByRole("option", { name: "Orders in a dashboard" })
+ .find(".Icon-verified_filled")
+ .should("not.exist");
+ H.closeCommandPalette();
- cy.findByTestId("dashboard-header").within(() => {
- cy.findByText("Orders in a dashboard");
- cy.icon("verified");
- });
+ // 4. Search results
+ H.commandPaletteSearch("orders");
+ cy.findAllByTestId("search-result-item")
+ .contains("Orders in a dashboard")
+ .siblings(".Icon-verified_filed")
+ .should("not.exist");
- cy.log("Non-admin users cannot change question verification status.");
- H.openDashboardMenu();
- H.popover()
- .should("contain", "Enter fullscreen")
- .and("not.contain", "Remove verification");
-
- H.openDashboardInfoSidebar();
- H.sidesheet().within(() => {
- cy.findAllByText(/A moderator verified this/); // overview tab
- cy.findByRole("tab", { name: "History" }).click();
- cy.findAllByText("A moderator verified this"); // history tab
- });
- cy.findByLabelText("Close").click();
-
- H.commandPaletteSearch("orders");
- cy.log("Verified content should show up higher in search results");
- cy.findAllByTestId("search-result-item")
- .first()
- .within(() => {
- cy.findByText("Orders in a dashboard");
- cy.icon("verified_filled");
- });
-
- cy.visit("/collection/root");
- cy.findByRole("table")
- .findByText("Orders in a dashboard")
- .closest("td")
- .icon("verified");
- });
+ // 5. Question's collection
+ cy.visit("/collection/root");
+ cy.findByRole("table")
+ .findByText("Orders in a dashboard")
+ .closest("td")
+ .icon("verified")
+ .should("not.exist");
});
});
- context("token expired or removed", () => {
+ describe("non-admin user", () => {
beforeEach(() => {
- H.activateToken("pro-self-hosted");
H.createModerationReview({
status: "verified",
moderated_item_type: "card",
@@ -375,83 +276,178 @@ describe(
moderated_item_id: ORDERS_DASHBOARD_ID,
});
- H.deleteToken();
+ cy.signInAsNormalUser();
});
- it("should not treat the question as verified anymore", () => {
+ it("should be able to see that a question has been verified but can't moderate the question themselves", () => {
H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
cy.findByTestId("qb-header").within(() => {
cy.findByText("Orders, Count");
- cy.icon("verified").should("not.exist");
+ cy.icon("verified");
});
+ cy.log("Non-admin users cannot change question verification status.");
+ H.openQuestionActions();
+ H.popover()
+ .should("contain", "Add to dashboard")
+ .and("not.contain", "Remove verification");
+
H.questionInfoButton().click();
H.sidesheet().within(() => {
+ cy.findAllByText(/A moderator verified this/); // overview tab
cy.findByRole("tab", { name: "History" }).click();
- cy.contains(/created this./);
- cy.contains(/verified this/).should("not.exist");
+ cy.findAllByText("A moderator verified this"); // history tab
});
cy.findByLabelText("Close").click();
- H.openCommandPalette();
- H.commandPalette()
- .findByRole("option", { name: "Orders, Count" })
- .find(".Icon-verified_filled")
- .should("not.exist");
- H.commandPaletteInput().type("Orders");
- H.commandPalette()
- .findByRole("option", { name: "Orders, Count" })
- .find(".Icon-verified_filled")
- .should("not.exist");
- H.closeCommandPalette();
-
H.commandPaletteSearch("orders");
- cy.log(
- "The question lost the verification status and does not appear high in search results anymore",
- );
- cy.findAllByTestId("search-result-item").as("searchResults");
- // NOTE: It still appears first, probably due to the recency ranker...
- // I have confirmed that the ranker is no longer active at least.
- // We could probably fix this by opening another dashboard before searching.
- // .first()
- // .should("not.contain", "Orders, Count");
- cy.log("Verified icon should not appear at all in search results");
- cy.get("@searchResults").icon("verified").should("not.exist");
+ cy.log("Verified content should show up higher in search results");
+ cy.findAllByTestId("search-result-item")
+ .eq(0)
+ .within(() => {
+ cy.findByText("Orders, Count");
+ cy.icon("verified_filled");
+ });
+
+ cy.visit("/collection/root");
+ cy.findByRole("table")
+ .findByText("Orders, Count")
+ .closest("td")
+ .icon("verified");
});
- it("should not treat the dashboard as verified anymore", () => {
+ it("should be able to see that a dashboard has been verified but can't moderate the dashboard themselves", () => {
H.visitDashboard(ORDERS_DASHBOARD_ID);
cy.findByTestId("dashboard-header").within(() => {
cy.findByText("Orders in a dashboard");
- cy.icon("verified").should("not.exist");
+ cy.icon("verified");
});
+ cy.log("Non-admin users cannot change question verification status.");
+ H.openDashboardMenu();
+ H.popover()
+ .should("contain", "Enter fullscreen")
+ .and("not.contain", "Remove verification");
+
H.openDashboardInfoSidebar();
H.sidesheet().within(() => {
+ cy.findAllByText(/A moderator verified this/); // overview tab
cy.findByRole("tab", { name: "History" }).click();
- cy.contains(/created this./);
- cy.contains(/verified this/).should("not.exist");
+ cy.findAllByText("A moderator verified this"); // history tab
});
cy.findByLabelText("Close").click();
H.commandPaletteSearch("orders");
- cy.log(
- "The question lost the verification status and does not appear high in search results anymore",
- );
- cy.findAllByTestId("search-result-item").as("searchResults");
- // NOTE: It still appears first, probably due to the recency ranker...
- // I have confirmed that the ranker is no longer active at least.
- // We could probably fix this by opening another question before searching.
- // .first()
- // .should("not.contain", "Orders in a dashboard");
- cy.log("Verified icon should not appear at all in search results");
- cy.get("@searchResults").icon("verified").should("not.exist");
+ cy.log("Verified content should show up higher in search results");
+ cy.findAllByTestId("search-result-item")
+ .first()
+ .within(() => {
+ cy.findByText("Orders in a dashboard");
+ cy.icon("verified_filled");
+ });
+
+ cy.visit("/collection/root");
+ cy.findByRole("table")
+ .findByText("Orders in a dashboard")
+ .closest("td")
+ .icon("verified");
});
});
- },
-);
+ });
+
+ context("token expired or removed", () => {
+ beforeEach(() => {
+ H.activateToken("pro-self-hosted");
+ H.createModerationReview({
+ status: "verified",
+ moderated_item_type: "card",
+ moderated_item_id: ORDERS_COUNT_QUESTION_ID,
+ });
+
+ H.createModerationReview({
+ status: "verified",
+ moderated_item_type: "dashboard",
+ moderated_item_id: ORDERS_DASHBOARD_ID,
+ });
+
+ H.deleteToken();
+ });
+
+ it("should not treat the question as verified anymore", () => {
+ H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
+
+ cy.findByTestId("qb-header").within(() => {
+ cy.findByText("Orders, Count");
+ cy.icon("verified").should("not.exist");
+ });
+
+ H.questionInfoButton().click();
+ H.sidesheet().within(() => {
+ cy.findByRole("tab", { name: "History" }).click();
+ cy.contains(/created this./);
+ cy.contains(/verified this/).should("not.exist");
+ });
+ cy.findByLabelText("Close").click();
+
+ H.openCommandPalette();
+ H.commandPalette()
+ .findByRole("option", { name: "Orders, Count" })
+ .find(".Icon-verified_filled")
+ .should("not.exist");
+ H.commandPaletteInput().type("Orders");
+ H.commandPalette()
+ .findByRole("option", { name: "Orders, Count" })
+ .find(".Icon-verified_filled")
+ .should("not.exist");
+ H.closeCommandPalette();
+
+ H.commandPaletteSearch("orders");
+ cy.log(
+ "The question lost the verification status and does not appear high in search results anymore",
+ );
+ cy.findAllByTestId("search-result-item").as("searchResults");
+ // NOTE: It still appears first, probably due to the recency ranker...
+ // I have confirmed that the ranker is no longer active at least.
+ // We could probably fix this by opening another dashboard before searching.
+ // .first()
+ // .should("not.contain", "Orders, Count");
+ cy.log("Verified icon should not appear at all in search results");
+ cy.get("@searchResults").icon("verified").should("not.exist");
+ });
+
+ it("should not treat the dashboard as verified anymore", () => {
+ H.visitDashboard(ORDERS_DASHBOARD_ID);
+
+ cy.findByTestId("dashboard-header").within(() => {
+ cy.findByText("Orders in a dashboard");
+ cy.icon("verified").should("not.exist");
+ });
+
+ H.openDashboardInfoSidebar();
+ H.sidesheet().within(() => {
+ cy.findByRole("tab", { name: "History" }).click();
+ cy.contains(/created this./);
+ cy.contains(/verified this/).should("not.exist");
+ });
+ cy.findByLabelText("Close").click();
+
+ H.commandPaletteSearch("orders");
+ cy.log(
+ "The question lost the verification status and does not appear high in search results anymore",
+ );
+ cy.findAllByTestId("search-result-item").as("searchResults");
+ // NOTE: It still appears first, probably due to the recency ranker...
+ // I have confirmed that the ranker is no longer active at least.
+ // We could probably fix this by opening another question before searching.
+ // .first()
+ // .should("not.contain", "Orders in a dashboard");
+ cy.log("Verified icon should not appear at all in search results");
+ cy.get("@searchResults").icon("verified").should("not.exist");
+ });
+ });
+});
function verifyQuestion() {
cy.intercept("GET", "/api/card/*").as("loadCard");
diff --git a/e2e/test/scenarios/organization/timelines-question.cy.spec.js b/e2e/test/scenarios/organization/timelines-question.cy.spec.js
index 238ce0ffcbd..d8eee6c5fdd 100644
--- a/e2e/test/scenarios/organization/timelines-question.cy.spec.js
+++ b/e2e/test/scenarios/organization/timelines-question.cy.spec.js
@@ -441,40 +441,36 @@ describe("scenarios > organization > timelines > question", () => {
H.echartsIcon("star", true).should("be.visible");
});
- it(
- "should open the sidebar when clicking an event icon",
- { tags: "@flaky" },
- () => {
- H.createTimelineWithEvents({
- timeline: { name: "Releases" },
- events: [
- { name: "RC1", timestamp: "2024-10-20T00:00:00Z", icon: "star" },
- ],
- });
-
- H.visitQuestion(ORDERS_BY_YEAR_QUESTION_ID);
+ it("should open the sidebar when clicking an event icon", () => {
+ H.createTimelineWithEvents({
+ timeline: { name: "Releases" },
+ events: [
+ { name: "RC1", timestamp: "2024-10-20T00:00:00Z", icon: "star" },
+ ],
+ });
- H.echartsIcon("star").should("be.visible");
- H.echartsIcon("star").click();
-
- // event should be selected in sidebar
- timelineEventCard("RC1").should("be.visible");
- timelineEventCard("RC1").should(
- "have.css",
- "border-left",
- "4px solid rgb(80, 158, 226)",
- );
+ H.visitQuestion(ORDERS_BY_YEAR_QUESTION_ID);
- // after clicking the icon again, it should be deselected in sidebar
- H.echartsIcon("star", true).click();
- timelineEventCard("RC1").should("be.visible");
- timelineEventCard("RC1").should(
- "have.css",
- "border-left",
- "4px solid rgba(0, 0, 0, 0)",
- );
- },
- );
+ H.echartsIcon("star").should("be.visible");
+ H.echartsIcon("star").click();
+
+ // event should be selected in sidebar
+ timelineEventCard("RC1").should("be.visible");
+ timelineEventCard("RC1").should(
+ "have.css",
+ "border-left",
+ "4px solid rgb(80, 158, 226)",
+ );
+
+ // after clicking the icon again, it should be deselected in sidebar
+ H.echartsIcon("star", true).click();
+ timelineEventCard("RC1").should("be.visible");
+ timelineEventCard("RC1").should(
+ "have.css",
+ "border-left",
+ "4px solid rgba(0, 0, 0, 0)",
+ );
+ });
it("should not filter out events in last period (metabase#23336)", () => {
H.createTimelineWithEvents({
diff --git a/e2e/test/scenarios/permissions/admin-permissions.cy.spec.js b/e2e/test/scenarios/permissions/admin-permissions.cy.spec.js
index 2b2f97de7bf..711de338954 100644
--- a/e2e/test/scenarios/permissions/admin-permissions.cy.spec.js
+++ b/e2e/test/scenarios/permissions/admin-permissions.cy.spec.js
@@ -310,7 +310,7 @@ describe("scenarios > admin > permissions", { tags: "@OSS" }, () => {
});
context("group focused view", () => {
- it("shows filterable list of groups", { tags: "@flaky" }, () => {
+ it("shows filterable list of groups", () => {
cy.visit("/admin/permissions");
// no groups selected initially and it shows an empty state
diff --git a/e2e/test/scenarios/permissions/sandboxing/sandboxing-via-api.cy.spec.js b/e2e/test/scenarios/permissions/sandboxing/sandboxing-via-api.cy.spec.js
index ba84501725a..777ce2d0794 100644
--- a/e2e/test/scenarios/permissions/sandboxing/sandboxing-via-api.cy.spec.js
+++ b/e2e/test/scenarios/permissions/sandboxing/sandboxing-via-api.cy.spec.js
@@ -1149,64 +1149,60 @@ describe("admin > permissions > sandboxes (tested via the API)", () => {
cy.contains("37.65");
});
- it(
- "unsaved/dirty query should work on linked table column with multiple dimensions and remapping (metabase#15106)",
- { tags: "@flaky" },
- () => {
- H.remapDisplayValueToFK({
- display_value: ORDERS.USER_ID,
- name: "User ID",
- fk: PEOPLE.NAME,
- });
+ it("unsaved/dirty query should work on linked table column with multiple dimensions and remapping (metabase#15106)", () => {
+ H.remapDisplayValueToFK({
+ display_value: ORDERS.USER_ID,
+ name: "User ID",
+ fk: PEOPLE.NAME,
+ });
- // Remap REVIEWS.PRODUCT_ID Field Type to ORDERS.ID
- cy.request("PUT", `/api/field/${REVIEWS.PRODUCT_ID}`, {
- table_id: REVIEWS_ID,
- special_type: "type/FK",
- name: "PRODUCT_ID",
- fk_target_field_id: ORDERS.ID,
- display_name: "Product ID",
- });
+ // Remap REVIEWS.PRODUCT_ID Field Type to ORDERS.ID
+ cy.request("PUT", `/api/field/${REVIEWS.PRODUCT_ID}`, {
+ table_id: REVIEWS_ID,
+ special_type: "type/FK",
+ name: "PRODUCT_ID",
+ fk_target_field_id: ORDERS.ID,
+ display_name: "Product ID",
+ });
- cy.sandboxTable({
- table_id: ORDERS_ID,
- attribute_remappings: {
- attr_uid: ["dimension", ["field-id", ORDERS.USER_ID]],
- },
- });
+ cy.sandboxTable({
+ table_id: ORDERS_ID,
+ attribute_remappings: {
+ attr_uid: ["dimension", ["field-id", ORDERS.USER_ID]],
+ },
+ });
- cy.sandboxTable({
- table_id: PEOPLE_ID,
- attribute_remappings: {
- attr_uid: ["dimension", ["field-id", PEOPLE.ID]],
- },
- });
+ cy.sandboxTable({
+ table_id: PEOPLE_ID,
+ attribute_remappings: {
+ attr_uid: ["dimension", ["field-id", PEOPLE.ID]],
+ },
+ });
- cy.sandboxTable({
- table_id: REVIEWS_ID,
- attribute_remappings: {
- attr_uid: [
- "dimension",
- [
- "fk->",
- ["field-id", REVIEWS.PRODUCT_ID],
- ["field-id", ORDERS.USER_ID],
- ],
+ cy.sandboxTable({
+ table_id: REVIEWS_ID,
+ attribute_remappings: {
+ attr_uid: [
+ "dimension",
+ [
+ "fk->",
+ ["field-id", REVIEWS.PRODUCT_ID],
+ ["field-id", ORDERS.USER_ID],
],
- },
- });
- cy.signOut();
- cy.signInAsSandboxedUser();
+ ],
+ },
+ });
+ cy.signOut();
+ cy.signInAsSandboxedUser();
- H.openReviewsTable({
- callback: (xhr) => expect(xhr.response.body.error).not.to.exist,
- });
- H.assertQueryBuilderRowCount(57); // test that user is sandboxed - normal users has 1,112 rows
- H.assertDatasetReqIsSandboxed();
+ H.openReviewsTable({
+ callback: (xhr) => expect(xhr.response.body.error).not.to.exist,
+ });
+ H.assertQueryBuilderRowCount(57); // test that user is sandboxed - normal users has 1,112 rows
+ H.assertDatasetReqIsSandboxed();
- // Add positive assertion once this issue is fixed
- },
- );
+ // Add positive assertion once this issue is fixed
+ });
it(
"sandboxed user should receive sandboxed dashboard subscription",
diff --git a/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js b/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
index 59a248492bc..8bbc0dd1fee 100644
--- a/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
+++ b/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
@@ -1730,7 +1730,7 @@ describe("issue 39771", () => {
});
});
-describe("issue 45063", { tags: "@flaky" }, () => {
+describe("issue 45063", () => {
function createGuiQuestion({ sourceTableId }) {
const questionDetails = {
name: "Question",
@@ -1955,7 +1955,7 @@ describe("issue 45063", { tags: "@flaky" }, () => {
});
});
- it("should work with models", { tags: "@flaky" }, () => {
+ it("should work with models", () => {
createGuiModel({ sourceTableId: ORDERS_ID });
verifyRemappedFilter({
visitCard: () => cy.get("@modelId").then(H.visitModel),
diff --git a/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts b/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts
index 5000cd44430..d677c7333ce 100644
--- a/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts
+++ b/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts
@@ -326,76 +326,63 @@ describe(
cy.signInAsAdmin();
});
- it(
- "should work for both simple and nested questions based on previously converted GUI query",
- { tags: "@flaky" },
- () => {
- H.startNewQuestion();
- H.entityPickerModal().within(() => {
- H.entityPickerModalTab("Tables").click();
- cy.findByText(MONGO_DB_NAME).click();
- cy.findByText("Products").click();
- });
-
- cy.log("Simple question");
- cy.findByLabelText("View native query").click();
- cy.findByTestId("native-query-preview-sidebar").within(() => {
- cy.findByText("Native query for this question").should("exist");
- H.NativeEditor.get()
- .should("be.visible")
- .and("contain", "$project")
- .and("contain", "$limit");
+ it("should work for both simple and nested questions based on previously converted GUI query", () => {
+ H.startNewQuestion();
+ H.entityPickerModal().within(() => {
+ H.entityPickerModalTab("Tables").click();
+ cy.findByText(MONGO_DB_NAME).click();
+ cy.findByText("Products").click();
+ });
- cy.button("Convert this question to a native query").click();
- });
+ cy.log("Simple question");
+ cy.findByLabelText("View native query").click();
+ cy.findByTestId("native-query-preview-sidebar").within(() => {
+ cy.findByText("Native query for this question").should("exist");
+ H.NativeEditor.get()
+ .should("be.visible")
+ .and("contain", "$project")
+ .and("contain", "$limit");
- cy.log("Database and table should be pre-selected (metabase#15946)");
- cy.findByTestId("selected-database").should("have.text", MONGO_DB_NAME);
- cy.findByTestId("selected-table").should("have.text", "Products");
- cy.get("[data-testid=cell-data]").should(
- "contain",
- "Small Marble Shoes",
- );
+ cy.button("Convert this question to a native query").click();
+ });
- cy.log("Nested question");
- cy.log(
- "should be possible to save a question and `Explore results` (metabase#32121)",
- );
- H.saveQuestion("foo", undefined, {
- tab: "Browse",
- path: ["Our analytics"],
- });
- cy.findByTestId("qb-header").findByText("Explore results").click();
- cy.get("[data-testid=cell-data]").should(
- "contain",
- "Small Marble Shoes",
- );
+ cy.log("Database and table should be pre-selected (metabase#15946)");
+ cy.findByTestId("selected-database").should("have.text", MONGO_DB_NAME);
+ cy.findByTestId("selected-table").should("have.text", "Products");
+ cy.get("[data-testid=cell-data]").should("contain", "Small Marble Shoes");
- cy.log("The generated query should be valid (metabase#38181)");
- H.openNotebook(); // SQL sidebar state was persisted so it's already open now
- cy.findByTestId("native-query-preview-sidebar").within(() => {
- cy.findByText("Native query for this question").should("exist");
- H.NativeEditor.get()
- .should("be.visible")
- .and("contain", "$project")
- .and("contain", "$limit")
- .and("not.contain", "BsonString")
- .and("not.contain", "BsonInt32");
-
- cy.button("Convert this question to a native query").click();
- });
+ cy.log("Nested question");
+ cy.log(
+ "should be possible to save a question and `Explore results` (metabase#32121)",
+ );
+ H.saveQuestion("foo", undefined, {
+ tab: "Browse",
+ path: ["Our analytics"],
+ });
+ cy.findByTestId("qb-header").findByText("Explore results").click();
+ cy.get("[data-testid=cell-data]").should("contain", "Small Marble Shoes");
+
+ cy.log("The generated query should be valid (metabase#38181)");
+ H.openNotebook(); // SQL sidebar state was persisted so it's already open now
+ cy.findByTestId("native-query-preview-sidebar").within(() => {
+ cy.findByText("Native query for this question").should("exist");
+ H.NativeEditor.get()
+ .should("be.visible")
+ .and("contain", "$project")
+ .and("contain", "$limit")
+ .and("not.contain", "BsonString")
+ .and("not.contain", "BsonInt32");
+
+ cy.button("Convert this question to a native query").click();
+ });
- cy.log(
- "Database and table should be pre-selected (metabase#15946 and/or metabase#40557)",
- );
- cy.findByTestId("selected-database").should("have.text", MONGO_DB_NAME);
- cy.findByTestId("selected-table").should("have.text", "Products");
- cy.get("[data-testid=cell-data]").should(
- "contain",
- "Small Marble Shoes",
- );
- },
- );
+ cy.log(
+ "Database and table should be pre-selected (metabase#15946 and/or metabase#40557)",
+ );
+ cy.findByTestId("selected-database").should("have.text", MONGO_DB_NAME);
+ cy.findByTestId("selected-table").should("have.text", "Products");
+ cy.get("[data-testid=cell-data]").should("contain", "Small Marble Shoes");
+ });
it(
"should work for a nested GUI question (metabase#40557)",
diff --git a/e2e/test/scenarios/question/notebook.cy.spec.js b/e2e/test/scenarios/question/notebook.cy.spec.js
index 39e8d488b74..4cb84608c37 100644
--- a/e2e/test/scenarios/question/notebook.cy.spec.js
+++ b/e2e/test/scenarios/question/notebook.cy.spec.js
@@ -475,57 +475,49 @@ describe("scenarios > question > notebook", { tags: "@slow" }, () => {
H.visualize();
});
- it(
- "should show an info popover when hovering over a field picker option for a table",
- { tags: "@flaky" },
- () => {
- H.startNewQuestion();
- H.entityPickerModal().within(() => {
- H.entityPickerModalTab("Tables").click();
- H.entityPickerModalItem(2, "Orders").click();
- });
- cy.findByTestId("fields-picker").click();
- H.popover()
- .findByText("Total")
- .closest("label")
- .findByLabelText("More info")
- .trigger("mouseover");
-
- H.popover()
- .should("have.length", 2)
- // the info popover is the second in the document
- .last()
- .contains("The total billed amount.");
- },
- );
+ it("should show an info popover when hovering over a field picker option for a table", () => {
+ H.startNewQuestion();
+ H.entityPickerModal().within(() => {
+ H.entityPickerModalTab("Tables").click();
+ H.entityPickerModalItem(2, "Orders").click();
+ });
+ cy.findByTestId("fields-picker").click();
+ H.popover()
+ .findByText("Total")
+ .closest("label")
+ .findByLabelText("More info")
+ .trigger("mouseover");
- it(
- "should show an info popover when hovering over a field picker option for a saved question",
- { tags: "@flaky" },
- () => {
- H.createNativeQuestion({
- name: "question a",
- native: { query: "select 'foo' as a_column" },
- });
- H.startNewQuestion();
- H.entityPickerModal().within(() => {
- H.entityPickerModalTab("Collections").click();
- cy.findByText("question a").click();
- });
- cy.findByTestId("fields-picker").click();
- H.popover()
- .findByText("A_COLUMN")
- .closest("label")
- .findByLabelText("More info")
- .trigger("mouseover");
-
- H.popover()
- .should("have.length", 2)
- // the info popover is the second in the document
- .last()
- .contains("No description");
- },
- );
+ H.popover()
+ .should("have.length", 2)
+ // the info popover is the second in the document
+ .last()
+ .contains("The total billed amount.");
+ });
+
+ it("should show an info popover when hovering over a field picker option for a saved question", () => {
+ H.createNativeQuestion({
+ name: "question a",
+ native: { query: "select 'foo' as a_column" },
+ });
+ H.startNewQuestion();
+ H.entityPickerModal().within(() => {
+ H.entityPickerModalTab("Collections").click();
+ cy.findByText("question a").click();
+ });
+ cy.findByTestId("fields-picker").click();
+ H.popover()
+ .findByText("A_COLUMN")
+ .closest("label")
+ .findByLabelText("More info")
+ .trigger("mouseover");
+
+ H.popover()
+ .should("have.length", 2)
+ // the info popover is the second in the document
+ .last()
+ .contains("No description");
+ });
it("should allow to pick a saved question when there are models", () => {
H.createNativeQuestion({