您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

38 行
844 B

  1. context('Rating Control', () => {
  2. beforeEach(() => {
  3. cy.login('Administrator', 'qwe');
  4. });
  5. it('click on the star rating to record value', () => {
  6. cy.visit('/desk')
  7. cy.dialog('Rating', {
  8. 'fieldname': 'rate',
  9. 'fieldtype': 'Rating',
  10. }).as('dialog');
  11. cy.get('div.rating')
  12. .children('i.fa')
  13. .first()
  14. .click()
  15. .should('have.class', 'star-click');
  16. cy.get('@dialog').then(dialog => {
  17. var value = dialog.get_value('rate');
  18. expect(value).to.equal(1);
  19. })
  20. });
  21. it('hover on the star', () => {
  22. cy.visit('/desk')
  23. cy.dialog('Rating', {
  24. 'fieldname': 'rate',
  25. 'fieldtype': 'Rating',
  26. })
  27. cy.get('div.rating')
  28. .children('i.fa')
  29. .first()
  30. .invoke('trigger', 'mouseenter')
  31. .should('have.class', 'star-hover')
  32. .invoke('trigger', 'mouseleave')
  33. .should('not.have.class', 'star-hover');
  34. });
  35. });