table.spec.js 1.1 KB

123456789101112131415161718192021222324252627
  1. // table.spec.js created with Cypress
  2. //
  3. // Start writing your Cypress tests below!
  4. // If you're unfamiliar with how Cypress works,
  5. // check out the link below and learn how to write your first test:
  6. // https://on.cypress.io/writing-first-test
  7. describe('table', () => {
  8. it('row selection', () => {
  9. cy.visit('http://127.0.0.1:6006/iframe.html?id=table--selection-table&args=&viewMode=story');
  10. cy.get('.semi-table-row-head .semi-checkbox-inner-display').click();
  11. cy.get('.semi-checkbox-checked').should('have.length', 4);
  12. });
  13. /**
  14. * 测试 columns 为字面量时刷新 Table,页码应保持当前页
  15. * 即更新 columns 不影响 currentPage
  16. */
  17. it('columns change ', () => {
  18. cy.visit('http://localhost:6006/iframe.html?id=table--fixed-columns-change&viewMode=story');
  19. cy.get('.semi-page-item').contains('2').click();
  20. cy.get('.semi-table-tbody .semi-checkbox').eq(1).click()
  21. .then(() => {
  22. cy.get('.semi-page-item').contains('2').should('have.class', 'semi-page-item-active');
  23. });
  24. });
  25. });