diff --git a/cypress/integration/control_rating.js b/cypress/integration/control_rating.js new file mode 100644 index 0000000000..2df10d0351 --- /dev/null +++ b/cypress/integration/control_rating.js @@ -0,0 +1,36 @@ +context('Rating Control', () => { + beforeEach(() => { + cy.login('Administrator', 'qwe'); + }); + + it('click on the star rating to record value', () => { + cy.visit('/desk') + cy.dialog('Rating', { + 'fieldname': 'rate', 'fieldtype': 'Rating', + }).as('dialog'); + + cy.get('div.rating') + .children('i.fa') + .first() + .click() + .should('have.class', 'star-click'); + cy.get('@dialog').then(dialog => { + var value = dialog.get_value('rate'); + }) + }); + + it('hover on the star', () => { + cy.visit('/desk') + cy.dialog('Rating', { + 'fieldname': 'rate', 'fieldtype': 'Rating', + }) + cy.get('div.rating') + .children('i.fa') + .first() + .invoke('trigger', 'mouseenter') + .should('have.class', 'star-hover') + .invoke('trigger', 'mouseleave') + .should('not.have.class', 'star-hover'); + }); + +}); \ No newline at end of file