You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/10/27 03:29:17 UTC

[GitHub] [superset] jinghua-qa commented on a change in pull request #17231: test: added some sanity test for native filter

jinghua-qa commented on a change in pull request #17231:
URL: https://github.com/apache/superset/pull/17231#discussion_r737074091



##########
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:
       removed




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

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

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



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