test: check effects on trigger of hover and click events

This commit is contained in:
Mangesh-Khairnar 2019-03-25 15:44:47 +05:30
parent c9f8c4e40e
commit 6cc59aabd8

View file

@ -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');
});
});