Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

55 rindas
1.0 KiB

  1. context('Control Rating', () => {
  2. before(() => {
  3. cy.login();
  4. cy.visit('/app/website');
  5. });
  6. function get_dialog_with_rating() {
  7. return cy.dialog({
  8. title: 'Rating',
  9. fields: [{
  10. 'fieldname': 'rate',
  11. 'fieldtype': 'Rating',
  12. 'options': 7
  13. }]
  14. });
  15. }
  16. it('click on the star rating to record value', () => {
  17. get_dialog_with_rating().as('dialog');
  18. cy.get('div.rating')
  19. .children('svg')
  20. .first()
  21. .click()
  22. .should('have.class', 'star-click');
  23. cy.get('@dialog').then(dialog => {
  24. var value = dialog.get_value('rate');
  25. expect(value).to.equal(1);
  26. dialog.hide();
  27. });
  28. });
  29. it('hover on the star', () => {
  30. get_dialog_with_rating();
  31. cy.get('div.rating')
  32. .children('svg')
  33. .first()
  34. .invoke('trigger', 'mouseenter')
  35. .should('have.class', 'star-hover')
  36. .invoke('trigger', 'mouseleave')
  37. .should('not.have.class', 'star-hover');
  38. });
  39. it('check number of stars in rating', () => {
  40. get_dialog_with_rating();
  41. cy.get('div.rating')
  42. .first()
  43. .children('svg')
  44. .should('have.length', 7);
  45. });
  46. });