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/12/20 12:36:49 UTC

[superset] branch master updated: fix(cypress): Fix failing/flaky E2E tests (#22460)

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

diegopucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 21b56b2d49 fix(cypress): Fix failing/flaky E2E tests (#22460)
21b56b2d49 is described below

commit 21b56b2d4993e2556e27a0849c91c570adf68d6c
Author: Cody Leff <co...@preset.io>
AuthorDate: Tue Dec 20 12:36:42 2022 +0000

    fix(cypress): Fix failing/flaky E2E tests (#22460)
---
 .../cypress/integration/dashboard/drilltodetail.test.ts             | 6 +++---
 .../cypress/integration/dashboard/nativeFilters.test.ts             | 3 ++-
 .../cypress-base/cypress/integration/dashboard/utils.ts             | 3 +--
 superset-frontend/cypress-base/cypress/integration/explore/utils.ts | 1 +
 4 files changed, 7 insertions(+), 6 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 c71a5833db..91485ce19b 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
@@ -172,13 +172,13 @@ describe('Drill to detail modal', () => {
         openModalFromMenu('big_number_total');
         // checking the data
         cy.getBySel('row-count-label').should('contain', '75.7k rows');
-        cy.get('.virtual-table-cell').then($rows => {
+        cy.get('.virtual-table-cell').should($rows => {
           expect($rows).to.contain('Amy');
         });
         // checking the paginated data
         cy.get('.ant-pagination-item')
           .should('have.length', 6)
-          .then($pages => {
+          .should($pages => {
             expect($pages).to.contain('1');
             expect($pages).to.contain('1514');
           });
@@ -186,7 +186,7 @@ describe('Drill to detail modal', () => {
         // skips error on pagination
         cy.on('uncaught:exception', () => false);
         cy.wait('@samples');
-        cy.get('.virtual-table-cell').then($rows => {
+        cy.get('.virtual-table-cell').should($rows => {
           expect($rows).to.contain('Kelly');
         });
 
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 eb38aca4e8..365a7e4ecb 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
@@ -82,7 +82,7 @@ function prepareDashboardFilters(
   }).then(res => {
     const { body } = res;
     const dashboardId = body.result.id;
-    const allFilters: Record<string, any>[] = [];
+    const allFilters: Record<string, unknown>[] = [];
     filters.forEach((f, i) => {
       allFilters.push({
         id: `NATIVE_FILTER-fLH0pxFQ${i}`,
@@ -202,6 +202,7 @@ function openVerticalFilterBar() {
 
 function setFilterBarOrientation(orientation: 'vertical' | 'horizontal') {
   cy.getBySel('filterbar-orientation-icon').click();
+  cy.wait(250);
   cy.getBySel('dropdown-selectable-info')
     .contains('Orientation of filter bar')
     .should('exist');
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
index 89d3be8b9e..dbe8debc36 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts
@@ -306,8 +306,7 @@ export function getNativeFilterPlaceholderWithIndex(index: number) {
 export function applyNativeFilterValueWithIndex(index: number, value: string) {
   cy.get(nativeFilters.filterFromDashboardView.filterValueInput)
     .eq(index)
-    .parent()
-    .should('be.visible', { timeout: 10000 })
+    .should('exist', { timeout: 10000 })
     .type(`${value}{enter}`);
   // click the title to dismiss shown options
   cy.get(nativeFilters.filterFromDashboardView.filterName)
diff --git a/superset-frontend/cypress-base/cypress/integration/explore/utils.ts b/superset-frontend/cypress-base/cypress/integration/explore/utils.ts
index 3eac4f97be..15e7dcba1b 100644
--- a/superset-frontend/cypress-base/cypress/integration/explore/utils.ts
+++ b/superset-frontend/cypress-base/cypress/integration/explore/utils.ts
@@ -82,6 +82,7 @@ export function saveChartToDashboard(dashboardName: string) {
   cy.wait('@update');
   cy.wait('@get');
   cy.wait('@getExplore');
+  cy.contains(`was added to dashboard [${dashboardName}]`);
 }
 
 export function visitSampleChartFromList(chartName: string) {