-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathlist_view_settings.js
34 lines (30 loc) · 1.34 KB
/
list_view_settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
context('List View Settings', () => {
beforeEach(() => {
cy.login();
cy.visit('/desk');
});
it('Default settings', () => {
cy.visit('/desk#List/DocType/List');
cy.get('.list-count').should('contain', "20 of");
cy.get('.sidebar-stat').should('contain', "Tags");
});
it('disable count and sidebar stats then verify', () => {
cy.visit('/desk#List/DocType/List');
cy.get('.list-count').should('contain', "20 of");
cy.get('button').contains('Menu').click();
cy.get('.dropdown-menu li').filter(':visible').contains('Settings').click();
cy.get('.modal-dialog').should('contain', 'Settings');
cy.get('input[data-fieldname="disable_count"]').check({force: true});
cy.get('input[data-fieldname="disable_sidebar_stats"]').check({force: true});
cy.get('button').filter(':visible').contains('Save').click();
cy.reload();
cy.get('.list-count').should('be.empty');
cy.get('.list-sidebar .sidebar-stat').should('not.exist');
cy.get('button').contains('Menu').click({force: true});
cy.get('.dropdown-menu li').filter(':visible').contains('Settings').click();
cy.get('.modal-dialog').should('contain', 'Settings');
cy.get('input[data-fieldname="disable_count"]').uncheck({force: true});
cy.get('input[data-fieldname="disable_sidebar_stats"]').uncheck({force: true});
cy.get('button').filter(':visible').contains('Save').click();
});
});