options.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module.exports = (theme = '') => {
  2. const baseUrl = require('../../common/utils')(theme, 'for-tests/extensions/filter-control')
  3. describe('Test basic filter control', () => {
  4. it('Test basic filter control', () => {
  5. cy.visit(`${baseUrl}filter-control.html`)
  6. .get('.table > thead > tr > th > .fht-cell > .filter-control')
  7. .its('length')
  8. .should('be.gte', 1)
  9. })
  10. it('Test if filter control visible is set to false, controls shouldnt be visible.', () => {
  11. cy.visit(`${baseUrl}filter-control-filterControlVisible.html`)
  12. .get('.table > thead > tr > th > .fht-cell > .filter-control')
  13. .invoke('attr', 'style')
  14. .should('eq', 'display: none;')
  15. })
  16. it('Test if filter control searchOnEnteyKey is set to true. Type "cypress" and validate table should not perform any action.', () => {
  17. cy.visit(`${baseUrl}filter-control-searchOnEnterKey.html`)
  18. .wait(1000)
  19. .get('.table > thead > tr > th > .fht-cell > .filter-control')
  20. .find('input')
  21. .type('cypress')
  22. .get('.table > tbody > tr')
  23. .its('length')
  24. .should('eq', 21)
  25. })
  26. it('Test if filter control searchOnEnteyKey is set to true. Type "Item 0", hit enter and validate table should perform search action.', () => {
  27. cy.visit(`${baseUrl}filter-control-searchOnEnterKey.html`)
  28. .wait(1000)
  29. .get('.table > thead > tr > th > .fht-cell > .filter-control')
  30. .find('input')
  31. .type('Item 0')
  32. .type('{enter}')
  33. .wait(1000)
  34. .get('.table > tbody > tr')
  35. .its('length')
  36. .should('eq', 1)
  37. })
  38. })
  39. }