25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

57 satır
1.1 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. .find('.right-half')
  21. .first()
  22. .click()
  23. .should('have.class', 'star-click');
  24. cy.get('@dialog').then(dialog => {
  25. var value = dialog.get_value('rate');
  26. expect(value).to.equal(1/7);
  27. dialog.hide();
  28. });
  29. });
  30. it('hover on the star', () => {
  31. get_dialog_with_rating();
  32. cy.get('div.rating')
  33. .children('svg')
  34. .find('.right-half')
  35. .first()
  36. .invoke('trigger', 'mouseenter')
  37. .should('have.class', 'star-hover')
  38. .invoke('trigger', 'mouseleave')
  39. .should('not.have.class', 'star-hover');
  40. });
  41. it('check number of stars in rating', () => {
  42. get_dialog_with_rating();
  43. cy.get('div.rating')
  44. .first()
  45. .children('svg')
  46. .should('have.length', 7);
  47. });
  48. });