From 981f09b5db77fc2348a508da49cdddf1fcfcb3c6 Mon Sep 17 00:00:00 2001 From: Jinghuayao <81597121+jinghua-qa@users.noreply.github.com> Date: Tue, 15 Mar 2022 08:16:06 -0700 Subject: [PATCH] test(native filter): add new native filter test (#19115) * add new native filter test --- .../dashboard/nativeFilters.test.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) 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 e0eccfa52015..433b4a65e33c 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts @@ -529,6 +529,42 @@ describe('Nativefilters Sanity test', () => { .contains('year') .should('be.visible'); }); + it('User can create a value filter', () => { + cy.get(nativeFilters.filterFromDashboardView.expand).click({ force: true }); + cy.get(nativeFilters.filterFromDashboardView.createFilterButton) + .should('be.visible') + .click(); + cy.get(nativeFilters.modal.container).should('be.visible'); + cy.get('body').type('{home}'); + + cy.get(nativeFilters.filtersPanel.filterTypeInput) + .click({ scrollBehavior: false }) + .type('{home}Value{enter}', { scrollBehavior: false }); + cy.get(nativeFilters.filtersPanel.filterTypeInput) + .find(nativeFilters.filtersPanel.filterTypeItem) + .should('have.text', 'Value'); + cy.get(nativeFilters.modal.container) + .find(nativeFilters.filtersPanel.filterName) + .click({ scrollBehavior: false }) + .clear() + .type('country_name', { scrollBehavior: false }); + + cy.get(nativeFilters.silentLoading).should('not.exist'); + cy.get(nativeFilters.filtersPanel.filterInfoInput) + .last() + .should('be.visible') + .click({ force: true }); + cy.get(nativeFilters.filtersPanel.filterInfoInput) + .last() + .type('country_name {enter}'); + cy.get(nativeFilters.modal.footer) + .find(nativeFilters.modal.saveButton) + .should('be.visible') + .click({ force: true }); + cy.get(nativeFilters.filterFromDashboardView.filterName) + .should('be.visible', { timeout: 40000 }) + .contains('country_name'); + }); }); xdescribe('Nativefilters', () => {