geido commented on a change in pull request #17231:
URL: https://github.com/apache/superset/pull/17231#discussion_r736384195



##########
File path: 
superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
##########
@@ -16,12 +16,128 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { CHART_LIST } from '../chart_list/chart_list.helper';
-import { DASHBOARD_LIST } from '../dashboard_list/dashboard_list.helper';
+ import {
+  dashboardView,
+  nativeFilters,
+} from "cypress/support/directories";
+import { testItems } from "./dashboard.helper";
+import { DASHBOARD_LIST } from "../dashboard_list/dashboard_list.helper";
+const getTestTitle = (
+  test: Mocha.Suite = (Cypress as any).mocha.getRunner().suite.ctx.test
+): string =>
+  test.parent?.title
+    ? `${getTestTitle(test.parent)} -- ${test.title}`
+    : test.title;
 
 // TODO: fix flaky init logic and re-enable
 const milliseconds = new Date().getTime();
 const dashboard = `Test Dashboard${milliseconds}`;
+
+describe("Nativefilters Sanity test", () => {
+  before(() => {
+    cy.login();
+    cy.intercept("/api/v1/dashboard/?q=**").as("dashboardsList");
+    cy.intercept("POST", "**/copy_dash/*").as("copy");
+    cy.intercept("/api/v1/dashboard/*").as("dashboard");
+    cy.request(
+      
"api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:100)"
+    ).then((xhr) => {
+      const dashboards = xhr.body.result;
+      console.log(dashboards);
+      for (const element of dashboards) {
+        if (element["dashboard_title"] == "World Bank's Data") {
+          cy.visit(element["url"]);
+        }
+      }
+    });
+    cy.get(dashboardView.threeDotsMenuIcon).should("be.visible").click();
+    cy.get(dashboardView.saveAsMenuOption).should("be.visible").click();
+    cy.get(dashboardView.saveModal.dashboardNameInput)
+      .should("be.visible")
+      .clear()
+      .type(testItems.dashboard);
+    cy.get(dashboardView.saveModal.saveButton).click();
+    cy.wait("@copy", { timeout: 45000 })
+      .its("response.statusCode")
+      .should("eq", 200);
+  });
+  beforeEach(() => {
+    cy.login();
+    cy.request(
+      
"api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:100)"
+    ).then((xhr) => {
+      const dashboards = xhr.body.result;
+      console.log(dashboards);

Review comment:
       ```suggestion
   ```

##########
File path: 
superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
##########
@@ -16,12 +16,128 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { CHART_LIST } from '../chart_list/chart_list.helper';
-import { DASHBOARD_LIST } from '../dashboard_list/dashboard_list.helper';
+ import {
+  dashboardView,
+  nativeFilters,
+} from "cypress/support/directories";
+import { testItems } from "./dashboard.helper";
+import { DASHBOARD_LIST } from "../dashboard_list/dashboard_list.helper";
+const getTestTitle = (
+  test: Mocha.Suite = (Cypress as any).mocha.getRunner().suite.ctx.test
+): string =>
+  test.parent?.title
+    ? `${getTestTitle(test.parent)} -- ${test.title}`
+    : test.title;
 
 // TODO: fix flaky init logic and re-enable
 const milliseconds = new Date().getTime();
 const dashboard = `Test Dashboard${milliseconds}`;
+
+describe("Nativefilters Sanity test", () => {
+  before(() => {
+    cy.login();
+    cy.intercept("/api/v1/dashboard/?q=**").as("dashboardsList");
+    cy.intercept("POST", "**/copy_dash/*").as("copy");
+    cy.intercept("/api/v1/dashboard/*").as("dashboard");
+    cy.request(
+      
"api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:100)"
+    ).then((xhr) => {
+      const dashboards = xhr.body.result;
+      console.log(dashboards);
+      for (const element of dashboards) {
+        if (element["dashboard_title"] == "World Bank's Data") {
+          cy.visit(element["url"]);
+        }
+      }
+    });
+    cy.get(dashboardView.threeDotsMenuIcon).should("be.visible").click();
+    cy.get(dashboardView.saveAsMenuOption).should("be.visible").click();
+    cy.get(dashboardView.saveModal.dashboardNameInput)
+      .should("be.visible")
+      .clear()
+      .type(testItems.dashboard);
+    cy.get(dashboardView.saveModal.saveButton).click();
+    cy.wait("@copy", { timeout: 45000 })
+      .its("response.statusCode")
+      .should("eq", 200);
+  });
+  beforeEach(() => {
+    cy.login();
+    cy.request(
+      
"api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:100)"
+    ).then((xhr) => {
+      const dashboards = xhr.body.result;
+      console.log(dashboards);
+      for (const element of dashboards) {
+        if (element["dashboard_title"] == testItems.dashboard) {
+          cy.visit(element["url"]);
+        }
+      }

Review comment:
       ```suggestion
         const testDashboard = dashboards.find(d => d.dashboard_title === 
testItems.dashboard);
         cy.visit(testDashboard.url);
   ```

##########
File path: 
superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
##########
@@ -16,12 +16,128 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { CHART_LIST } from '../chart_list/chart_list.helper';
-import { DASHBOARD_LIST } from '../dashboard_list/dashboard_list.helper';
+ import {
+  dashboardView,
+  nativeFilters,
+} from "cypress/support/directories";
+import { testItems } from "./dashboard.helper";
+import { DASHBOARD_LIST } from "../dashboard_list/dashboard_list.helper";
+const getTestTitle = (
+  test: Mocha.Suite = (Cypress as any).mocha.getRunner().suite.ctx.test
+): string =>
+  test.parent?.title
+    ? `${getTestTitle(test.parent)} -- ${test.title}`
+    : test.title;
 
 // TODO: fix flaky init logic and re-enable
 const milliseconds = new Date().getTime();
 const dashboard = `Test Dashboard${milliseconds}`;
+
+describe("Nativefilters Sanity test", () => {
+  before(() => {
+    cy.login();
+    cy.intercept("/api/v1/dashboard/?q=**").as("dashboardsList");
+    cy.intercept("POST", "**/copy_dash/*").as("copy");
+    cy.intercept("/api/v1/dashboard/*").as("dashboard");
+    cy.request(
+      
"api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:100)"
+    ).then((xhr) => {
+      const dashboards = xhr.body.result;
+      console.log(dashboards);
+      for (const element of dashboards) {
+        if (element["dashboard_title"] == "World Bank's Data") {
+          cy.visit(element["url"]);
+        }
+      }

Review comment:
       ```suggestion
         const worldBankDashboard = dashboards.find(d => d.dashboard_title === 
'World Bank\'s Data');
         cy.visit(worldBankDashboard.url);
   ```

##########
File path: 
superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
##########
@@ -16,12 +16,128 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { CHART_LIST } from '../chart_list/chart_list.helper';
-import { DASHBOARD_LIST } from '../dashboard_list/dashboard_list.helper';
+ import {
+  dashboardView,
+  nativeFilters,
+} from "cypress/support/directories";
+import { testItems } from "./dashboard.helper";
+import { DASHBOARD_LIST } from "../dashboard_list/dashboard_list.helper";
+const getTestTitle = (
+  test: Mocha.Suite = (Cypress as any).mocha.getRunner().suite.ctx.test
+): string =>
+  test.parent?.title
+    ? `${getTestTitle(test.parent)} -- ${test.title}`
+    : test.title;
 
 // TODO: fix flaky init logic and re-enable
 const milliseconds = new Date().getTime();
 const dashboard = `Test Dashboard${milliseconds}`;
+
+describe("Nativefilters Sanity test", () => {
+  before(() => {
+    cy.login();
+    cy.intercept("/api/v1/dashboard/?q=**").as("dashboardsList");
+    cy.intercept("POST", "**/copy_dash/*").as("copy");
+    cy.intercept("/api/v1/dashboard/*").as("dashboard");
+    cy.request(
+      
"api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:100)"
+    ).then((xhr) => {
+      const dashboards = xhr.body.result;
+      console.log(dashboards);

Review comment:
       ```suggestion
   ```




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to