You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2022/09/05 15:06:26 UTC

[superset] branch chore/cypress-runtime-enhancements updated (1c4d440794 -> ac2219aea3)

This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a change to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git


    from 1c4d440794 Additional sample data management enhancements
     new 106c917f7b Clean up
     new 1cc7d74b40 Minor enhancements
     new 39b74287e2 Add codeowner
     new 4559fe6337 Move markdown in editmode
     new 05049dee69 Improve test reliability
     add 04dd8d414d fix(celery cache warmup): add auth and use warm_up_cache endpoint (#21076)
     add f2d67f75d0 Revert "ok (#21116)" (#21247)
     add 05bdaf2376 feat(helm): Added env variable SERVER_WORKER_AMOUNT (#21236)
     add ad6b98c2b7 fix(sqllab): update persistent queryEditor keys (#21246)
     add 1aa1864d13 chore: missing IconType on Icons (#21218)
     add 05354a96bf feat: filter with created_by for charts and dashboards (#21199)
     add 944808a0ce fix: Add french translation missing (#20061)
     add 034ee1c3c1 fix(sqllab): unable to create new tabs (#21260)
     add 6223042050 fix: SQLAlchemy coercing subquery warning on RLS (#21257)
     add 0c87ff783a fix: Table content disappears when switching between tabs (#21251)
     add 3f2e894af3 fix: dataset name change and permission change (#21161)
     add 9c4ae2ab7e fix: bump min version of elastic search (#21274)
     add a7fe4850ed fix: dataset exists error in save Dataset modal (#21244)
     add 4b221378cc fix: Revert "#20095 - fix(database): make to display validation error msg when all … (#21277)
     add 5233a9027f chore(sqllab): Remove max-width on side panel (#21280)
     add 6d65f806d8 chore: updating thrift (#20776)
     add 994f327157 chore: Renaming Line Chart to Line Chart v2 (#21278)
     add 9fd752057e feat: adds TLS certificate validation option for SMTP (#21272)
     add ad34f9d740 chore: update release docs (#21270)
     add eb805682e2 feat(embedded): provides filter bar visibility setting on embedded dashboard (#21069) (#21070)
     add 076af6003a fix(explore): Incorrect conversion from simple bool filter to custom sql (#21293)
     add c4b6fc5a6a chore: migrate available_domains to api/v1 (#21173)
     add 742dbdd0a5 fix: Fix console errors about feature flags when running tests (#21275)
     add c3a00d43d0 fix(explore): Time column label not formatted when GENERIC_X_AXES enabled (#21294)
     add 1aeb8fd6b7 fix(plugin-chart-echarts): show zero value in tooltip (#21296)
     add 65a11b6f45 refactor: introduce react-query on api resource hook (#21240)
     add 222f1e7ea8 fix(sqllab): invalid table metadata request (#21304)
     add 2aa3bb6c00 fix(utils): use getaddrinfo for hostname check to support ipv6 (#21042)
     add 38782bb98a fix(utils): use getaddrinfo response to support dual-stack port checks (#21043)
     add 2d70ef670e feat(sqllab): Make LeftBar width resizable (#21300)
     add f71ee2e7bc fix: flaky test when sync metadata (#21306)
     add 60db0bb47e chore: Bump pandas to 1.4.4 (#21285)
     add fbe980779e feat: Adds a helper text option to the Select component (#21269)
     add 99a4f05069 fix: DB connection modal connect bug (#21299)
     add 34a79add04 feat: filter parameters from DB API (#21248)
     add 1cc2148538 fix(ViewQuery-Modal): Copy icon is out of box when resize query modal (#21243)
     add 79525dfaf2 feat(explore): standardized controls for time pivot chart (#21321)
     add d994babe75 fix(dashboard): padding between rows within tabs (#21323)
     add b71182f013 chore: refactor ChartHolder to typescript + tests (#20910)
     add c3f8417139 fix: disallow users from viewing other user's profile on config (#21302)
     new d179a9510d Merge branch 'master' of https://github.com/apache/superset into chore/cypress-runtime-enhancements
     new a9eb065a1f Refactor fav/unfav
     new ac2219aea3 Lint

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/CODEOWNERS                                 |   2 +-
 RELEASING/README.md                                |  12 +-
 docker/pythonpath_dev/superset_config.py           |  10 +
 docs/docs/installation/alerts-reports.mdx          |   1 +
 helm/superset/Chart.yaml                           |   2 +-
 helm/superset/values.yaml                          |  14 +-
 requirements/base.txt                              |   2 +-
 requirements/development.txt                       |   2 +-
 setup.py                                           |   8 +-
 superset-embedded-sdk/README.md                    |   7 +-
 superset-embedded-sdk/src/const.ts                 |   4 +
 superset-embedded-sdk/src/index.ts                 |  21 +-
 .../chart_list/chartlist.applitools.test.ts        |   2 +-
 .../cypress/integration/chart_list/filter.test.ts  |  10 +-
 .../{controls.test.ts => _skip.controls.test.ts}   |   8 +-
 .../{filter.test.ts => _skip.filter.test.ts}       |   9 +-
 .../{key_value.test.ts => _skip.key_value.test.ts} |   8 +-
 ...url_params.test.ts => _skip.url_params.test.ts} |  12 +-
 .../cypress/integration/dashboard/actions.test.js} |  35 +-
 .../dashboard/dashboard.applitools.test.ts         |   2 +-
 .../integration/dashboard/dashboard.helper.ts      |  23 -
 .../integration/dashboard/drilltodetail.test.ts    | 196 ++---
 .../{editsave.test.ts => editmode.test.ts}         | 208 +++--
 .../cypress/integration/dashboard/fav_star.test.js |  64 --
 .../cypress/integration/dashboard/load.test.ts     |   2 +-
 .../cypress/integration/dashboard/markdown.test.ts |  72 --
 .../integration/dashboard/nativeFilters.test.ts    |  20 +-
 .../cypress/integration/dashboard/utils.ts         |  43 +-
 .../integration/dashboard_list/list.test.ts        |   6 +-
 .../cypress-base/cypress/support/index.ts          |  82 +-
 .../cypress-base/cypress/utils/index.ts            | 137 +--
 .../cypress-base/cypress/utils/urls.ts             |   3 +-
 superset-frontend/cypress-base/package-lock.json   |  11 +
 superset-frontend/cypress-base/package.json        |   1 +
 superset-frontend/package-lock.json                |  96 +++
 superset-frontend/package.json                     |   1 +
 .../test/utils/featureFlag.test.ts                 |  48 +-
 .../src/TimePivot/controlPanel.ts                  |   5 +
 .../src/MixedTimeseries/transformProps.ts          |   2 +-
 .../src/Timeseries/Regular/Line/index.ts           |   2 +-
 .../plugin-chart-echarts/src/utils/forecast.ts     |   5 +-
 .../test/utils/forecast.test.ts                    | 223 +++--
 superset-frontend/spec/helpers/shim.ts             |   1 +
 superset-frontend/spec/helpers/testing-library.tsx |   7 +
 superset-frontend/src/SqlLab/App.jsx               |  15 +-
 superset-frontend/src/SqlLab/actions/sqlLab.js     |  10 +-
 .../src/SqlLab/actions/sqlLab.test.js              |  74 +-
 .../SqlLab/components/SaveDatasetModal/index.tsx   |   5 +-
 .../SqlLab/components/SqlEditor/SqlEditor.test.jsx |   9 +-
 .../src/SqlLab/components/SqlEditor/index.jsx      |  54 +-
 .../SqlEditorLeftBar/SqlEditorLeftBar.test.jsx     | 124 +--
 .../SqlLab/components/SqlEditorLeftBar/index.tsx   |  14 +-
 .../TabbedSqlEditors/TabbedSqlEditors.test.jsx     |   9 +-
 .../SqlLab/components/TabbedSqlEditors/index.jsx   |   4 +-
 .../src/SqlLab/components/TableElement/index.tsx   |   1 +
 superset-frontend/src/SqlLab/constants.ts          |   1 +
 superset-frontend/src/SqlLab/main.less             |   5 +-
 superset-frontend/src/SqlLab/reducers/sqlLab.js    |  20 +-
 .../src/SqlLab/reducers/sqlLab.test.js             |  22 +
 .../src/SqlLab/utils/newQueryTabName.ts            |   2 +-
 .../SqlLab/utils/reduxStateToLocalStorageHelper.js |   2 +-
 .../src/components/Chart/DrillDetailModal.tsx      |   7 +-
 .../components/Datasource/DatasourceModal.test.jsx |   9 +-
 .../components/ErrorMessage/ErrorAlert.test.tsx    |   6 -
 .../src/components/ErrorMessage/ErrorAlert.tsx     |  19 +-
 .../ErrorMessage/ErrorMessageWithStackTrace.tsx    |   3 -
 .../src/components/FilterableTable/index.tsx       |   2 +
 superset-frontend/src/components/Icons/index.tsx   |   2 +-
 superset-frontend/src/components/ListView/types.ts |   2 +
 superset-frontend/src/components/Modal/Modal.tsx   |  48 +-
 .../src/components/ResizableSidebar/index.tsx      |  82 ++
 .../useStoredSidebarWidth.test.ts}                 |  41 +-
 .../ResizableSidebar/useStoredSidebarWidth.ts}     |  28 +-
 .../src/components/Select/AsyncSelect.test.tsx     |  74 +-
 .../src/components/Select/AsyncSelect.tsx          |  30 +-
 .../src/components/Select/Select.test.tsx          |  14 +
 superset-frontend/src/components/Select/Select.tsx |  28 +-
 .../src/components/TableSelector/index.tsx         | 132 ++-
 .../src/dashboard/components/AnchorLink/index.tsx  |   3 +-
 .../DashboardBuilder/DashboardBuilder.test.tsx     |  12 +-
 .../DashboardBuilder/DashboardBuilder.tsx          |  88 +-
 .../components/SliceHeaderControls/index.tsx       |   1 +
 .../src/dashboard/components/dnd/DragDroppable.jsx |  20 +-
 .../components/gridComponents/ChartHolder.jsx      | 420 ----------
 .../components/gridComponents/ChartHolder.test.jsx | 138 ---
 .../components/gridComponents/ChartHolder.test.tsx | 360 +++++++-
 .../components/gridComponents/ChartHolder.tsx      | 333 ++++++++
 .../src/dashboard/stylesheets/components/row.less  |   6 +
 superset-frontend/src/dashboard/types.ts           |   5 +
 .../util/useFilterFocusHighlightStyles.test.tsx    | 209 +++++
 .../util/useFilterFocusHighlightStyles.ts          |  91 ++
 superset-frontend/src/hooks/apiResources/index.ts  |   1 +
 .../src/hooks/apiResources/tables.test.ts          | 221 +++++
 superset-frontend/src/hooks/apiResources/tables.ts |  97 +++
 superset-frontend/src/types/Database.ts            |   2 +-
 superset-frontend/src/utils/common.js              |   4 +-
 superset-frontend/src/utils/common.test.jsx        |   9 +-
 superset-frontend/src/utils/localStorageHelpers.ts |   2 +
 superset-frontend/src/views/App.tsx                |  43 +-
 .../src/views/CRUD/chart/ChartList.tsx             |  22 +-
 .../src/views/CRUD/dashboard/DashboardList.tsx     |  10 +-
 .../DatabaseConnectionForm/EncryptedField.tsx      |   3 +-
 .../data/database/DatabaseModal/ExtraOptions.tsx   |   6 +-
 .../data/database/DatabaseModal/index.test.jsx     |   3 +
 .../CRUD/data/database/DatabaseModal/index.tsx     |  71 +-
 .../CRUD/data/database/DatabaseModal/styles.ts     |   3 +-
 .../src/views/CRUD/data/database/types.ts          |   2 +-
 .../Item.tsx => views/QueryProvider.tsx}           |  43 +-
 .../__init__.py                                    |   0
 superset/available_domains/api.py                  |  75 ++
 .../available_domains/schemas.py                   |  11 +-
 superset/charts/api.py                             |   2 +
 superset/charts/filters.py                         |  16 +
 superset/config.py                                 |   6 +-
 superset/connectors/sqla/models.py                 |   7 +-
 superset/constants.py                              |   2 +
 superset/dashboards/api.py                         |   3 +-
 superset/dashboards/filters.py                     |  17 +-
 superset/databases/api.py                          |   2 +-
 superset/databases/commands/create.py              |   6 +
 superset/databases/commands/test_connection.py     |  16 +-
 superset/databases/commands/update.py              |  42 +
 superset/databases/commands/validate.py            |  18 +-
 superset/databases/dao.py                          |  24 +
 superset/databases/schemas.py                      |  17 +-
 superset/datasets/commands/create.py               |  11 +-
 superset/datasets/commands/delete.py               |  24 -
 superset/db_engine_specs/base.py                   |  34 +-
 superset/db_engine_specs/bigquery.py               |  43 +-
 superset/db_engine_specs/gsheets.py                |  41 +-
 superset/db_engine_specs/presto.py                 |   2 +-
 superset/db_engine_specs/trino.py                  |   5 +-
 superset/initialization/__init__.py                |   2 +
 superset/models/core.py                            |  44 +-
 superset/models/helpers.py                         |   2 +-
 superset/security/manager.py                       | 641 ++++++++++----
 superset/tasks/cache.py                            |  98 +--
 superset/templates/superset/basic.html             |   1 -
 superset/translations/fr/LC_MESSAGES/messages.json | 193 ++++-
 superset/translations/fr/LC_MESSAGES/messages.po   | 356 +++++++-
 superset/translations/messages.pot                 |  10 +
 superset/utils/core.py                             |  34 +-
 superset/utils/network.py                          |  25 +-
 .../utils/pandas_postprocessing/contribution.py    |   3 -
 superset/views/base.py                             |   1 +
 superset/views/core.py                             |  14 +-
 .../available_domains}/__init__.py                 |   0
 .../client.py => available_domains/api_tests.py}   |  16 +-
 tests/integration_tests/charts/api_tests.py        |  28 +
 tests/integration_tests/core_tests.py              |  12 +
 tests/integration_tests/dashboards/api_tests.py    |  36 +
 tests/integration_tests/databases/api_tests.py     |   6 +-
 tests/integration_tests/datasets/api_tests.py      |  21 +-
 .../db_engine_specs/postgres_tests.py              |  10 +-
 .../db_engine_specs/trino_tests.py                 |  12 +-
 tests/integration_tests/email_tests.py             |  29 +-
 tests/integration_tests/security_tests.py          | 931 ++++++++++++++++-----
 tests/integration_tests/sqla_models_tests.py       |   7 +-
 tests/integration_tests/strategy_tests.py          | 141 +---
 tests/integration_tests/superset_test_config.py    |   2 +
 tests/unit_tests/conftest.py                       |   4 +
 tests/unit_tests/databases/api_test.py             | 108 ++-
 tests/unit_tests/db_engine_specs/test_bigquery.py  |  36 +-
 tests/unit_tests/db_engine_specs/test_gsheets.py   |  40 +-
 164 files changed, 5395 insertions(+), 2447 deletions(-)
 rename superset-frontend/cypress-base/cypress/integration/dashboard/{controls.test.ts => _skip.controls.test.ts} (95%)
 rename superset-frontend/cypress-base/cypress/integration/dashboard/{filter.test.ts => _skip.filter.test.ts} (93%)
 rename superset-frontend/cypress-base/cypress/integration/dashboard/{key_value.test.ts => _skip.key_value.test.ts} (93%)
 rename superset-frontend/cypress-base/cypress/integration/dashboard/{url_params.test.ts => _skip.url_params.test.ts} (88%)
 copy superset-frontend/{plugins/plugin-chart-echarts/test/utils/controls.test.ts => cypress-base/cypress/integration/dashboard/actions.test.js} (55%)
 rename superset-frontend/cypress-base/cypress/integration/dashboard/{editsave.test.ts => editmode.test.ts} (65%)
 delete mode 100644 superset-frontend/cypress-base/cypress/integration/dashboard/fav_star.test.js
 delete mode 100644 superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts
 create mode 100644 superset-frontend/src/components/ResizableSidebar/index.tsx
 rename superset-frontend/src/{dashboard/components/DashboardBuilder/useStoredFilterBarWidth.test.ts => components/ResizableSidebar/useStoredSidebarWidth.test.ts} (68%)
 rename superset-frontend/src/{dashboard/components/DashboardBuilder/useStoredFilterBarWidth.ts => components/ResizableSidebar/useStoredSidebarWidth.ts} (62%)
 delete mode 100644 superset-frontend/src/dashboard/components/gridComponents/ChartHolder.jsx
 delete mode 100644 superset-frontend/src/dashboard/components/gridComponents/ChartHolder.test.jsx
 create mode 100644 superset-frontend/src/dashboard/components/gridComponents/ChartHolder.tsx
 create mode 100644 superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.test.tsx
 create mode 100644 superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts
 create mode 100644 superset-frontend/src/hooks/apiResources/tables.test.ts
 create mode 100644 superset-frontend/src/hooks/apiResources/tables.ts
 copy superset-frontend/src/{components/Pagination/Item.tsx => views/QueryProvider.tsx} (62%)
 copy superset/{advanced_data_type => available_domains}/__init__.py (100%)
 create mode 100644 superset/available_domains/api.py
 copy docs/static/.asf.yaml => superset/available_domains/schemas.py (73%)
 copy {superset/advanced_data_type => tests/integration_tests/available_domains}/__init__.py (100%)
 copy tests/integration_tests/{fixtures/client.py => available_domains/api_tests.py} (64%)


[superset] 05/08: Improve test reliability

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 05049dee693a9f70e16e7772c308fd33d9a81e1f
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 17:30:25 2022 +0300

    Improve test reliability
---
 .../cypress/integration/dashboard/editmode.test.ts | 136 +++++++++++----------
 1 file changed, 70 insertions(+), 66 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
index 43dd4a4ecc..b926f02b3f 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
@@ -39,10 +39,10 @@ function openProperties() {
     if ($body.find('[data-test="properties-modal-cancel-button"]').length) {
       closeModal();
     }
+    cy.getBySel('actions-trigger').click({ force: true} );
+    cy.getBySel('header-actions-menu').contains('Edit properties').click({ force: true} );
+    cy.wait(500);
   });
-  cy.getBySel('actions-trigger').click({ force: true} );
-  cy.getBySel('header-actions-menu').contains('Edit properties').click({ force: true} );
-  cy.wait(500);
 }
 
 function openAdvancedProperties() {
@@ -85,14 +85,13 @@ function applyChanges() {
 
 function saveChanges() {
   interceptUpdate();
-  cy.getBySel('header-save-button').click();
+  cy.getBySel('header-save-button').click({ force: true });
   cy.wait('@update');
 }
 
 function assertMetadata(text: string) {
   const regex = new RegExp(text);
-  cy.get('.ant-modal-body')
-    .find('#json_metadata')
+  cy.get('#json_metadata')
     .should('be.visible')
     .then(() => {
       const metadata = cy.$$('#json_metadata')[0];
@@ -102,8 +101,17 @@ function assertMetadata(text: string) {
       expect(ace.edit(metadata).getValue()).to.match(regex);
     });
 }
-function clearAll(input: string) {
-  return cy.get(input).type('{selectall}{backspace}');
+function clearMetadata() {
+    cy.get('#json_metadata').then(($jsonmetadata) => {
+      cy.wait(1000);
+      cy.wrap($jsonmetadata).type('{selectall}{backspace}');
+    });
+}
+
+function writeMetadata(metadata: string) {
+  cy.get('#json_metadata').then(($jsonmetadata) => {
+    cy.wrap($jsonmetadata).type(metadata, {parseSpecialCharSequences: false});
+  });
 }
 
 describe('Dashboard edit', () => {
@@ -111,6 +119,58 @@ describe('Dashboard edit', () => {
     cy.preserveLogin();
   });
 
+  describe('Edit properties', () => {
+    before(() => {
+      cy.createSampleDashboards();
+      visitEdit();
+    });
+
+    beforeEach(() => {
+      openProperties();
+    });
+
+    it('should accept a valid color scheme', () => {
+      openAdvancedProperties();
+      clearMetadata()
+      writeMetadata('{"color_scheme":"lyftColors"}');
+      applyChanges();
+      openProperties();
+      openAdvancedProperties();
+      assertMetadata('lyftColors');
+      applyChanges();
+    });
+
+    it('should overwrite the color scheme when advanced is closed', () => {
+      selectColorScheme('d3Category20b');
+      openAdvancedProperties();
+      assertMetadata('d3Category20b');
+      applyChanges();
+    });
+
+    it('should overwrite the color scheme when advanced is open', () => {
+      openAdvancedProperties();
+      selectColorScheme('googleCategory10c');
+      assertMetadata('googleCategory10c');
+      applyChanges();
+    });
+
+    it('should not accept an invalid color scheme', () => {
+      openAdvancedProperties();
+      clearMetadata()
+        writeMetadata('{"color_scheme":"wrongcolorscheme"}');
+        applyChanges();
+        cy.get('.ant-modal-body')
+          .contains('A valid color scheme is required')
+          .should('be.visible');
+    });
+
+    it('should edit the title', () => {
+      cy.getBySel('dashboard-title-input').clear().type('Edited title');
+      applyChanges();
+      cy.getBySel('editable-title-input').should('have.value', 'Edited title');
+    });
+  });
+
   describe('Edit mode', () => {
     before(() => {
       cy.createSampleDashboards();
@@ -198,61 +258,6 @@ describe('Dashboard edit', () => {
     });
   });
 
-  describe('Edit properties', () => {
-    before(() => {
-      cy.createSampleDashboards();
-      visitEdit();
-    });
-
-    beforeEach(() => {
-      openProperties();
-    });
-
-    it('should overwrite the color scheme when advanced is closed', () => {
-      selectColorScheme('d3Category20b');
-      openAdvancedProperties();
-      assertMetadata('d3Category20b');
-      applyChanges();
-    });
-
-    it('should overwrite the color scheme when advanced is open', () => {
-      openAdvancedProperties();
-      selectColorScheme('googleCategory10c');
-      assertMetadata('googleCategory10c');
-      applyChanges();
-    });
-
-    it('should accept a valid color scheme', () => {
-      openAdvancedProperties();
-      clearAll('#json_metadata').then(() => {
-        cy.get('#json_metadata').type('{"color_scheme":"lyftColors"}', { parseSpecialCharSequences: false })
-        applyChanges();
-        openProperties();
-        openAdvancedProperties();
-        assertMetadata('lyftColors');
-        applyChanges();
-      })
-
-    });
-
-    it('should not accept an invalid color scheme', () => {
-      openAdvancedProperties();
-      clearAll('#json_metadata').then(() => {
-        cy.get('#json_metadata').type('{"color_scheme":"wrongcolorscheme"}', { parseSpecialCharSequences: false })
-        applyChanges();
-        cy.get('.ant-modal-body')
-          .contains('A valid color scheme is required')
-          .should('be.visible');
-      })
-    });
-
-    it('should edit the title', () => {
-      cy.getBySel('dashboard-title-input').clear().type('Edited title');
-      applyChanges();
-      cy.getBySel('editable-title-input').should('have.value', 'Edited title');
-    });
-  });
-
   describe('Color schemes', () => {
     beforeEach(() => {
       cy.createSampleDashboards();
@@ -274,14 +279,13 @@ describe('Dashboard edit', () => {
       dragComponent('Top 10 California Names Timeseries');
       openProperties();
       openAdvancedProperties();
-      clearAll('#json_metadata').then(() => {
-        cy.get('#json_metadata').type('{"color_scheme":"lyftColors","label_colors":{"Anthony":"red"}}', { parseSpecialCharSequences: false })
+      clearMetadata()
+        writeMetadata('{"color_scheme":"lyftColors","label_colors":{"Anthony":"red"}}')
         applyChanges();
         saveChanges();
         cy.get('.line .nv-legend-symbol')
           .first()
           .should('have.css', 'fill', 'rgb(255, 0, 0)');
-      });
     });
   });
 


[superset] 01/08: Clean up

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 106c917f7bbf4897622f527e80c1f8085179c15b
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 16:12:05 2022 +0300

    Clean up
---
 .../{controls.test.ts => _skip.controls.test.ts}   |   6 +-
 .../{filter.test.ts => _skip.filter.test.ts}       |   4 +-
 .../{key_value.test.ts => _skip.key_value.test.ts} |   2 +-
 ...url_params.test.ts => _skip.url_params.test.ts} |   4 +-
 .../integration/dashboard/dashboard.helper.ts      |   9 +-
 .../integration/dashboard/drilltodetail.test.ts    | 185 +++++++++++----------
 .../{editsave.test.ts => editmode.test.ts}         |   0
 .../cypress/integration/dashboard/utils.ts         |   8 +
 .../cypress-base/cypress/utils/urls.ts             |   3 +-
 .../src/components/Chart/DrillDetailModal.tsx      |   2 +-
 .../components/SliceHeaderControls/index.tsx       |   1 +
 11 files changed, 122 insertions(+), 102 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/controls.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.controls.test.ts
similarity index 95%
rename from superset-frontend/cypress-base/cypress/integration/dashboard/controls.test.ts
rename to superset-frontend/cypress-base/cypress/integration/dashboard/_skip.controls.test.ts
index 3c772fdca9..1fa60c7f69 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/controls.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.controls.test.ts
@@ -25,14 +25,14 @@ import { WORLD_HEALTH_CHARTS } from './utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
 import { isLegacyResponse } from '../../utils/vizPlugins';
 
-describe('Dashboard top-level controls', () => {
+describe.skip('Dashboard top-level controls', () => {
   beforeEach(() => {
     cy.login();
     cy.visit(WORLD_HEALTH_DASHBOARD);
   });
 
   // flaky test
-  xit('should allow chart level refresh', () => {
+  it('should allow chart level refresh', () => {
     const mapSpec = WORLD_HEALTH_CHARTS.find(
       ({ viz }) => viz === 'world_map',
     ) as ChartSpec;
@@ -58,7 +58,7 @@ describe('Dashboard top-level controls', () => {
     });
   });
 
-  xit('should allow dashboard level force refresh', () => {
+  it('should allow dashboard level force refresh', () => {
     // when charts are not start loading, for example, under a secondary tab,
     // should allow force refresh
     WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.filter.test.ts
similarity index 97%
rename from superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts
rename to superset-frontend/cypress-base/cypress/integration/dashboard/_skip.filter.test.ts
index 389c181cba..25ed5a02a7 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.filter.test.ts
@@ -24,13 +24,13 @@ import {
 import {WORLD_HEALTH_CHARTS } from './utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
 
-describe('Dashboard filter', () => {
+describe.skip('Dashboard filter', () => {
   before(() => {
     cy.login();
     cy.visit(WORLD_HEALTH_DASHBOARD);
   });
 
-  xit('should apply filter', () => {
+  it('should apply filter', () => {
     WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
     getChartAliasesBySpec(
       WORLD_HEALTH_CHARTS.filter(({ viz }) => viz !== 'filter_box'),
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/key_value.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.key_value.test.ts
similarity index 97%
rename from superset-frontend/cypress-base/cypress/integration/dashboard/key_value.test.ts
rename to superset-frontend/cypress-base/cypress/integration/dashboard/_skip.key_value.test.ts
index 42ac6cf7c7..3b2b9ea2d4 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/key_value.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.key_value.test.ts
@@ -27,7 +27,7 @@ interface QueryString {
   native_filters_key: string;
 }
 
-xdescribe('nativefilter url param key', () => {
+describe.skip('nativefilter url param key', () => {
   // const urlParams = { param1: '123', param2: 'abc' };
   before(() => {
     cy.login();
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.url_params.test.ts
similarity index 94%
rename from superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.ts
rename to superset-frontend/cypress-base/cypress/integration/dashboard/_skip.url_params.test.ts
index c5b4c6655f..b0fdff057a 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.url_params.test.ts
@@ -24,7 +24,7 @@ import {
 import { WORLD_HEALTH_CHARTS } from './utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
 
-describe('Dashboard form data', () => {
+describe.skip('Dashboard form data', () => {
   const urlParams = { param1: '123', param2: 'abc' };
   before(() => {
     cy.login();
@@ -32,7 +32,7 @@ describe('Dashboard form data', () => {
     cy.visit(WORLD_HEALTH_DASHBOARD, { qs: urlParams });
   });
 
-  xit('should apply url params to slice requests', () => {
+  it('should apply url params to slice requests', () => {
     cy.intercept('/api/v1/chart/data?*', request => {
       // TODO: export url params to chart data API
       request.body.queries.forEach((query: { url_params: JsonObject }) => {
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
index 9868eb5b5e..e4395ee4cf 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
@@ -21,7 +21,6 @@ import { dashboardView } from 'cypress/support/directories';
 export const USA_BIRTH_NAMES_DASHBOARD = '/superset/dashboard/births/';
 export const testDashboard = '/superset/dashboard/538/';
 export const TABBED_DASHBOARD = '/superset/dashboard/tabbed_dash/';
-export const ECHARTS_DASHBOARD = '/superset/dashboard/echarts_dash/';
 
 export const testItems = {
   dashboard: 'Cypress test Dashboard',
@@ -59,13 +58,7 @@ export const testItems = {
 export const CHECK_DASHBOARD_FAVORITE_ENDPOINT =
   '/superset/favstar/Dashboard/*/count';
 
-export const ECHARTS_CHARTS = [
-  { name: 'Number of Girls', viz: 'big_number_total' },
-  { name: 'Participants', viz: 'big_number' },
-  { name: 'Box plot', viz: 'box_plot' },
-  { name: 'Genders', viz: 'pie' },
-  { name: 'Energy Force Layout', viz: 'graph_chart' },
-] as const;
+
 
 export function resize(selector: string) {
   return {
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
index b3dc40bc35..d57add1531 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
@@ -18,9 +18,11 @@
  */
 import {
   waitForChartLoad,
+} from 'cypress/utils';
+import {
   ECHARTS_CHARTS,
-  ECHARTS_DASHBOARD,
-} from './dashboard.helper';
+} from './utils';
+import {ECHARTS_DASHBOARD} from 'cypress/utils/urls';
 
 function interceptSamples() {
   cy.intercept(`/datasource/samples*`).as('samples');
@@ -52,110 +54,125 @@ function openModalFromChartContext(targetMenuItem: string) {
   cy.wait('@samples');
 }
 
+function closeModal() {
+  cy.get('body').then($body => {
+    if ($body.find('[data-test="close-drilltodetail-modal"]').length) {
+      cy.getBySel('close-drilltodetail-modal').click({ force: true });
+    }
+  });
+}
+
 describe('Drill to detail modal', () => {
-  beforeEach(() => {
-    cy.login();
+  before(() => {
     cy.visit(ECHARTS_DASHBOARD);
     ECHARTS_CHARTS.forEach(waitForChartLoad);
   });
 
-  it('opens the modal from the context menu', () => {
-    openModalFromMenu('big_number_total');
-
-    cy.get("[role='dialog'] .draggable-trigger").should(
-      'contain',
-      'Drill to detail: Number of Girls',
-    );
-  });
-
-  it('refreshes the data', () => {
-    openModalFromMenu('big_number_total');
-    // move to the last page
-    cy.get(".pagination-container [role='navigation'] [role='button']")
-      .eq(7)
-      .click();
-    cy.wait('@samples');
-    // reload
-    cy.get("[aria-label='reload']").click();
-    cy.wait('@samples');
-    // make sure it started back from first page
-    cy.get(".pagination-container [role='navigation'] li.active").should(
-      'contain',
-      '1',
-    );
-  });
-
-  it('paginates', () => {
-    openModalFromMenu('big_number_total');
-    // checking the data
-    cy.get("[data-test='row-count-label']").should('contain', '36.4k rows');
-    cy.get("[role='rowgroup'] [role='row']")
-      .should('have.length', 50)
-      .then($rows => {
-        expect($rows).to.contain('Amy');
-      });
-    // checking the paginated data
-    cy.get(".pagination-container [role='navigation'] [role='button']")
-      .should('have.length', 9)
-      .then($pages => {
-        expect($pages).to.contain('1');
-        expect($pages).to.contain('729');
-      });
-    cy.get(".pagination-container [role='navigation'] [role='button']")
-      .eq(7)
-      .click();
-    cy.wait('@samples');
-    cy.get("[role='rowgroup'] [role='row']")
-      .should('have.length', 46)
-      .then($rows => {
-        expect($rows).to.contain('Victoria');
-      });
+  beforeEach(() => {
+    cy.preserveLogin();
+    closeModal();
   });
 
-  it('clears filters', () => {
-    interceptSamples();
-
-    // opens the modal by clicking on the box on the chart
-    cy.get("[data-test-viz-type='box_plot'] canvas").then($canvas => {
-      const canvasWidth = $canvas.width() || 0;
-      const canvasHeight = $canvas.height() || 0;
-      const canvasCenterX = canvasWidth / 6;
-      const canvasCenterY = canvasHeight / 6;
+  describe('Modal actions', () => {
+    it('opens the modal from the context menu', () => {
+      openModalFromMenu('big_number_total');
 
-      cy.wrap($canvas)
-        .scrollIntoView()
-        .rightclick(canvasCenterX, canvasCenterY, { force: true });
-
-      openModalFromChartContext('Drill to detail by East Asia & Pacific');
-
-      // checking the filter
-      cy.get("[data-test='filter-val']").should(
+      cy.get("[role='dialog'] .draggable-trigger").should(
         'contain',
-        'East Asia & Pacific',
+        'Drill to detail: Number of Girls',
       );
-      cy.get("[data-test='row-count-label']").should('contain', '1.98k rows');
-      cy.get(".pagination-container [role='navigation'] [role='button']")
-        .should('have.length', 9)
-        .then($pages => {
-          expect($pages).to.contain('1');
-          expect($pages).to.contain('40');
-        });
+    });
 
-      // close the filter and test that data was reloaded
-      cy.get("[data-test='filter-col']").find("[aria-label='close']").click();
+    it('refreshes the data', () => {
+      openModalFromMenu('big_number_total');
+      // move to the last page
+      cy.get(".pagination-container [role='navigation'] [role='button']")
+        .eq(7)
+        .click();
+      cy.wait('@samples');
+      // reload
+      cy.get("[aria-label='reload']").click();
       cy.wait('@samples');
-      cy.get("[data-test='row-count-label']").should('contain', '11.8k rows');
+      // make sure it started back from first page
       cy.get(".pagination-container [role='navigation'] li.active").should(
         'contain',
         '1',
       );
+    });
+
+    it('paginates', () => {
+      openModalFromMenu('big_number_total');
+      // checking the data
+      cy.get("[data-test='row-count-label']").should('contain', '36.4k rows');
+      cy.get("[role='rowgroup'] [role='row']")
+        .should('have.length', 50)
+        .then($rows => {
+          expect($rows).to.contain('Amy');
+        });
+      // checking the paginated data
       cy.get(".pagination-container [role='navigation'] [role='button']")
         .should('have.length', 9)
         .then($pages => {
           expect($pages).to.contain('1');
-          expect($pages).to.contain('236');
+          expect($pages).to.contain('729');
+        });
+      cy.get(".pagination-container [role='navigation'] [role='button']")
+        .eq(7)
+        .click();
+      cy.wait('@samples');
+      cy.get("[role='rowgroup'] [role='row']")
+        .should('have.length', 46)
+        .then($rows => {
+          expect($rows).to.contain('Victoria');
         });
     });
+
+    it('clears filters', () => {
+      interceptSamples();
+
+      // opens the modal by clicking on the box on the chart
+      cy.get("[data-test-viz-type='box_plot'] canvas").then($canvas => {
+        const canvasWidth = $canvas.width() || 0;
+        const canvasHeight = $canvas.height() || 0;
+        const canvasCenterX = canvasWidth / 6;
+        const canvasCenterY = canvasHeight / 6;
+
+        cy.wrap($canvas)
+          .scrollIntoView()
+          .rightclick(canvasCenterX, canvasCenterY, { force: true });
+
+        openModalFromChartContext('Drill to detail by East Asia & Pacific');
+
+        // checking the filter
+        cy.get("[data-test='filter-val']").should(
+          'contain',
+          'East Asia & Pacific',
+        );
+        cy.get("[data-test='row-count-label']").should('contain', '1.98k rows');
+        cy.get(".pagination-container [role='navigation'] [role='button']")
+          .should('have.length', 9)
+          .then($pages => {
+            expect($pages).to.contain('1');
+            expect($pages).to.contain('40');
+          });
+
+        // close the filter and test that data was reloaded
+        cy.get("[data-test='filter-col']").find("[aria-label='close']").click();
+        cy.wait('@samples');
+        cy.get("[data-test='row-count-label']").should('contain', '11.8k rows');
+        cy.get(".pagination-container [role='navigation'] li.active").should(
+          'contain',
+          '1',
+        );
+        cy.get(".pagination-container [role='navigation'] [role='button']")
+          .should('have.length', 9)
+          .then($pages => {
+            expect($pages).to.contain('1');
+            expect($pages).to.contain('236');
+          });
+      });
+    });
+
   });
 
   describe('Time-series Bar Chart V2', () => {
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editsave.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
similarity index 100%
rename from superset-frontend/cypress-base/cypress/integration/dashboard/editsave.test.ts
rename to superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
index 072a190314..6e562f5a7e 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
@@ -30,6 +30,14 @@
     { name: 'Box plot', viz: 'box_plot' },
   ] as const;
 
+  export const ECHARTS_CHARTS = [
+    { name: 'Number of Girls', viz: 'big_number_total' },
+    { name: 'Participants', viz: 'big_number' },
+    { name: 'Box plot', viz: 'box_plot' },
+    { name: 'Genders', viz: 'pie' },
+    { name: 'Energy Force Layout', viz: 'graph_chart' },
+  ] as const;
+
 export function interceptGet() {
 cy.intercept('/api/v1/dashboard/*').as('get');
 }
diff --git a/superset-frontend/cypress-base/cypress/utils/urls.ts b/superset-frontend/cypress-base/cypress/utils/urls.ts
index 40eb51a170..beed748e44 100644
--- a/superset-frontend/cypress-base/cypress/utils/urls.ts
+++ b/superset-frontend/cypress-base/cypress/utils/urls.ts
@@ -20,4 +20,5 @@
 export const DASHBOARD_LIST = '/dashboard/list/';
 export const CHART_LIST = '/chart/list/';
 export const WORLD_HEALTH_DASHBOARD = '/superset/dashboard/world_health/';
-export const SAMPLE_DASHBOARD_1 = '/superset/dashboard/1-sample-dashboard/';
\ No newline at end of file
+export const SAMPLE_DASHBOARD_1 = '/superset/dashboard/1-sample-dashboard/';
+export const ECHARTS_DASHBOARD = '/superset/dashboard/echarts_dash/';
\ No newline at end of file
diff --git a/superset-frontend/src/components/Chart/DrillDetailModal.tsx b/superset-frontend/src/components/Chart/DrillDetailModal.tsx
index 128359741b..365fe3abc2 100644
--- a/superset-frontend/src/components/Chart/DrillDetailModal.tsx
+++ b/superset-frontend/src/components/Chart/DrillDetailModal.tsx
@@ -91,7 +91,7 @@ const DrillDetailModal: React.FC<{
           >
             {t('Edit chart')}
           </Button>
-          <Button buttonStyle="primary" buttonSize="small" onClick={closeModal}>
+          <Button data-test="close-drilltodetail-modal" buttonStyle="primary" buttonSize="small" onClick={closeModal}>
             {t('Close')}
           </Button>
         </>
diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
index ee99767b31..057421a9fb 100644
--- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
+++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
@@ -205,6 +205,7 @@ const DashboardChartModalTrigger = ({
                 {t('Edit chart')}
               </Button>
               <Button
+                data-test="close-drilltodetail-modal"
                 buttonStyle="primary"
                 buttonSize="small"
                 onClick={closeModal}


[superset] 07/08: Refactor fav/unfav

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit a9eb065a1f7a090298eb2b0bc525b77a5ae5350b
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 17:50:15 2022 +0300

    Refactor fav/unfav
---
 .../cypress/integration/dashboard/actions.test.js  | 44 +++++++++++++++
 .../integration/dashboard/dashboard.helper.ts      |  3 -
 .../cypress/integration/dashboard/editmode.test.ts |  3 +-
 .../cypress/integration/dashboard/fav_star.test.js | 64 ----------------------
 .../cypress/integration/dashboard/utils.ts         |  8 +++
 .../integration/dashboard_list/list.test.ts        |  6 +-
 6 files changed, 57 insertions(+), 71 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/actions.test.js b/superset-frontend/cypress-base/cypress/integration/dashboard/actions.test.js
new file mode 100644
index 0000000000..32eca632ba
--- /dev/null
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/actions.test.js
@@ -0,0 +1,44 @@
+/**
+ * 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.
+ */
+import { SAMPLE_DASHBOARD_1 } from 'cypress/utils/urls';
+import { interceptFav, interceptUnfav } from './utils';
+
+describe('Dashboard actions', () => {
+  beforeEach(() => {
+    cy.createSampleDashboards();
+    cy.visit(SAMPLE_DASHBOARD_1);
+  });
+
+  it('should allow to favorite/unfavorite dashboard', () => {
+    interceptFav();
+    interceptUnfav();
+
+    cy.getBySel('dashboard-header-container')
+      .find("[aria-label='favorite-unselected']")
+      .click();
+    cy.wait('@select');
+    cy.getBySel('dashboard-header-container')
+      .find("[aria-label='favorite-selected']")
+      .click();
+    cy.wait('@unselect');
+    cy.getBySel('dashboard-header-container')
+      .find("[aria-label='favorite-selected']")
+      .should('not.exist');
+  });
+})
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
index b693097d0f..7201cc203c 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
@@ -55,9 +55,6 @@ export const testItems = {
   filterNumericalColumn: 'SP_RUR_TOTL_ZS',
 };
 
-export const CHECK_DASHBOARD_FAVORITE_ENDPOINT =
-  '/superset/favstar/Dashboard/*/count';
-
 export function cleanUp() {
   cy.deleteDashboardByName(testItems.dashboard);
   cy.deleteDashboardByName(testItems.defaultNameDashboard);
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
index b926f02b3f..90b06d408f 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
@@ -103,8 +103,7 @@ function assertMetadata(text: string) {
 }
 function clearMetadata() {
     cy.get('#json_metadata').then(($jsonmetadata) => {
-      cy.wait(1000);
-      cy.wrap($jsonmetadata).type('{selectall}{backspace}');
+      cy.wrap($jsonmetadata).type('{selectall} {backspace}');
     });
 }
 
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/fav_star.test.js b/superset-frontend/cypress-base/cypress/integration/dashboard/fav_star.test.js
deleted file mode 100644
index 9b527a4c7a..0000000000
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/fav_star.test.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * 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.
- */
-import {
-  CHECK_DASHBOARD_FAVORITE_ENDPOINT,
-} from './dashboard.helper';
-
-import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
-
-describe('Dashboard add to favorite', () => {
-  let isFavoriteDashboard = false;
-
-  beforeEach(() => {
-    cy.login();
-
-    cy.intercept(CHECK_DASHBOARD_FAVORITE_ENDPOINT).as('countFavStar');
-    cy.visit(WORLD_HEALTH_DASHBOARD);
-
-    cy.wait('@countFavStar').then(xhr => {
-      isFavoriteDashboard = xhr.response.body.count === 1;
-    });
-  });
-
-  it('should allow favor/unfavor', () => {
-    if (!isFavoriteDashboard) {
-      cy.get('[data-test="fave-unfave-icon"]')
-        .find('span')
-        .should('have.attr', 'aria-label', 'favorite-unselected');
-      cy.get('[data-test="fave-unfave-icon"]').trigger('click');
-      cy.get('[data-test="fave-unfave-icon"]')
-        .find('span')
-        .should('have.attr', 'aria-label', 'favorite-selected')
-        .and('not.have.attr', 'aria-label', 'favorite-unselected');
-    } else {
-      cy.get('[data-test="fave-unfave-icon"]')
-        .find('span')
-        .should('have.attr', 'aria-label', 'favorite-unselected')
-        .and('not.have.attr', 'aria-label', 'favorite-selected');
-      cy.get('[data-test="fave-unfave-icon"]').trigger('click');
-      cy.get('[data-test="fave-unfave-icon"]')
-        .find('span')
-        .should('have.attr', 'aria-label', 'favorite-unselected')
-        .and('not.have.attr', 'aria-label', 'favorite-selected');
-    }
-
-    // reset to original fav state
-    cy.get('[data-test="fave-unfave-icon"]').trigger('click');
-  });
-});
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
index 6e562f5a7e..36dc54b89f 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
@@ -66,6 +66,14 @@ export function interceptLog() {
   cy.intercept('/superset/log/?explode=events&dashboard_id=*').as('logs');
 }
 
+export function interceptFav() {
+    cy.intercept(`/superset/favstar/Dashboard/*/select/`).as('select');
+}
+
+export function interceptUnfav() {
+    cy.intercept(`/superset/favstar/Dashboard/*/unselect/`).as('unselect');
+}
+
 export function setFilter(filter: string, option: string) {
   interceptFiltering();
 
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard_list/list.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard_list/list.test.ts
index da9d7a4bfc..28caab8753 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard_list/list.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard_list/list.test.ts
@@ -23,6 +23,8 @@ import {
   interceptBulkDelete,
   interceptUpdate,
   interceptDelete,
+  interceptFav,
+  interceptUnfav,
 } from '../dashboard/utils';
 
 function orderAlphabetical() {
@@ -130,8 +132,8 @@ describe('Dashboards list', () => {
     });
 
     it('should allow to favorite/unfavorite dashboard', () => {
-      cy.intercept(`/superset/favstar/Dashboard/*/select/`).as('select');
-      cy.intercept(`/superset/favstar/Dashboard/*/unselect/`).as('unselect');
+      interceptFav();
+      interceptUnfav();
 
       setGridMode('card');
       orderAlphabetical();


[superset] 02/08: Minor enhancements

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 1cc7d74b40736e4da592a79d5700b5fb7d06ca1c
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 16:16:55 2022 +0300

    Minor enhancements
---
 .../integration/dashboard/drilltodetail.test.ts      | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
index d57add1531..55d52d0c57 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
@@ -103,7 +103,7 @@ describe('Drill to detail modal', () => {
     it('paginates', () => {
       openModalFromMenu('big_number_total');
       // checking the data
-      cy.get("[data-test='row-count-label']").should('contain', '36.4k rows');
+      cy.getBySel('row-count-label').should('contain', '36.4k rows');
       cy.get("[role='rowgroup'] [role='row']")
         .should('have.length', 50)
         .then($rows => {
@@ -144,11 +144,11 @@ describe('Drill to detail modal', () => {
         openModalFromChartContext('Drill to detail by East Asia & Pacific');
 
         // checking the filter
-        cy.get("[data-test='filter-val']").should(
+        cy.getBySel('filter-val').should(
           'contain',
           'East Asia & Pacific',
         );
-        cy.get("[data-test='row-count-label']").should('contain', '1.98k rows');
+        cy.getBySel('row-count-label').should('contain', '1.98k rows');
         cy.get(".pagination-container [role='navigation'] [role='button']")
           .should('have.length', 9)
           .then($pages => {
@@ -157,9 +157,9 @@ describe('Drill to detail modal', () => {
           });
 
         // close the filter and test that data was reloaded
-        cy.get("[data-test='filter-col']").find("[aria-label='close']").click();
+        cy.getBySel('filter-col').find("[aria-label='close']").click();
         cy.wait('@samples');
-        cy.get("[data-test='row-count-label']").should('contain', '11.8k rows');
+        cy.getBySel('row-count-label').should('contain', '11.8k rows');
         cy.get(".pagination-container [role='navigation'] li.active").should(
           'contain',
           '1',
@@ -197,7 +197,7 @@ describe('Drill to detail modal', () => {
             .click();
           cy.wait('@samples');
 
-          cy.get("[data-test='filter-val']").then($filters => {
+          cy.getBySel('filter-val').then($filters => {
             expect($filters).to.contain('1965');
             expect($filters).to.contain('boy');
           });
@@ -224,7 +224,7 @@ describe('Drill to detail modal', () => {
         openModalFromChartContext('Drill to detail by East Asia & Pacific');
 
         // checking the filter
-        cy.get("[data-test='filter-val']").should(
+        cy.getBySel('filter-val').should(
           'contain',
           'East Asia & Pacific',
         );
@@ -250,7 +250,7 @@ describe('Drill to detail modal', () => {
         openModalFromChartContext('Drill to detail by boy');
 
         // checking the filtered and paginated data
-        cy.get("[data-test='filter-val']").should('contain', 'boy');
+        cy.getBySel('filter-val').should('contain', 'boy');
       });
     });
   });
@@ -266,7 +266,7 @@ describe('Drill to detail modal', () => {
 
       openModalFromChartContext('Drill to detail');
 
-      cy.get("[data-test='filter-val']").should('not.exist');
+      cy.getBySel('filter-val').should('not.exist');
     });
   });
 
@@ -279,7 +279,7 @@ describe('Drill to detail modal', () => {
 
       openModalFromChartContext('Drill to detail');
 
-      cy.get("[data-test='filter-val']").should('not.exist');
+      cy.getBySel('filter-val').should('not.exist');
 
       // TODO: test clicking on a trendline
       // Cypress is refusing to rightclick on the dot


[superset] 03/08: Add codeowner

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 39b74287e2081cee204cf735d78f644e2cea22c0
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 16:18:12 2022 +0300

    Add codeowner
---
 .github/CODEOWNERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 23b4fe42c5..dc8ce1f3ae 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -19,4 +19,4 @@
 /helm/superset/ @craig-rueda @dpgaspar @villebro
 
 # Notify E2E test maintainers of changes
-/superset-frontend/cypress-base/ @jinghua-qa
+/superset-frontend/cypress-base/ @jinghua-qa @geido


[superset] 04/08: Move markdown in editmode

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4559fe6337423ebc876de9b11751ccf823049ffb
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 16:48:30 2022 +0300

    Move markdown in editmode
---
 .../integration/dashboard/dashboard.helper.ts      | 13 ----
 .../cypress/integration/dashboard/editmode.test.ts | 52 ++++++++++++----
 .../cypress/integration/dashboard/markdown.test.ts | 72 ----------------------
 .../cypress-base/cypress/utils/index.ts            | 11 ++++
 4 files changed, 51 insertions(+), 97 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
index e4395ee4cf..b693097d0f 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
@@ -58,19 +58,6 @@ export const testItems = {
 export const CHECK_DASHBOARD_FAVORITE_ENDPOINT =
   '/superset/favstar/Dashboard/*/count';
 
-
-
-export function resize(selector: string) {
-  return {
-    to(cordX: number, cordY: number) {
-      cy.get(selector)
-        .trigger('mousedown', { which: 1, force: true })
-        .trigger('mousemove', { which: 1, cordX, cordY, force: true })
-        .trigger('mouseup', { which: 1, force: true });
-    },
-  };
-}
-
 export function cleanUp() {
   cy.deleteDashboardByName(testItems.dashboard);
   cy.deleteDashboardByName(testItems.defaultNameDashboard);
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
index 1fd94413c6..43dd4a4ecc 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
@@ -17,7 +17,7 @@
  * under the License.
  */
 import { SAMPLE_DASHBOARD_1 } from 'cypress/utils/urls';
-import { drag } from 'cypress/utils';
+import { drag, resize } from 'cypress/utils';
 import {
   interceptGet,
   interceptUpdate,
@@ -46,15 +46,15 @@ function openProperties() {
 }
 
 function openAdvancedProperties() {
-  return cy
+  cy
     .get('.ant-modal-body')
     .contains('Advanced')
     .should('be.visible')
     .click({ force: true });
 }
 
-function dragChart(chart = 'Unicode Cloud') {
-  drag('[data-test="card-title"]', chart).to(
+function dragComponent(component = 'Unicode Cloud', target='card-title') {
+  drag(`[data-test="${target}"]`, component).to(
     '[data-test="grid-content"] [data-test="dragdroppable-object"]',
   );
 }
@@ -103,8 +103,7 @@ function assertMetadata(text: string) {
     });
 }
 function clearAll(input: string) {
-  cy.get(input).type('{selectall}{backspace}');
-  return cy.wait(500);
+  return cy.get(input).type('{selectall}{backspace}');
 }
 
 describe('Dashboard edit', () => {
@@ -140,7 +139,7 @@ describe('Dashboard edit', () => {
     });
 
     it('should disable the Save button when undoing', () => {
-      dragChart();
+      dragComponent();
       cy.getBySel('header-save-button').should('be.enabled');
       discardChanges();
       cy.getBySel('header-save-button').should('be.disabled');
@@ -158,16 +157,45 @@ describe('Dashboard edit', () => {
     });
 
     it('should add charts', () => {
-      dragChart();
+      dragComponent();
       cy.getBySel('dashboard-component-chart-holder').should('have.length', 1);
     });
 
     it('should remove added charts', () => {
-      dragChart('% Rural');
+      dragComponent('% Rural');
       cy.getBySel('dashboard-component-chart-holder').should('have.length', 1);
       cy.getBySel('dashboard-delete-component-button').click();
       cy.getBySel('dashboard-component-chart-holder').should('have.length', 0);
     });
+
+    it('should add markdown component to dashboard', () => {
+      cy.getBySel('dashboard-builder-component-pane-tabs-navigation')
+        .find('#tabs-tab-2')
+        .click();
+
+      // add new markdown component
+      dragComponent('Markdown', 'new-component');
+
+      cy.get('[data-test="dashboard-markdown-editor"]')
+        .should(
+          'have.text',
+          '✨Markdown✨Markdown✨MarkdownClick here to edit markdown',
+        )
+        .click();
+
+      cy.getBySel('dashboard-component-chart-holder')
+        .contains('Click here to edit [markdown](https://bit.ly/1dQOfRK)');
+
+      cy.getBySel('dashboard-markdown-editor')
+        .click()
+        .type('Test resize');
+
+      resize(
+        '[data-test="dashboard-markdown-editor"] .resizable-container span div:last-child',
+      ).to(500, 600);
+
+      cy.getBySel('dashboard-markdown-editor').contains('Test resize');
+    });
   });
 
   describe('Edit properties', () => {
@@ -232,7 +260,7 @@ describe('Dashboard edit', () => {
     });
 
     it('should apply a valid color scheme', () => {
-      dragChart('Top 10 California Names Timeseries');
+      dragComponent('Top 10 California Names Timeseries');
       openProperties();
       selectColorScheme('lyftColors');
       applyChanges();
@@ -243,7 +271,7 @@ describe('Dashboard edit', () => {
     });
 
     it('label colors should take the precedence', () => {
-      dragChart('Top 10 California Names Timeseries');
+      dragComponent('Top 10 California Names Timeseries');
       openProperties();
       openAdvancedProperties();
       clearAll('#json_metadata').then(() => {
@@ -264,7 +292,7 @@ describe('Dashboard edit', () => {
     });
 
     it('should save', () => {
-      dragChart();
+      dragComponent();
       cy.getBySel('header-save-button').should('be.enabled');
       saveChanges();
       cy.getBySel('dashboard-component-chart-holder').should('have.length', 1);
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts
deleted file mode 100644
index 5d7d818508..0000000000
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * 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.
- */
-import { TABBED_DASHBOARD, resize } from './dashboard.helper';
-import { drag } from 'cypress/utils';
-describe('Dashboard edit markdown', () => {
-  beforeEach(() => {
-    cy.login();
-    cy.visit(TABBED_DASHBOARD);
-  });
-
-  it('should add markdown component to dashboard', () => {
-    cy.get('.header-with-actions')
-      .find('[aria-label="Edit dashboard"]')
-      .click();
-
-    cy.get('[data-test="dashboard-builder-component-pane-tabs-navigation"]')
-      .find('.ant-tabs-tab')
-      .last()
-      .click();
-
-    // lazy load - need to open dropdown for the scripts to load
-    cy.get('.header-with-actions').find('[aria-label="more-horiz"]').click();
-    cy.get('[data-test="grid-row-background--transparent"]')
-      .first()
-      .as('component-background-first');
-    // add new markdown component
-    drag('[data-test="new-component"]', 'Markdown').to(
-      '@component-background-first',
-    );
-    cy.get('[data-test="dashboard-markdown-editor"]')
-      .should(
-        'have.text',
-        '✨Markdown✨Markdown✨MarkdownClick here to edit markdown',
-      )
-      .click();
-
-    cy.get('[data-test="dashboard-component-chart-holder"]')
-      .find('.ace_content')
-      .contains('Click here to edit [markdown](https://bit.ly/1dQOfRK)');
-
-    cy.get('[data-test="dashboard-markdown-editor"]')
-      .click()
-      .type('Test resize');
-
-    resize(
-      '[data-test="dashboard-markdown-editor"] .resizable-container span div:last-child',
-    ).to(500, 600);
-
-    cy.get('[data-test="dashboard-markdown-editor"]').contains('Test resize');
-
-    cy.get('[data-test="nav-list"]:first').click('right', { force: true });
-    cy.get('[data-test="dashboard-component-chart-holder"]')
-      .find('.ace_content')
-      .should('not.exist');
-  });
-});
diff --git a/superset-frontend/cypress-base/cypress/utils/index.ts b/superset-frontend/cypress-base/cypress/utils/index.ts
index 949817c84a..2b2b482803 100644
--- a/superset-frontend/cypress-base/cypress/utils/index.ts
+++ b/superset-frontend/cypress-base/cypress/utils/index.ts
@@ -108,4 +108,15 @@ export function waitForChartLoad(chart: ChartSpec) {
           .trigger('mouseup', { which: 1, force: true });
       },
     };
+  }
+
+  export function resize(selector: string) {
+    return {
+      to(cordX: number, cordY: number) {
+        cy.get(selector)
+          .trigger('mousedown', { which: 1, force: true })
+          .trigger('mousemove', { which: 1, cordX, cordY, force: true })
+          .trigger('mouseup', { which: 1, force: true });
+      },
+    };
   }
\ No newline at end of file


[superset] 08/08: Lint

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit ac2219aea38438e7a765d703b3ebcade1a3b5e69
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 18:06:05 2022 +0300

    Lint
---
 .../chart_list/chartlist.applitools.test.ts        |   2 +-
 .../cypress/integration/chart_list/filter.test.ts  |  10 +-
 .../integration/dashboard/_skip.controls.test.ts   |   2 +-
 .../integration/dashboard/_skip.filter.test.ts     |   5 +-
 .../integration/dashboard/_skip.key_value.test.ts  |   6 +-
 .../integration/dashboard/_skip.url_params.test.ts |   8 +-
 .../cypress/integration/dashboard/actions.test.js  |   2 +-
 .../dashboard/dashboard.applitools.test.ts         |   2 +-
 .../integration/dashboard/drilltodetail.test.ts    |  21 +--
 .../cypress/integration/dashboard/editmode.test.ts |  85 ++++++------
 .../cypress/integration/dashboard/load.test.ts     |   2 +-
 .../integration/dashboard/nativeFilters.test.ts    |  16 +--
 .../cypress/integration/dashboard/utils.ts         |  45 ++++---
 .../cypress-base/cypress/support/index.ts          |  82 ++++++------
 .../cypress-base/cypress/utils/index.ts            | 146 ++++++++++-----------
 .../cypress-base/cypress/utils/urls.ts             |   2 +-
 superset-frontend/cypress-base/package-lock.json   |  11 ++
 superset-frontend/cypress-base/package.json        |   1 +
 .../src/components/Chart/DrillDetailModal.tsx      |   7 +-
 19 files changed, 230 insertions(+), 225 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/chart_list/chartlist.applitools.test.ts b/superset-frontend/cypress-base/cypress/integration/chart_list/chartlist.applitools.test.ts
index 045a8b809a..60bf87ed1d 100644
--- a/superset-frontend/cypress-base/cypress/integration/chart_list/chartlist.applitools.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/chart_list/chartlist.applitools.test.ts
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- import { CHART_LIST } from 'cypress/utils/urls';
+import { CHART_LIST } from 'cypress/utils/urls';
 
 describe('charts list view', () => {
   beforeEach(() => {
diff --git a/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts b/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts
index 0418afd3ff..dffbebd472 100644
--- a/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- import { CHART_LIST } from 'cypress/utils/urls';
- import { setGridMode, clearAllInputs } from 'cypress/utils';
- import { setFilter } from '../explore/utils';
+import { CHART_LIST } from 'cypress/utils/urls';
+import { setGridMode, clearAllInputs } from 'cypress/utils';
+import { setFilter } from '../explore/utils';
 
- describe('Charts filters', () => {
+describe('Charts filters', () => {
   before(() => {
     cy.visit(CHART_LIST);
   });
@@ -97,4 +97,4 @@
       cy.getBySel('table-row').should('have.length', 1);
     });
   });
-});
\ No newline at end of file
+});
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.controls.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.controls.test.ts
index 1fa60c7f69..085ebb1587 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.controls.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.controls.test.ts
@@ -21,8 +21,8 @@ import {
   ChartSpec,
   getChartAliasesBySpec,
 } from 'cypress/utils';
-import { WORLD_HEALTH_CHARTS } from './utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
+import { WORLD_HEALTH_CHARTS } from './utils';
 import { isLegacyResponse } from '../../utils/vizPlugins';
 
 describe.skip('Dashboard top-level controls', () => {
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.filter.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.filter.test.ts
index 25ed5a02a7..f5b617393a 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.filter.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.filter.test.ts
@@ -16,13 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { isLegacyResponse, parsePostForm } from 'cypress/utils';
 import {
+  isLegacyResponse,
+  parsePostForm,
   getChartAliasesBySpec,
   waitForChartLoad,
 } from 'cypress/utils';
-import {WORLD_HEALTH_CHARTS } from './utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
+import { WORLD_HEALTH_CHARTS } from './utils';
 
 describe.skip('Dashboard filter', () => {
   before(() => {
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.key_value.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.key_value.test.ts
index 3b2b9ea2d4..52bc4cd60b 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.key_value.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.key_value.test.ts
@@ -17,11 +17,9 @@
  * under the License.
  */
 import qs from 'querystringify';
-import {
-  waitForChartLoad,
-} from 'cypress/utils';
-import {WORLD_HEALTH_CHARTS} from './utils';
+import { waitForChartLoad } from 'cypress/utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
+import { WORLD_HEALTH_CHARTS } from './utils';
 
 interface QueryString {
   native_filters_key: string;
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.url_params.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.url_params.test.ts
index b0fdff057a..a072cf1207 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.url_params.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/_skip.url_params.test.ts
@@ -16,13 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { parsePostForm, JsonObject } from 'cypress/utils';
-import {
-  waitForChartLoad,
-} from 'cypress/utils';
-
-import { WORLD_HEALTH_CHARTS } from './utils';
+import { parsePostForm, JsonObject, waitForChartLoad } from 'cypress/utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
+import { WORLD_HEALTH_CHARTS } from './utils';
 
 describe.skip('Dashboard form data', () => {
   const urlParams = { param1: '123', param2: 'abc' };
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/actions.test.js b/superset-frontend/cypress-base/cypress/integration/dashboard/actions.test.js
index 32eca632ba..de7c412934 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/actions.test.js
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/actions.test.js
@@ -41,4 +41,4 @@ describe('Dashboard actions', () => {
       .find("[aria-label='favorite-selected']")
       .should('not.exist');
   });
-})
+});
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.applitools.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.applitools.test.ts
index a604ada58a..3269334e8c 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.applitools.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.applitools.test.ts
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { WORLD_HEALTH_CHARTS } from './utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
 import { waitForChartLoad } from 'cypress/utils';
+import { WORLD_HEALTH_CHARTS } from './utils';
 
 describe('Dashboard load', () => {
   beforeEach(() => {
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
index 55d52d0c57..a0d0a86434 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
@@ -16,13 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import {
-  waitForChartLoad,
-} from 'cypress/utils';
-import {
-  ECHARTS_CHARTS,
-} from './utils';
-import {ECHARTS_DASHBOARD} from 'cypress/utils/urls';
+import { waitForChartLoad } from 'cypress/utils';
+import { ECHARTS_DASHBOARD } from 'cypress/utils/urls';
+import { ECHARTS_CHARTS } from './utils';
 
 function interceptSamples() {
   cy.intercept(`/datasource/samples*`).as('samples');
@@ -144,10 +140,7 @@ describe('Drill to detail modal', () => {
         openModalFromChartContext('Drill to detail by East Asia & Pacific');
 
         // checking the filter
-        cy.getBySel('filter-val').should(
-          'contain',
-          'East Asia & Pacific',
-        );
+        cy.getBySel('filter-val').should('contain', 'East Asia & Pacific');
         cy.getBySel('row-count-label').should('contain', '1.98k rows');
         cy.get(".pagination-container [role='navigation'] [role='button']")
           .should('have.length', 9)
@@ -172,7 +165,6 @@ describe('Drill to detail modal', () => {
           });
       });
     });
-
   });
 
   describe('Time-series Bar Chart V2', () => {
@@ -224,10 +216,7 @@ describe('Drill to detail modal', () => {
         openModalFromChartContext('Drill to detail by East Asia & Pacific');
 
         // checking the filter
-        cy.getBySel('filter-val').should(
-          'contain',
-          'East Asia & Pacific',
-        );
+        cy.getBySel('filter-val').should('contain', 'East Asia & Pacific');
       });
     });
   });
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
index 90b06d408f..c4c05160c9 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts
@@ -18,42 +18,39 @@
  */
 import { SAMPLE_DASHBOARD_1 } from 'cypress/utils/urls';
 import { drag, resize } from 'cypress/utils';
-import {
-  interceptGet,
-  interceptUpdate,
-} from './utils';
 import * as ace from 'brace';
-import {interceptFiltering as interceptCharts} from '../explore/utils';
+import { interceptGet, interceptUpdate } from './utils';
+import { interceptFiltering as interceptCharts } from '../explore/utils';
 
 function editDashboard() {
   cy.getBySel('edit-dashboard-button').click();
 }
 
 function closeModal() {
-  cy.getBySel('properties-modal-cancel-button').click({force: true});
+  cy.getBySel('properties-modal-cancel-button').click({ force: true });
 }
 
 function openProperties() {
-  cy.get('body')
-  .then($body => {
+  cy.get('body').then($body => {
     if ($body.find('[data-test="properties-modal-cancel-button"]').length) {
       closeModal();
     }
-    cy.getBySel('actions-trigger').click({ force: true} );
-    cy.getBySel('header-actions-menu').contains('Edit properties').click({ force: true} );
+    cy.getBySel('actions-trigger').click({ force: true });
+    cy.getBySel('header-actions-menu')
+      .contains('Edit properties')
+      .click({ force: true });
     cy.wait(500);
   });
 }
 
 function openAdvancedProperties() {
-  cy
-    .get('.ant-modal-body')
+  cy.get('.ant-modal-body')
     .contains('Advanced')
     .should('be.visible')
     .click({ force: true });
 }
 
-function dragComponent(component = 'Unicode Cloud', target='card-title') {
+function dragComponent(component = 'Unicode Cloud', target = 'card-title') {
   drag(`[data-test="${target}"]`, component).to(
     '[data-test="grid-content"] [data-test="dragdroppable-object"]',
   );
@@ -75,8 +72,12 @@ function visitEdit() {
 }
 
 function selectColorScheme(color: string) {
-    cy.get('[data-test="dashboard-edit-properties-form"] [aria-label="Select color scheme"]').first().click();
-    cy.getBySel(color).click();
+  cy.get(
+    '[data-test="dashboard-edit-properties-form"] [aria-label="Select color scheme"]',
+  )
+    .first()
+    .click();
+  cy.getBySel(color).click();
 }
 
 function applyChanges() {
@@ -102,14 +103,14 @@ function assertMetadata(text: string) {
     });
 }
 function clearMetadata() {
-    cy.get('#json_metadata').then(($jsonmetadata) => {
-      cy.wrap($jsonmetadata).type('{selectall} {backspace}');
-    });
+  cy.get('#json_metadata').then($jsonmetadata => {
+    cy.wrap($jsonmetadata).type('{selectall} {backspace}');
+  });
 }
 
 function writeMetadata(metadata: string) {
-  cy.get('#json_metadata').then(($jsonmetadata) => {
-    cy.wrap($jsonmetadata).type(metadata, {parseSpecialCharSequences: false});
+  cy.get('#json_metadata').then($jsonmetadata => {
+    cy.wrap($jsonmetadata).type(metadata, { parseSpecialCharSequences: false });
   });
 }
 
@@ -130,7 +131,7 @@ describe('Dashboard edit', () => {
 
     it('should accept a valid color scheme', () => {
       openAdvancedProperties();
-      clearMetadata()
+      clearMetadata();
       writeMetadata('{"color_scheme":"lyftColors"}');
       applyChanges();
       openProperties();
@@ -155,12 +156,12 @@ describe('Dashboard edit', () => {
 
     it('should not accept an invalid color scheme', () => {
       openAdvancedProperties();
-      clearMetadata()
-        writeMetadata('{"color_scheme":"wrongcolorscheme"}');
-        applyChanges();
-        cy.get('.ant-modal-body')
-          .contains('A valid color scheme is required')
-          .should('be.visible');
+      clearMetadata();
+      writeMetadata('{"color_scheme":"wrongcolorscheme"}');
+      applyChanges();
+      cy.get('.ant-modal-body')
+        .contains('A valid color scheme is required')
+        .should('be.visible');
     });
 
     it('should edit the title', () => {
@@ -193,7 +194,9 @@ describe('Dashboard edit', () => {
       interceptCharts();
       cy.getBySel('dashboard-charts-filter-search-input').type('Unicode');
       cy.wait('@filtering');
-      cy.getBySel('chart-card').should('have.length', 1).contains('Unicode Cloud');
+      cy.getBySel('chart-card')
+        .should('have.length', 1)
+        .contains('Unicode Cloud');
       cy.getBySel('dashboard-charts-filter-search-input').clear();
     });
 
@@ -203,7 +206,6 @@ describe('Dashboard edit', () => {
       discardChanges();
       cy.getBySel('header-save-button').should('be.disabled');
     });
-
   });
 
   describe('Components', () => {
@@ -242,12 +244,11 @@ describe('Dashboard edit', () => {
         )
         .click();
 
-      cy.getBySel('dashboard-component-chart-holder')
-        .contains('Click here to edit [markdown](https://bit.ly/1dQOfRK)');
+      cy.getBySel('dashboard-component-chart-holder').contains(
+        'Click here to edit [markdown](https://bit.ly/1dQOfRK)',
+      );
 
-      cy.getBySel('dashboard-markdown-editor')
-        .click()
-        .type('Test resize');
+      cy.getBySel('dashboard-markdown-editor').click().type('Test resize');
 
       resize(
         '[data-test="dashboard-markdown-editor"] .resizable-container span div:last-child',
@@ -278,13 +279,15 @@ describe('Dashboard edit', () => {
       dragComponent('Top 10 California Names Timeseries');
       openProperties();
       openAdvancedProperties();
-      clearMetadata()
-        writeMetadata('{"color_scheme":"lyftColors","label_colors":{"Anthony":"red"}}')
-        applyChanges();
-        saveChanges();
-        cy.get('.line .nv-legend-symbol')
-          .first()
-          .should('have.css', 'fill', 'rgb(255, 0, 0)');
+      clearMetadata();
+      writeMetadata(
+        '{"color_scheme":"lyftColors","label_colors":{"Anthony":"red"}}',
+      );
+      applyChanges();
+      saveChanges();
+      cy.get('.line .nv-legend-symbol')
+        .first()
+        .should('have.css', 'fill', 'rgb(255, 0, 0)');
     });
   });
 
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/load.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/load.test.ts
index f1c374b158..cd8ab210c6 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/load.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/load.test.ts
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { WORLD_HEALTH_CHARTS, interceptLog } from './utils';
 import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
 import { waitForChartLoad } from 'cypress/utils';
+import { WORLD_HEALTH_CHARTS, interceptLog } from './utils';
 
 describe('Dashboard load', () => {
   before(() => {
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
index 0f50d4dd9d..cde4f70613 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
@@ -23,14 +23,12 @@ import {
   exploreView,
   dataTestChartName,
 } from 'cypress/support/directories';
-import {
-  cleanUp,
-  copyTestDashboard,
-  testItems,
-} from './dashboard.helper';
 import { waitForChartLoad } from 'cypress/utils';
-import {WORLD_HEALTH_CHARTS} from './utils';
-import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
+import {
+  WORLD_HEALTH_DASHBOARD,
+  DASHBOARD_LIST,
+  CHART_LIST,
+} from 'cypress/utils/urls';
 
 import {
   addCountryCodeFilter,
@@ -57,8 +55,8 @@ import {
   valueNativeFilterOptions,
   validateFilterNameOnDashboard,
 } from './nativeFilter.helper';
-import { DASHBOARD_LIST } from 'cypress/utils/urls';
-import { CHART_LIST } from 'cypress/utils/urls';
+import { WORLD_HEALTH_CHARTS } from './utils';
+import { cleanUp, copyTestDashboard, testItems } from './dashboard.helper';
 
 // TODO: fix flaky init logic and re-enable
 const milliseconds = new Date().getTime();
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
index 36dc54b89f..19335ed3de 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
@@ -17,29 +17,29 @@
  * under the License.
  */
 
- export const WORLD_HEALTH_CHARTS = [
-    { name: '% Rural', viz: 'world_map' },
-    { name: 'Most Populated Countries', viz: 'table' },
-    { name: 'Region Filter', viz: 'filter_box' },
-    { name: "World's Population", viz: 'big_number' },
-    { name: 'Growth Rate', viz: 'line' },
-    { name: 'Rural Breakdown', viz: 'sunburst' },
-    { name: "World's Pop Growth", viz: 'area' },
-    { name: 'Life Expectancy VS Rural %', viz: 'bubble' },
-    { name: 'Treemap', viz: 'treemap' },
-    { name: 'Box plot', viz: 'box_plot' },
-  ] as const;
+export const WORLD_HEALTH_CHARTS = [
+  { name: '% Rural', viz: 'world_map' },
+  { name: 'Most Populated Countries', viz: 'table' },
+  { name: 'Region Filter', viz: 'filter_box' },
+  { name: "World's Population", viz: 'big_number' },
+  { name: 'Growth Rate', viz: 'line' },
+  { name: 'Rural Breakdown', viz: 'sunburst' },
+  { name: "World's Pop Growth", viz: 'area' },
+  { name: 'Life Expectancy VS Rural %', viz: 'bubble' },
+  { name: 'Treemap', viz: 'treemap' },
+  { name: 'Box plot', viz: 'box_plot' },
+] as const;
 
-  export const ECHARTS_CHARTS = [
-    { name: 'Number of Girls', viz: 'big_number_total' },
-    { name: 'Participants', viz: 'big_number' },
-    { name: 'Box plot', viz: 'box_plot' },
-    { name: 'Genders', viz: 'pie' },
-    { name: 'Energy Force Layout', viz: 'graph_chart' },
-  ] as const;
+export const ECHARTS_CHARTS = [
+  { name: 'Number of Girls', viz: 'big_number_total' },
+  { name: 'Participants', viz: 'big_number' },
+  { name: 'Box plot', viz: 'box_plot' },
+  { name: 'Genders', viz: 'pie' },
+  { name: 'Energy Force Layout', viz: 'graph_chart' },
+] as const;
 
 export function interceptGet() {
-cy.intercept('/api/v1/dashboard/*').as('get');
+  cy.intercept('/api/v1/dashboard/*').as('get');
 }
 
 export function interceptFiltering() {
@@ -67,11 +67,11 @@ export function interceptLog() {
 }
 
 export function interceptFav() {
-    cy.intercept(`/superset/favstar/Dashboard/*/select/`).as('select');
+  cy.intercept(`/superset/favstar/Dashboard/*/select/`).as('select');
 }
 
 export function interceptUnfav() {
-    cy.intercept(`/superset/favstar/Dashboard/*/unselect/`).as('unselect');
+  cy.intercept(`/superset/favstar/Dashboard/*/unselect/`).as('unselect');
 }
 
 export function setFilter(filter: string, option: string) {
@@ -82,4 +82,3 @@ export function setFilter(filter: string, option: string) {
 
   cy.wait('@filtering');
 }
-
diff --git a/superset-frontend/cypress-base/cypress/support/index.ts b/superset-frontend/cypress-base/cypress/support/index.ts
index 1c374eafc6..8ddb1d082a 100644
--- a/superset-frontend/cypress-base/cypress/support/index.ts
+++ b/superset-frontend/cypress-base/cypress/support/index.ts
@@ -28,14 +28,14 @@ let CHART_FIXTURES: Record<string, any>[] = [];
 
 Cypress.Commands.add('loadChartFixtures', () =>
   cy.fixture('charts.json').then(charts => {
-    CHART_FIXTURES = charts
-  })
+    CHART_FIXTURES = charts;
+  }),
 );
 
 Cypress.Commands.add('loadDashboardFixtures', () =>
   cy.fixture('dashboards.json').then(dashboards => {
-    DASHBOARD_FIXTURES = dashboards
-  })
+    DASHBOARD_FIXTURES = dashboards;
+  }),
 );
 
 before(() => {
@@ -50,14 +50,16 @@ Cypress.Commands.add('cleanDashboards', () =>
   cy.getDashboards().then((sampleDashboards: any) => {
     const deletableDashboards = [];
     for (let i = 0; i < DASHBOARD_FIXTURES.length; i += 1) {
-      const isInDb = sampleDashboards.find((d: any) => d.dashboard_title === DASHBOARD_FIXTURES[i].dashboard_title);
+      const fixture = DASHBOARD_FIXTURES[i];
+      const isInDb = sampleDashboards.find(
+        (d: any) => d.dashboard_title === fixture.dashboard_title,
+      );
       if (isInDb) {
         deletableDashboards.push(isInDb.id);
       }
     }
     if (deletableDashboards.length) {
-      return cy
-      .request({
+      cy.request({
         failOnStatusCode: false,
         method: 'DELETE',
         url: `api/v1/dashboard/?q=!(${deletableDashboards.join(',')})`,
@@ -70,24 +72,25 @@ Cypress.Commands.add('cleanDashboards', () =>
           'X-CSRFToken': `${window.localStorage.getItem('access_token')}`,
           Referer: `${Cypress.config().baseUrl}/`,
         },
-      })
-      .then(resp => resp)
+      }).then(resp => resp);
     }
-  })
+  }),
 );
 
 Cypress.Commands.add('cleanCharts', () =>
   cy.getCharts().then((sampleCharts: any) => {
     const deletableCharts = [];
     for (let i = 0; i < CHART_FIXTURES.length; i += 1) {
-      const isInDb = sampleCharts.find((c: any) => c.slice_name === CHART_FIXTURES[i].slice_name);
+      const fixture = CHART_FIXTURES[i];
+      const isInDb = sampleCharts.find(
+        (c: any) => c.slice_name === fixture.slice_name,
+      );
       if (isInDb) {
         deletableCharts.push(isInDb.id);
       }
     }
     if (deletableCharts) {
-      return cy
-      .request({
+      cy.request({
         failOnStatusCode: false,
         method: 'DELETE',
         url: `api/v1/chart/?q=!(${deletableCharts.join(',')})`,
@@ -100,10 +103,9 @@ Cypress.Commands.add('cleanCharts', () =>
           'X-CSRFToken': `${window.localStorage.getItem('access_token')}`,
           Referer: `${Cypress.config().baseUrl}/`,
         },
-      })
-      .then(resp => resp)
+      }).then(resp => resp);
     }
-  })
+  }),
 );
 
 Cypress.Commands.add('getBySel', (selector, ...args) =>
@@ -252,9 +254,9 @@ Cypress.Commands.add('createSampleDashboards', () =>
           'X-CSRFToken': `${window.localStorage.getItem('access_token')}`,
           Referer: `${Cypress.config().baseUrl}/`,
         },
-      })
+      });
     }
-  })
+  }),
 );
 
 Cypress.Commands.add('createSampleCharts', () =>
@@ -274,9 +276,9 @@ Cypress.Commands.add('createSampleCharts', () =>
           'X-CSRFToken': `${window.localStorage.getItem('access_token')}`,
           Referer: `${Cypress.config().baseUrl}/`,
         },
-      })
+      });
     }
-  })
+  }),
 );
 
 Cypress.Commands.add(
@@ -289,26 +291,28 @@ Cypress.Commands.add(
       if (dashboard) {
         cy.deleteDashboard(dashboard.id, failOnStatusCode);
       }
-    })
+    }),
 );
 
-Cypress.Commands.add('deleteDashboard', (id: number, failOnStatusCode = false) =>
-  cy
-    .request({
-      failOnStatusCode,
-      method: 'DELETE',
-      url: `api/v1/dashboard/${id}`,
-      headers: {
-        Cookie: `csrf_access_token=${window.localStorage.getItem(
-          'access_token',
-        )}`,
-        'Content-Type': 'application/json',
-        Authorization: `Bearer ${TokenName}`,
-        'X-CSRFToken': `${window.localStorage.getItem('access_token')}`,
-        Referer: `${Cypress.config().baseUrl}/`,
-      },
-    })
-    .then(resp => resp),
+Cypress.Commands.add(
+  'deleteDashboard',
+  (id: number, failOnStatusCode = false) =>
+    cy
+      .request({
+        failOnStatusCode,
+        method: 'DELETE',
+        url: `api/v1/dashboard/${id}`,
+        headers: {
+          Cookie: `csrf_access_token=${window.localStorage.getItem(
+            'access_token',
+          )}`,
+          'Content-Type': 'application/json',
+          Authorization: `Bearer ${TokenName}`,
+          'X-CSRFToken': `${window.localStorage.getItem('access_token')}`,
+          Referer: `${Cypress.config().baseUrl}/`,
+        },
+      })
+      .then(resp => resp),
 );
 
 Cypress.Commands.add('getDashboards', () =>
@@ -364,5 +368,5 @@ Cypress.Commands.add(
       if (chart) {
         cy.deleteChart(chart.id, failOnStatusCode);
       }
-    })
+    }),
 );
diff --git a/superset-frontend/cypress-base/cypress/utils/index.ts b/superset-frontend/cypress-base/cypress/utils/index.ts
index 2b2b482803..b685cc01e8 100644
--- a/superset-frontend/cypress-base/cypress/utils/index.ts
+++ b/superset-frontend/cypress-base/cypress/utils/index.ts
@@ -21,9 +21,9 @@ import { getChartAlias, Slice } from 'cypress/utils/vizPlugins';
 export * from './vizPlugins';
 export { default as parsePostForm } from './parsePostForm';
 export interface ChartSpec {
-    name: string;
-    viz: string;
-  }
+  name: string;
+  viz: string;
+}
 
 export function setGridMode(type: 'card' | 'list') {
   cy.get(`[aria-label="${type}-view"]`).click();
@@ -34,89 +34,89 @@ export function toggleBulkSelect() {
 }
 
 export function clearAllInputs() {
-    cy.get('[aria-label="close-circle"]').click({ multiple: true, force: true });
+  cy.get('[aria-label="close-circle"]').click({ multiple: true, force: true });
 }
 
-  const toSlicelike = ($chart: JQuery<HTMLElement>): Slice => ({
-    slice_id: parseInt($chart.attr('data-test-chart-id')!, 10),
-    form_data: {
-      viz_type: $chart.attr('data-test-viz-type')!,
-    },
-  });
+const toSlicelike = ($chart: JQuery<HTMLElement>): Slice => ({
+  slice_id: parseInt($chart.attr('data-test-chart-id')!, 10),
+  form_data: {
+    viz_type: $chart.attr('data-test-viz-type')!,
+  },
+});
 
-  export function getChartAliasBySpec(chart: ChartSpec) {
-    return getChartGridComponent(chart).then($chart =>
-      cy.wrap(getChartAlias(toSlicelike($chart))),
-    );
-  }
+export function getChartAliasBySpec(chart: ChartSpec) {
+  return getChartGridComponent(chart).then($chart =>
+    cy.wrap(getChartAlias(toSlicelike($chart))),
+  );
+}
 
-  export function getChartAliasesBySpec(charts: readonly ChartSpec[]) {
-    const aliases: string[] = [];
-    charts.forEach(chart =>
-      getChartAliasBySpec(chart).then(alias => {
-        aliases.push(alias);
-      }),
-    );
-    // Wrapping the aliases is key.
-    // That way callers can chain off this function
-    // and actually get the list of aliases.
-    return cy.wrap(aliases);
-  }
+export function getChartAliasesBySpec(charts: readonly ChartSpec[]) {
+  const aliases: string[] = [];
+  charts.forEach(chart =>
+    getChartAliasBySpec(chart).then(alias => {
+      aliases.push(alias);
+    }),
+  );
+  // Wrapping the aliases is key.
+  // That way callers can chain off this function
+  // and actually get the list of aliases.
+  return cy.wrap(aliases);
+}
 
 export function getChartGridComponent({ name, viz }: ChartSpec) {
-    return cy
-      .get(`[data-test-chart-name="${name}"]`)
-      .should('have.attr', 'data-test-viz-type', viz);
-  }
+  return cy
+    .get(`[data-test-chart-name="${name}"]`)
+    .should('have.attr', 'data-test-viz-type', viz);
+}
 
 export function waitForChartLoad(chart: ChartSpec) {
-    return getChartGridComponent(chart).then(gridComponent => {
-      const chartId = gridComponent.attr('data-test-chart-id');
-      // the chart should load in under half a minute
-      return (
-        cy
-          // this id only becomes visible when the chart is loaded
-          .get(`#chart-id-${chartId}`, {
-            timeout: 30000,
-          })
-          .should('be.visible')
-          // return the chart grid component
-          .then(() => gridComponent)
-      );
-    });
-  }
+  return getChartGridComponent(chart).then(gridComponent => {
+    const chartId = gridComponent.attr('data-test-chart-id');
+    // the chart should load in under half a minute
+    return (
+      cy
+        // this id only becomes visible when the chart is loaded
+        .get(`#chart-id-${chartId}`, {
+          timeout: 30000,
+        })
+        .should('be.visible')
+        // return the chart grid component
+        .then(() => gridComponent)
+    );
+  });
+}
 
 /**
  * Drag an element and drop it to another element.
  * Usage:
  *    drag(source).to(target);
  */
- export function drag(selector: string, content: string | number | RegExp) {
-    const dataTransfer = { data: {} };
-    return {
-      to(target: string | Cypress.Chainable) {
-        cy.get('.dragdroppable')
-          .contains(selector, content)
-          .trigger('mousedown', { which: 1, force: true })
-          .trigger('dragstart', { dataTransfer, force: true })
-          .trigger('drag', {force: true});
+export function drag(selector: string, content: string | number | RegExp) {
+  const dataTransfer = { data: {} };
+  return {
+    to(target: string | Cypress.Chainable) {
+      cy.get('.dragdroppable')
+        .contains(selector, content)
+        .trigger('mousedown', { which: 1, force: true })
+        .trigger('dragstart', { dataTransfer, force: true })
+        .trigger('drag', { force: true });
 
-        (typeof target === 'string' ? cy.get(target) : target)
-          .trigger('dragover', { dataTransfer, force: true })
-          .trigger('drop', { dataTransfer, force: true })
-          .trigger('dragend', { dataTransfer, force: true })
-          .trigger('mouseup', { which: 1, force: true });
-      },
-    };
-  }
+      (typeof target === 'string' ? cy.get(target) : target)
+        .trigger('dragover', { dataTransfer, force: true })
+        .trigger('drop', { dataTransfer, force: true })
+        .trigger('dragend', { dataTransfer, force: true })
+        .trigger('mouseup', { which: 1, force: true });
+    },
+  };
+}
 
-  export function resize(selector: string) {
-    return {
-      to(cordX: number, cordY: number) {
-        cy.get(selector)
-          .trigger('mousedown', { which: 1, force: true })
-          .trigger('mousemove', { which: 1, cordX, cordY, force: true })
-          .trigger('mouseup', { which: 1, force: true });
-      },
-    };
-  }
\ No newline at end of file
+export function resize(selector: string) {
+  return {
+    to(cordX: number, cordY: number) {
+      cy.get(selector)
+        .trigger('mousedown', { which: 1, force: true })
+        .trigger('mousemove', { which: 1, cordX, cordY, force: true })
+        .trigger('mouseup', { which: 1, force: true });
+    },
+  };
+}
diff --git a/superset-frontend/cypress-base/cypress/utils/urls.ts b/superset-frontend/cypress-base/cypress/utils/urls.ts
index beed748e44..3e8a629428 100644
--- a/superset-frontend/cypress-base/cypress/utils/urls.ts
+++ b/superset-frontend/cypress-base/cypress/utils/urls.ts
@@ -21,4 +21,4 @@ export const DASHBOARD_LIST = '/dashboard/list/';
 export const CHART_LIST = '/chart/list/';
 export const WORLD_HEALTH_DASHBOARD = '/superset/dashboard/world_health/';
 export const SAMPLE_DASHBOARD_1 = '/superset/dashboard/1-sample-dashboard/';
-export const ECHARTS_DASHBOARD = '/superset/dashboard/echarts_dash/';
\ No newline at end of file
+export const ECHARTS_DASHBOARD = '/superset/dashboard/echarts_dash/';
diff --git a/superset-frontend/cypress-base/package-lock.json b/superset-frontend/cypress-base/package-lock.json
index 873900f546..7b5b69eddb 100644
--- a/superset-frontend/cypress-base/package-lock.json
+++ b/superset-frontend/cypress-base/package-lock.json
@@ -12,6 +12,7 @@
         "@applitools/eyes-cypress": "^3.25.3",
         "@cypress/code-coverage": "^3.9.11",
         "@superset-ui/core": "^0.18.8",
+        "brace": "^0.11.1",
         "cy-verify-downloads": "^0.1.6",
         "querystringify": "^2.2.0",
         "react-dom": "^16.13.0",
@@ -3577,6 +3578,11 @@
         "node": ">=0.6"
       }
     },
+    "node_modules/brace": {
+      "version": "0.11.1",
+      "resolved": "https://registry.npmjs.org/brace/-/brace-0.11.1.tgz",
+      "integrity": "sha512-Fc8Ne62jJlKHiG/ajlonC4Sd66Pq68fFwK4ihJGNZpGqboc324SQk+lRvMzpPRuJOmfrJefdG8/7JdWX4bzJ2Q=="
+    },
     "node_modules/brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -13216,6 +13222,11 @@
         }
       }
     },
+    "brace": {
+      "version": "0.11.1",
+      "resolved": "https://registry.npmjs.org/brace/-/brace-0.11.1.tgz",
+      "integrity": "sha512-Fc8Ne62jJlKHiG/ajlonC4Sd66Pq68fFwK4ihJGNZpGqboc324SQk+lRvMzpPRuJOmfrJefdG8/7JdWX4bzJ2Q=="
+    },
     "brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
diff --git a/superset-frontend/cypress-base/package.json b/superset-frontend/cypress-base/package.json
index 02c126406c..b28c684544 100644
--- a/superset-frontend/cypress-base/package.json
+++ b/superset-frontend/cypress-base/package.json
@@ -13,6 +13,7 @@
     "@applitools/eyes-cypress": "^3.25.3",
     "@cypress/code-coverage": "^3.9.11",
     "@superset-ui/core": "^0.18.8",
+    "brace": "^0.11.1",
     "cy-verify-downloads": "^0.1.6",
     "querystringify": "^2.2.0",
     "react-dom": "^16.13.0",
diff --git a/superset-frontend/src/components/Chart/DrillDetailModal.tsx b/superset-frontend/src/components/Chart/DrillDetailModal.tsx
index 365fe3abc2..448cc2566f 100644
--- a/superset-frontend/src/components/Chart/DrillDetailModal.tsx
+++ b/superset-frontend/src/components/Chart/DrillDetailModal.tsx
@@ -91,7 +91,12 @@ const DrillDetailModal: React.FC<{
           >
             {t('Edit chart')}
           </Button>
-          <Button data-test="close-drilltodetail-modal" buttonStyle="primary" buttonSize="small" onClick={closeModal}>
+          <Button
+            data-test="close-drilltodetail-modal"
+            buttonStyle="primary"
+            buttonSize="small"
+            onClick={closeModal}
+          >
             {t('Close')}
           </Button>
         </>


[superset] 06/08: Merge branch 'master' of https://github.com/apache/superset into chore/cypress-runtime-enhancements

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/cypress-runtime-enhancements
in repository https://gitbox.apache.org/repos/asf/superset.git

commit d179a9510d3ec5902024e400c028b2ed88c4b495
Merge: 05049dee69 c3f8417139
Author: geido <di...@gmail.com>
AuthorDate: Mon Sep 5 17:34:42 2022 +0300

    Merge branch 'master' of https://github.com/apache/superset into chore/cypress-runtime-enhancements

 RELEASING/README.md                                |  12 +-
 docker/pythonpath_dev/superset_config.py           |  10 +
 docs/docs/installation/alerts-reports.mdx          |   1 +
 helm/superset/Chart.yaml                           |   2 +-
 helm/superset/values.yaml                          |  14 +-
 requirements/base.txt                              |   2 +-
 requirements/development.txt                       |   2 +-
 setup.py                                           |   8 +-
 superset-embedded-sdk/README.md                    |   7 +-
 superset-embedded-sdk/src/const.ts                 |   4 +
 superset-embedded-sdk/src/index.ts                 |  21 +-
 .../integration/dashboard/nativeFilters.test.ts    |   4 +-
 superset-frontend/package-lock.json                |  96 +++
 superset-frontend/package.json                     |   1 +
 .../test/utils/featureFlag.test.ts                 |  48 +-
 .../src/TimePivot/controlPanel.ts                  |   5 +
 .../src/MixedTimeseries/transformProps.ts          |   2 +-
 .../src/Timeseries/Regular/Line/index.ts           |   2 +-
 .../plugin-chart-echarts/src/utils/forecast.ts     |   5 +-
 .../test/utils/forecast.test.ts                    | 223 +++--
 superset-frontend/spec/helpers/shim.ts             |   1 +
 superset-frontend/spec/helpers/testing-library.tsx |   7 +
 superset-frontend/src/SqlLab/App.jsx               |  15 +-
 superset-frontend/src/SqlLab/actions/sqlLab.js     |  10 +-
 .../src/SqlLab/actions/sqlLab.test.js              |  74 +-
 .../SqlLab/components/SaveDatasetModal/index.tsx   |   5 +-
 .../SqlLab/components/SqlEditor/SqlEditor.test.jsx |   9 +-
 .../src/SqlLab/components/SqlEditor/index.jsx      |  54 +-
 .../SqlEditorLeftBar/SqlEditorLeftBar.test.jsx     | 124 +--
 .../SqlLab/components/SqlEditorLeftBar/index.tsx   |  14 +-
 .../TabbedSqlEditors/TabbedSqlEditors.test.jsx     |   9 +-
 .../SqlLab/components/TabbedSqlEditors/index.jsx   |   4 +-
 .../src/SqlLab/components/TableElement/index.tsx   |   1 +
 superset-frontend/src/SqlLab/constants.ts          |   1 +
 superset-frontend/src/SqlLab/main.less             |   5 +-
 superset-frontend/src/SqlLab/reducers/sqlLab.js    |  20 +-
 .../src/SqlLab/reducers/sqlLab.test.js             |  22 +
 .../src/SqlLab/utils/newQueryTabName.ts            |   2 +-
 .../SqlLab/utils/reduxStateToLocalStorageHelper.js |   2 +-
 .../components/Datasource/DatasourceModal.test.jsx |   9 +-
 .../components/ErrorMessage/ErrorAlert.test.tsx    |   6 -
 .../src/components/ErrorMessage/ErrorAlert.tsx     |  19 +-
 .../ErrorMessage/ErrorMessageWithStackTrace.tsx    |   3 -
 .../src/components/FilterableTable/index.tsx       |   2 +
 superset-frontend/src/components/Icons/index.tsx   |   2 +-
 superset-frontend/src/components/ListView/types.ts |   2 +
 superset-frontend/src/components/Modal/Modal.tsx   |  48 +-
 .../src/components/ResizableSidebar/index.tsx      |  82 ++
 .../useStoredSidebarWidth.test.ts}                 |  41 +-
 .../ResizableSidebar/useStoredSidebarWidth.ts}     |  28 +-
 .../src/components/Select/AsyncSelect.test.tsx     |  74 +-
 .../src/components/Select/AsyncSelect.tsx          |  30 +-
 .../src/components/Select/Select.test.tsx          |  14 +
 superset-frontend/src/components/Select/Select.tsx |  28 +-
 .../src/components/TableSelector/index.tsx         | 132 ++-
 .../src/dashboard/components/AnchorLink/index.tsx  |   3 +-
 .../DashboardBuilder/DashboardBuilder.test.tsx     |  12 +-
 .../DashboardBuilder/DashboardBuilder.tsx          |  88 +-
 .../src/dashboard/components/dnd/DragDroppable.jsx |  20 +-
 .../components/gridComponents/ChartHolder.jsx      | 420 ----------
 .../components/gridComponents/ChartHolder.test.jsx | 138 ---
 .../components/gridComponents/ChartHolder.test.tsx | 360 +++++++-
 .../components/gridComponents/ChartHolder.tsx      | 333 ++++++++
 .../src/dashboard/stylesheets/components/row.less  |   6 +
 superset-frontend/src/dashboard/types.ts           |   5 +
 .../util/useFilterFocusHighlightStyles.test.tsx    | 209 +++++
 .../util/useFilterFocusHighlightStyles.ts          |  91 ++
 superset-frontend/src/hooks/apiResources/index.ts  |   1 +
 .../src/hooks/apiResources/tables.test.ts          | 221 +++++
 superset-frontend/src/hooks/apiResources/tables.ts |  97 +++
 superset-frontend/src/types/Database.ts            |   2 +-
 superset-frontend/src/utils/common.js              |   4 +-
 superset-frontend/src/utils/common.test.jsx        |   9 +-
 superset-frontend/src/utils/localStorageHelpers.ts |   2 +
 superset-frontend/src/views/App.tsx                |  43 +-
 .../src/views/CRUD/chart/ChartList.tsx             |  22 +-
 .../src/views/CRUD/dashboard/DashboardList.tsx     |  10 +-
 .../DatabaseConnectionForm/EncryptedField.tsx      |   3 +-
 .../data/database/DatabaseModal/ExtraOptions.tsx   |   6 +-
 .../data/database/DatabaseModal/index.test.jsx     |   3 +
 .../CRUD/data/database/DatabaseModal/index.tsx     |  71 +-
 .../CRUD/data/database/DatabaseModal/styles.ts     |   3 +-
 .../src/views/CRUD/data/database/types.ts          |   2 +-
 .../views/QueryProvider.tsx}                       |  36 +-
 superset/available_domains/__init__.py             |  16 +
 superset/available_domains/api.py                  |  75 ++
 superset/available_domains/schemas.py              |  21 +
 superset/charts/api.py                             |   2 +
 superset/charts/filters.py                         |  16 +
 superset/config.py                                 |   6 +-
 superset/connectors/sqla/models.py                 |   7 +-
 superset/constants.py                              |   2 +
 superset/dashboards/api.py                         |   3 +-
 superset/dashboards/filters.py                     |  17 +-
 superset/databases/api.py                          |   2 +-
 superset/databases/commands/create.py              |   6 +
 superset/databases/commands/test_connection.py     |  16 +-
 superset/databases/commands/update.py              |  42 +
 superset/databases/commands/validate.py            |  18 +-
 superset/databases/dao.py                          |  24 +
 superset/databases/schemas.py                      |  17 +-
 superset/datasets/commands/create.py               |  11 +-
 superset/datasets/commands/delete.py               |  24 -
 superset/db_engine_specs/base.py                   |  34 +-
 superset/db_engine_specs/bigquery.py               |  43 +-
 superset/db_engine_specs/gsheets.py                |  41 +-
 superset/db_engine_specs/presto.py                 |   2 +-
 superset/db_engine_specs/trino.py                  |   5 +-
 superset/initialization/__init__.py                |   2 +
 superset/models/core.py                            |  44 +-
 superset/models/helpers.py                         |   2 +-
 superset/security/manager.py                       | 641 ++++++++++----
 superset/tasks/cache.py                            |  98 +--
 superset/templates/superset/basic.html             |   1 -
 superset/translations/fr/LC_MESSAGES/messages.json | 193 ++++-
 superset/translations/fr/LC_MESSAGES/messages.po   | 356 +++++++-
 superset/translations/messages.pot                 |  10 +
 superset/utils/core.py                             |  34 +-
 superset/utils/network.py                          |  25 +-
 .../utils/pandas_postprocessing/contribution.py    |   3 -
 superset/views/base.py                             |   1 +
 superset/views/core.py                             |  14 +-
 .../available_domains/__init__.py                  |  16 +
 .../available_domains/api_tests.py                 |  30 +
 tests/integration_tests/charts/api_tests.py        |  28 +
 tests/integration_tests/core_tests.py              |  12 +
 tests/integration_tests/dashboards/api_tests.py    |  36 +
 tests/integration_tests/databases/api_tests.py     |   6 +-
 tests/integration_tests/datasets/api_tests.py      |  21 +-
 .../db_engine_specs/postgres_tests.py              |  10 +-
 .../db_engine_specs/trino_tests.py                 |  12 +-
 tests/integration_tests/email_tests.py             |  29 +-
 tests/integration_tests/security_tests.py          | 931 ++++++++++++++++-----
 tests/integration_tests/sqla_models_tests.py       |   7 +-
 tests/integration_tests/strategy_tests.py          | 141 +---
 tests/integration_tests/superset_test_config.py    |   2 +
 tests/unit_tests/conftest.py                       |   4 +
 tests/unit_tests/databases/api_test.py             | 108 ++-
 tests/unit_tests/db_engine_specs/test_bigquery.py  |  36 +-
 tests/unit_tests/db_engine_specs/test_gsheets.py   |  40 +-
 140 files changed, 5018 insertions(+), 1913 deletions(-)