-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathlist_view.js
33 lines (32 loc) · 1.12 KB
/
list_view.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
context('List View', () => {
before(() => {
cy.login();
cy.visit('/desk');
cy.window().its('frappe').then(frappe => {
frappe.call("frappe.tests.ui_test_helpers.setup_workflow");
});
cy.clear_cache();
});
it('enables "Actions" button', () => {
const actions = ['Approve', 'Reject', 'Edit', 'Assign To', 'Print','Delete'];
cy.go_to_list('ToDo');
cy.get('.level-item.list-row-checkbox.hidden-xs').click({ multiple: true, force: true });
cy.get('.btn.btn-primary.btn-sm.dropdown-toggle').contains('Actions').should('be.visible').click();
cy.get('.dropdown-menu li:visible').should('have.length', 6).each((el, index) => {
cy.wrap(el).contains(actions[index]);
}).then((elements) => {
cy.server();
cy.route({
method: 'POST',
url:'api/method/frappe.model.workflow.bulk_workflow_approval'
}).as('bulk-approval');
cy.route({
method: 'GET',
url:'api/method/frappe.desk.reportview.get*'
}).as('update-list');
cy.wrap(elements).contains('Approve').click();
cy.wait(['@bulk-approval', '@update-list']);
cy.get('.list-row-container:visible').should('contain', 'Approved');
});
});
});