test: check effects on trigger of hover and click events
This commit is contained in:
parent
c9f8c4e40e
commit
6cc59aabd8
1 changed files with 36 additions and 0 deletions
36
cypress/integration/control_rating.js
Normal file
36
cypress/integration/control_rating.js
Normal 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');
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue