From 7f779a3dd8a0b392e46108d39eb6ed88d966ed4c Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 16 Oct 2018 14:16:22 +0530 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20Add=20test=20for=20multi?= =?UTF-8?q?ple=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/integration/datatable_spec.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cypress/integration/datatable_spec.js b/cypress/integration/datatable_spec.js index c89a8d9..918dd5a 100644 --- a/cypress/integration/datatable_spec.js +++ b/cypress/integration/datatable_spec.js @@ -169,10 +169,12 @@ describe('DataTable', function () { }); beforeEach(function () { + cy.get('.dt-filter[data-col-index=4]').as('filterInput4'); cy.get('.dt-filter[data-col-index=5]').as('filterInput5'); }); afterEach(function () { + cy.get('@filterInput4').clear(); cy.get('@filterInput5').clear(); cy.get('.dt-row[data-row-index=0]').should('be.visible'); }); @@ -180,11 +182,13 @@ describe('DataTable', function () { it('simple text filter', function () { cy.getCell(4, 0).click().type('{ctrl}f'); - cy.get('.dt-filter[data-col-index=4]').as('filterInput4').type('edin'); + cy.get('@filterInput4').type('edin'); cy.get('.dt-row[data-row-index=0]').should('be.visible'); cy.get('.dt-row[data-row-index=1]').should('not.be.visible'); cy.get('@filterInput4').clear(); + cy.wait(500); + cy.get('@filterInput5').type('15'); cy.get('.dt-row[data-row-index=2]').should('be.visible'); cy.get('.dt-row[data-row-index=15]').should('be.visible'); @@ -208,5 +212,14 @@ describe('DataTable', function () { cy.get('.dt-row[data-row-index=4]').should('not.be.visible'); cy.get('.dt-row[data-row-index=5]').should('be.visible'); }); + + it('multiple filters', function () { + cy.get('@filterInput4').type('to'); + cy.get('@filterInput5').type('54'); + + cy.get('.dt-row[data-row-index=0]').should('be.visible'); + cy.get('.dt-row[data-row-index=4]').should('be.visible'); + cy.get('.dt-row[data-row-index=1]').should('not.be.visible'); + }); }); });