You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "kgabryje (via GitHub)" <gi...@apache.org> on 2023/04/27 15:57:27 UTC

[GitHub] [superset] kgabryje opened a new pull request, #23849: chore: Add Cypress tests for drill by

kgabryje opened a new pull request, #23849:
URL: https://github.com/apache/superset/pull/23849

   
   ### SUMMARY
   Tested flows:
   - opening the drill by modal -> further drilling -> undo drilling for each supported chart
   - open Table view in drill by modal
   - verify that Edit chart button URL is correct
   - breadcrumbs content
   - metadata bar is present
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #23849: chore: Add Cypress tests for drill by

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #23849:
URL: https://github.com/apache/superset/pull/23849#issuecomment-1525967008

   ## [Codecov](https://codecov.io/gh/apache/superset/pull/23849?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23849](https://codecov.io/gh/apache/superset/pull/23849?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e8819d3) into [master](https://codecov.io/gh/apache/superset/commit/5f035499ac747a9b3113d6abedf2ab5c3090aedf?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5f03549) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head e8819d3 differs from pull request most recent head 1e733dd. Consider uploading reports for the commit 1e733dd to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #23849   +/-   ##
   =======================================
     Coverage   56.76%   56.76%           
   =======================================
     Files        1937     1937           
     Lines       74929    74929           
     Branches     8133     8133           
   =======================================
     Hits        42534    42534           
     Misses      30311    30311           
     Partials     2084     2084           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.01% <ø> (ø)` | |
   | presto | `52.92% <ø> (ø)` | |
   | python | `59.41% <ø> (ø)` | |
   | unit | `52.81% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/23849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...tend/src/components/Chart/DrillBy/DrillByChart.tsx](https://codecov.io/gh/apache/superset/pull/23849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxCeS9EcmlsbEJ5Q2hhcnQudHN4) | `100.00% <ø> (ø)` | |
   | [.../components/Chart/DrillBy/useDisplayModeToggle.tsx](https://codecov.io/gh/apache/superset/pull/23849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxCeS91c2VEaXNwbGF5TW9kZVRvZ2dsZS50c3g=) | `100.00% <ø> (ø)` | |
   | [...c/components/Chart/DrillBy/useResultsTableView.tsx](https://codecov.io/gh/apache/superset/pull/23849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxCeS91c2VSZXN1bHRzVGFibGVWaWV3LnRzeA==) | `100.00% <ø> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] geido commented on a diff in pull request #23849: chore: Add Cypress tests for drill by

Posted by "geido (via GitHub)" <gi...@apache.org>.
geido commented on code in PR #23849:
URL: https://github.com/apache/superset/pull/23849#discussion_r1180311023


##########
superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts:
##########
@@ -0,0 +1,712 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { Interception } from 'cypress/types/net-stubbing';
+import { waitForChartLoad } from 'cypress/utils';
+import { SUPPORTED_CHARTS_DASHBOARD } from 'cypress/utils/urls';
+import { SUPPORTED_TIER1_CHARTS, SUPPORTED_TIER2_CHARTS } from './utils';
+
+const interceptV1ChartData = (alias = 'v1Data') => {
+  cy.intercept('/api/v1/chart/data*').as(alias);
+};
+
+const interceptLegacyChartData = () => {
+  cy.intercept('/superset/explore_json*').as('legacyData');
+};
+
+const interceptFormDataKey = () => {
+  cy.intercept('/api/v1/explore/form_data').as('formDataKey');

Review Comment:
   For these other interceptors, it would be good to place the, in the utils that most make sense. For example, if this request happens only in the dashboard, we could put them in dashboard/utils for reusability



##########
superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts:
##########
@@ -0,0 +1,712 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { Interception } from 'cypress/types/net-stubbing';
+import { waitForChartLoad } from 'cypress/utils';
+import { SUPPORTED_CHARTS_DASHBOARD } from 'cypress/utils/urls';
+import { SUPPORTED_TIER1_CHARTS, SUPPORTED_TIER2_CHARTS } from './utils';
+
+const interceptV1ChartData = (alias = 'v1Data') => {
+  cy.intercept('/api/v1/chart/data*').as(alias);
+};
+
+const interceptLegacyChartData = () => {

Review Comment:
   I think for this you can import the existing `interceptExploreJson` from explore/utils.ts



##########
superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts:
##########
@@ -0,0 +1,712 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { Interception } from 'cypress/types/net-stubbing';
+import { waitForChartLoad } from 'cypress/utils';
+import { SUPPORTED_CHARTS_DASHBOARD } from 'cypress/utils/urls';
+import { SUPPORTED_TIER1_CHARTS, SUPPORTED_TIER2_CHARTS } from './utils';
+
+const interceptV1ChartData = (alias = 'v1Data') => {
+  cy.intercept('/api/v1/chart/data*').as(alias);
+};
+
+const interceptLegacyChartData = () => {
+  cy.intercept('/superset/explore_json*').as('legacyData');
+};
+
+const interceptFormDataKey = () => {
+  cy.intercept('/api/v1/explore/form_data').as('formDataKey');
+};
+
+const closeModal = () => {
+  cy.get('body').then($body => {
+    if ($body.find('[data-test="close-drill-by-modal"]').length) {
+      cy.getBySel('close-drill-by-modal').click({ force: true });
+    }
+  });
+};
+
+const setTopLevelTab = (tabName: string) => {
+  cy.get("div#TABS-TOP div[role='tab']").contains(tabName).click();
+};
+
+const openTableContextMenu = (
+  cellContent: string,
+  tableSelector = "[data-test-viz-type='table']",
+) => {
+  cy.get(tableSelector)
+    .scrollIntoView()
+    .contains(cellContent)
+    .first()
+    .rightclick();
+};
+
+const drillBy = (targetDrillByColumn: string, isLegacy = false) => {
+  if (isLegacy) {
+    interceptLegacyChartData();
+  } else {
+    interceptV1ChartData();
+  }
+
+  cy.get('.ant-dropdown:not(.ant-dropdown-hidden)')
+    .first()
+    .find("[role='menu'] [role='menuitem'] [title='Drill by']")
+    .trigger('mouseover');
+  cy.get(
+    '.ant-dropdown-menu-submenu:not(.ant-dropdown-menu-hidden) [data-test="drill-by-submenu"]',
+  )
+    .find('[role="menuitem"]')
+    .contains(new RegExp(`^${targetDrillByColumn}$`))
+    .first()
+    .click({ force: true });
+
+  if (isLegacy) {
+    return cy.wait('@legacyData');
+  }
+  return cy.wait('@v1Data');
+};
+
+const verifyExpectedFormData = (
+  interceptedRequest: Interception,
+  expectedFormData: Record<string, any>,
+) => {
+  const actualFormData = interceptedRequest.request.body?.form_data;
+  Object.entries(expectedFormData).forEach(([key, val]) => {
+    expect(actualFormData?.[key]).to.eql(val);
+  });
+};
+
+const testEchart = (
+  vizType: string,
+  chartName: string,
+  drillClickCoordinates: [[number, number], [number, number]],
+  furtherDrillDimension = 'name',
+) => {
+  cy.get(`[data-test-viz-type='${vizType}'] canvas`).then($canvas => {
+    // click 'boy'
+    cy.wrap($canvas)
+      .scrollIntoView()
+      .trigger(
+        'mouseover',
+        drillClickCoordinates[0][0],
+        drillClickCoordinates[0][1],
+      )
+      .rightclick(drillClickCoordinates[0][0], drillClickCoordinates[0][1]);
+
+    drillBy('state').then(intercepted => {
+      verifyExpectedFormData(intercepted, {
+        groupby: ['state'],
+        adhoc_filters: [
+          {
+            clause: 'WHERE',
+            comparator: 'boy',
+            expressionType: 'SIMPLE',
+            operator: '==',
+            operatorId: 'EQUALS',
+            subject: 'gender',
+          },
+        ],
+      });
+    });
+
+    cy.getBySel(`"Drill by: ${chartName}-modal"`).as('drillByModal');
+
+    cy.get('@drillByModal')
+      .find('.draggable-trigger')
+      .should('contain', chartName);
+
+    cy.get('@drillByModal')
+      .find('.ant-breadcrumb')
+      .should('be.visible')
+      .and('contain', 'gender (boy)')
+      .and('contain', '/')
+      .and('contain', 'state');
+
+    cy.get('@drillByModal')
+      .find('[data-test="drill-by-chart"]')
+      .should('be.visible');
+
+    // further drill
+    cy.get(`[data-test="drill-by-chart"] canvas`).then($canvas => {

Review Comment:
   Can use the `cy.getBySel` instead



##########
superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts:
##########
@@ -0,0 +1,712 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { Interception } from 'cypress/types/net-stubbing';
+import { waitForChartLoad } from 'cypress/utils';
+import { SUPPORTED_CHARTS_DASHBOARD } from 'cypress/utils/urls';
+import { SUPPORTED_TIER1_CHARTS, SUPPORTED_TIER2_CHARTS } from './utils';
+
+const interceptV1ChartData = (alias = 'v1Data') => {
+  cy.intercept('/api/v1/chart/data*').as(alias);
+};
+
+const interceptLegacyChartData = () => {
+  cy.intercept('/superset/explore_json*').as('legacyData');
+};
+
+const interceptFormDataKey = () => {
+  cy.intercept('/api/v1/explore/form_data').as('formDataKey');
+};
+
+const closeModal = () => {
+  cy.get('body').then($body => {
+    if ($body.find('[data-test="close-drill-by-modal"]').length) {
+      cy.getBySel('close-drill-by-modal').click({ force: true });
+    }
+  });
+};
+
+const setTopLevelTab = (tabName: string) => {

Review Comment:
   I think we have this already in drilltodetail tests. Should it be moved to the utils?



##########
superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts:
##########
@@ -0,0 +1,712 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { Interception } from 'cypress/types/net-stubbing';
+import { waitForChartLoad } from 'cypress/utils';
+import { SUPPORTED_CHARTS_DASHBOARD } from 'cypress/utils/urls';
+import { SUPPORTED_TIER1_CHARTS, SUPPORTED_TIER2_CHARTS } from './utils';
+
+const interceptV1ChartData = (alias = 'v1Data') => {
+  cy.intercept('/api/v1/chart/data*').as(alias);
+};
+
+const interceptLegacyChartData = () => {
+  cy.intercept('/superset/explore_json*').as('legacyData');
+};
+
+const interceptFormDataKey = () => {
+  cy.intercept('/api/v1/explore/form_data').as('formDataKey');
+};
+
+const closeModal = () => {
+  cy.get('body').then($body => {
+    if ($body.find('[data-test="close-drill-by-modal"]').length) {
+      cy.getBySel('close-drill-by-modal').click({ force: true });
+    }
+  });
+};
+
+const setTopLevelTab = (tabName: string) => {
+  cy.get("div#TABS-TOP div[role='tab']").contains(tabName).click();
+};
+
+const openTableContextMenu = (
+  cellContent: string,
+  tableSelector = "[data-test-viz-type='table']",
+) => {
+  cy.get(tableSelector)
+    .scrollIntoView()
+    .contains(cellContent)
+    .first()
+    .rightclick();
+};
+
+const drillBy = (targetDrillByColumn: string, isLegacy = false) => {
+  if (isLegacy) {
+    interceptLegacyChartData();
+  } else {
+    interceptV1ChartData();
+  }
+
+  cy.get('.ant-dropdown:not(.ant-dropdown-hidden)')
+    .first()
+    .find("[role='menu'] [role='menuitem'] [title='Drill by']")
+    .trigger('mouseover');
+  cy.get(
+    '.ant-dropdown-menu-submenu:not(.ant-dropdown-menu-hidden) [data-test="drill-by-submenu"]',
+  )
+    .find('[role="menuitem"]')
+    .contains(new RegExp(`^${targetDrillByColumn}$`))
+    .first()
+    .click({ force: true });
+
+  if (isLegacy) {
+    return cy.wait('@legacyData');
+  }
+  return cy.wait('@v1Data');
+};
+
+const verifyExpectedFormData = (
+  interceptedRequest: Interception,
+  expectedFormData: Record<string, any>,
+) => {
+  const actualFormData = interceptedRequest.request.body?.form_data;
+  Object.entries(expectedFormData).forEach(([key, val]) => {
+    expect(actualFormData?.[key]).to.eql(val);
+  });
+};
+
+const testEchart = (
+  vizType: string,
+  chartName: string,
+  drillClickCoordinates: [[number, number], [number, number]],
+  furtherDrillDimension = 'name',
+) => {
+  cy.get(`[data-test-viz-type='${vizType}'] canvas`).then($canvas => {
+    // click 'boy'
+    cy.wrap($canvas)
+      .scrollIntoView()
+      .trigger(
+        'mouseover',
+        drillClickCoordinates[0][0],
+        drillClickCoordinates[0][1],
+      )
+      .rightclick(drillClickCoordinates[0][0], drillClickCoordinates[0][1]);
+
+    drillBy('state').then(intercepted => {
+      verifyExpectedFormData(intercepted, {
+        groupby: ['state'],
+        adhoc_filters: [
+          {
+            clause: 'WHERE',
+            comparator: 'boy',
+            expressionType: 'SIMPLE',
+            operator: '==',
+            operatorId: 'EQUALS',
+            subject: 'gender',
+          },
+        ],
+      });
+    });
+
+    cy.getBySel(`"Drill by: ${chartName}-modal"`).as('drillByModal');
+
+    cy.get('@drillByModal')
+      .find('.draggable-trigger')
+      .should('contain', chartName);
+
+    cy.get('@drillByModal')
+      .find('.ant-breadcrumb')
+      .should('be.visible')
+      .and('contain', 'gender (boy)')
+      .and('contain', '/')
+      .and('contain', 'state');
+
+    cy.get('@drillByModal')
+      .find('[data-test="drill-by-chart"]')
+      .should('be.visible');
+
+    // further drill
+    cy.get(`[data-test="drill-by-chart"] canvas`).then($canvas => {
+      // click 'other'
+      cy.wrap($canvas)
+        .scrollIntoView()
+        .trigger(
+          'mouseover',
+          drillClickCoordinates[1][0],
+          drillClickCoordinates[1][1],
+        )
+        .rightclick(drillClickCoordinates[1][0], drillClickCoordinates[1][1]);
+
+      drillBy(furtherDrillDimension).then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupby: [furtherDrillDimension],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+            {
+              clause: 'WHERE',
+              comparator: 'other',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'state',
+            },
+          ],
+        });
+      });
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible');
+
+      // undo - back to drill by state
+      interceptV1ChartData('drillByUndo');
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('contain', 'state (other)')
+        .and('contain', furtherDrillDimension)
+        .contains('state (other)')
+        .click();
+      cy.wait('@drillByUndo').then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupby: ['state'],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+          ],
+        });
+      });
+
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('not.contain', 'state (other)')
+        .and('not.contain', furtherDrillDimension)
+        .and('contain', 'state');
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible');
+    });
+  });
+};
+
+describe('Drill by modal', () => {
+  beforeEach(() => {
+    closeModal();
+  });
+  before(() => {
+    cy.visit(SUPPORTED_CHARTS_DASHBOARD);
+  });
+
+  describe('Modal actions + Table', () => {
+    before(() => {
+      closeModal();
+      setTopLevelTab('Tier 1');
+      SUPPORTED_TIER1_CHARTS.forEach(waitForChartLoad);
+    });
+
+    it('opens the modal from the context menu', () => {
+      openTableContextMenu('boy');
+      drillBy('state').then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupby: ['state'],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+          ],
+        });
+      });
+
+      cy.getBySel('"Drill by: Table-modal"').as('drillByModal');
+
+      cy.get('@drillByModal')
+        .find('.draggable-trigger')
+        .should('contain', 'Drill by: Table');
+
+      cy.get('@drillByModal')
+        .find('[data-test="metadata-bar"]')
+        .should('be.visible');
+
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('contain', 'state');
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible')
+        .and('contain', 'state')
+        .and('contain', 'sum__num');
+
+      // further drilling
+      openTableContextMenu('CA', '[data-test="drill-by-chart"]');
+      drillBy('name').then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupby: ['name'],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+            {
+              clause: 'WHERE',
+              comparator: 'CA',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'state',
+            },
+          ],
+        });
+      });
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible')
+        .and('not.contain', 'state')
+        .and('contain', 'name')
+        .and('contain', 'sum__num');
+
+      // undo - back to drill by state
+      interceptV1ChartData('drillByUndo');
+      interceptFormDataKey();
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('contain', 'state (CA)')
+        .and('contain', 'name')
+        .contains('state (CA)')
+        .click();
+      cy.wait('@drillByUndo').then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupby: ['state'],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+          ],
+        });
+      });
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible')
+        .and('not.contain', 'name')
+        .and('contain', 'state')
+        .and('contain', 'sum__num');
+
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('not.contain', 'state (CA)')
+        .and('not.contain', 'name')
+        .and('contain', 'state');
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-display-toggle"]')
+        .contains('Table')
+        .click();
+
+      cy.getBySel('drill-by-chart').should('not.exist');
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-results-table"]')
+        .should('be.visible');
+
+      cy.wait('@formDataKey').then(intercept => {
+        cy.get('@drillByModal')
+          .contains('Edit chart')
+          .should('have.attr', 'href')
+          .and(
+            'contain',
+            `/explore/?form_data_key=${intercept.response?.body?.key}`,
+          );
+      });
+    });
+  });
+
+  describe('Tier 1 charts', () => {
+    before(() => {
+      closeModal();
+      setTopLevelTab('Tier 1');
+      SUPPORTED_TIER1_CHARTS.forEach(waitForChartLoad);
+    });
+
+    it('Pivot Table', () => {
+      openTableContextMenu('boy', "[data-test-viz-type='pivot_table_v2']");
+      drillBy('name').then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupbyRows: ['state'],
+          groupbyColumns: ['name'],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+          ],
+        });
+      });
+
+      cy.getBySel('"Drill by: Pivot Table-modal"').as('drillByModal');
+
+      cy.get('@drillByModal')
+        .find('.draggable-trigger')
+        .should('contain', 'Drill by: Pivot Table');
+
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('contain', 'name');
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible')
+        .and('contain', 'state')
+        .and('contain', 'name')
+        .and('contain', 'sum__num')
+        .and('not.contain', 'Gender');
+
+      openTableContextMenu('CA', '[data-test="drill-by-chart"]');
+      drillBy('ds').then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupbyColumns: ['name'],
+          groupbyRows: ['ds'],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+            {
+              clause: 'WHERE',
+              comparator: 'CA',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'state',
+            },
+          ],
+        });
+      });
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible')
+        .and('contain', 'name')
+        .and('contain', 'ds')
+        .and('contain', 'sum__num')
+        .and('not.contain', 'state');
+
+      interceptV1ChartData('drillByUndo');
+
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('contain', 'name (CA)')
+        .and('contain', 'ds')
+        .contains('name (CA)')
+        .click();
+      cy.wait('@drillByUndo').then(intercepted => {
+        verifyExpectedFormData(intercepted, {
+          groupbyRows: ['state'],
+          groupbyColumns: ['name'],
+          adhoc_filters: [
+            {
+              clause: 'WHERE',
+              comparator: 'boy',
+              expressionType: 'SIMPLE',
+              operator: '==',
+              operatorId: 'EQUALS',
+              subject: 'gender',
+            },
+          ],
+        });
+      });
+
+      cy.get('@drillByModal')
+        .find('[data-test="drill-by-chart"]')
+        .should('be.visible')
+        .and('not.contain', 'ds')
+        .and('contain', 'state')
+        .and('contain', 'name')
+        .and('contain', 'sum__num');
+
+      cy.get('@drillByModal')
+        .find('.ant-breadcrumb')
+        .should('be.visible')
+        .and('contain', 'gender (boy)')
+        .and('contain', '/')
+        .and('not.contain', 'name (CA)')
+        .and('not.contain', 'ds')
+        .and('contain', 'name');
+    });
+
+    it('Line chart', () => {
+      testEchart('echarts_timeseries_line', 'Time-Series Line Chart', [
+        [70, 93],
+        [70, 93],
+      ]);
+    });
+
+    it('Area Chart', () => {
+      testEchart('echarts_area', 'Time-Series Area Chart', [
+        [70, 93],
+        [70, 93],
+      ]);
+    });
+
+    it('Time-Series Scatter Chart', () => {
+      testEchart('echarts_timeseries_scatter', 'Time-Series Scatter Chart', [
+        [70, 93],
+        [70, 93],
+      ]);
+    });
+
+    it('Time-Series Bar Chart V2', () => {
+      testEchart('echarts_timeseries_bar', 'Time-Series Bar Chart V2', [
+        [70, 94],
+        [362, 68],
+      ]);
+    });
+
+    it('Pie Chart', () => {
+      testEchart('pie', 'Pie Chart', [
+        [243, 167],
+        [534, 248],
+      ]);
+    });
+  });
+
+  describe('Tier 2 charts', () => {
+    before(() => {
+      closeModal();
+      setTopLevelTab('Tier 2');
+      SUPPORTED_TIER2_CHARTS.forEach(waitForChartLoad);
+    });
+
+    it('Box Plot Chart', () => {
+      testEchart(
+        'box_plot',
+        'Box Plot Chart',
+        [
+          [139, 277],
+          [787, 441],
+        ],
+        'ds',
+      );
+    });
+
+    it('Time-Series Generic Chart', () => {
+      testEchart('echarts_timeseries', 'Time-Series Generic Chart', [
+        [70, 93],
+        [70, 93],
+      ]);
+    });
+
+    it('Time-Series Smooth Line Chart', () => {
+      testEchart('echarts_timeseries_smooth', 'Time-Series Smooth Line Chart', [
+        [70, 93],
+        [70, 93],
+      ]);
+    });
+
+    it('Time-Series Step Line Chart', () => {
+      testEchart('echarts_timeseries_step', 'Time-Series Step Line Chart', [
+        [70, 93],
+        [70, 93],
+      ]);
+    });
+
+    it('Funnel Chart', () => {
+      testEchart('funnel', 'Funnel Chart', [
+        [154, 80],
+        [421, 39],
+      ]);
+    });
+
+    it('Gauge Chart', () => {
+      testEchart('gauge_chart', 'Gauge Chart', [
+        [151, 95],
+        [300, 143],
+      ]);
+    });
+
+    it('Radar Chart', () => {
+      testEchart('radar', 'Radar Chart', [
+        [182, 49],
+        [423, 91],
+      ]);
+    });
+
+    it('Treemap V2 Chart', () => {
+      testEchart('treemap_v2', 'Treemap V2 Chart', [
+        [145, 84],
+        [220, 105],
+      ]);
+    });
+
+    it.only('Mixed Chart', () => {

Review Comment:
   Ops `only` here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] geido commented on a diff in pull request #23849: chore: Add Cypress tests for drill by

Posted by "geido (via GitHub)" <gi...@apache.org>.
geido commented on code in PR #23849:
URL: https://github.com/apache/superset/pull/23849#discussion_r1180311023


##########
superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts:
##########
@@ -0,0 +1,712 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { Interception } from 'cypress/types/net-stubbing';
+import { waitForChartLoad } from 'cypress/utils';
+import { SUPPORTED_CHARTS_DASHBOARD } from 'cypress/utils/urls';
+import { SUPPORTED_TIER1_CHARTS, SUPPORTED_TIER2_CHARTS } from './utils';
+
+const interceptV1ChartData = (alias = 'v1Data') => {
+  cy.intercept('/api/v1/chart/data*').as(alias);
+};
+
+const interceptLegacyChartData = () => {
+  cy.intercept('/superset/explore_json*').as('legacyData');
+};
+
+const interceptFormDataKey = () => {
+  cy.intercept('/api/v1/explore/form_data').as('formDataKey');

Review Comment:
   For these other interceptors, it would be good to place them in the utils. For example, if this request happens only in the dashboard, we could put them in dashboard/utils for reusability



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje commented on pull request #23849: chore: Add Cypress tests for drill by

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on PR #23849:
URL: https://github.com/apache/superset/pull/23849#issuecomment-1527561167

   Thanks for comments @geido! All addressed


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] geido commented on a diff in pull request #23849: chore: Add Cypress tests for drill by

Posted by "geido (via GitHub)" <gi...@apache.org>.
geido commented on code in PR #23849:
URL: https://github.com/apache/superset/pull/23849#discussion_r1180305876


##########
tests/integration_tests/superset_test_config.py:
##########
@@ -61,7 +61,7 @@
 HIVE_POLL_INTERVAL = 0.1
 
 SQL_MAX_ROW = 10000
-SQLLAB_CTAS_NO_LIMIT = True  # SQL_MAX_ROW will not take affect for the CTA queries
+SQLLAB_CTAS_NO_LIMIT = True  # SQL_MAX_ROW will not take effect for the CTA queries

Review Comment:
   😃



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje merged pull request #23849: chore: Add Cypress tests for drill by

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje merged PR #23849:
URL: https://github.com/apache/superset/pull/23849


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org