From 836b13bd880ba1dd8862358903ce678a1da2902b Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 14 Jan 2019 14:02:05 +0530 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20Fix=20test=20for=20heade?= =?UTF-8?q?r=20dropdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/integration/datatable_spec.js | 9 ++++++--- cypress/support/commands.js | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cypress/integration/datatable_spec.js b/cypress/integration/datatable_spec.js index a6cc7c7..bae200c 100644 --- a/cypress/integration/datatable_spec.js +++ b/cypress/integration/datatable_spec.js @@ -113,12 +113,11 @@ describe('DataTable', function () { .find('.dt-dropdown__toggle') .as('toggle') .click(); - cy.getColumnCell(2) - .find('.dt-dropdown__list') + cy.get('.dt-dropdown__list') .as('dropdown-list') .should('be.visible'); - cy.get('@toggle').click(); + cy.getColumnCell(2).click(); cy.get('@dropdown-list').should('not.be.visible'); }); @@ -152,6 +151,10 @@ describe('DataTable', function () { }); describe('Row', function () { + before(function () { + cy.visit('/'); + }); + it('check / uncheck row', function () { cy.get('.dt-scrollable .dt-row:first') .find('input[type="checkbox"]') diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c6d382c..a62041f 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -43,8 +43,7 @@ Cypress.Commands.add('clickDropdown', (col) => { }); Cypress.Commands.add('clickDropdownItem', (col, item) => { - return cy.getColumnCell(col) - .find(`.dt-dropdown__list-item:contains("${item}")`) + return cy.get(`.dt-dropdown__list-item:contains("${item}")`) .click({ force: true }); });