You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
1.1 KiB

  1. context('List View', () => {
  2. before(() => {
  3. cy.login();
  4. cy.visit('/desk');
  5. cy.window().its('frappe').then(frappe => {
  6. frappe.call("frappe.tests.ui_test_helpers.setup_workflow");
  7. });
  8. cy.clear_cache();
  9. });
  10. it('enables "Actions" button', () => {
  11. const actions = ['Approve', 'Reject', 'Edit', 'Assign To', 'Print','Delete'];
  12. cy.go_to_list('ToDo');
  13. cy.get('.level-item.list-row-checkbox.hidden-xs').click({ multiple: true, force: true });
  14. cy.get('.btn.btn-primary.btn-sm.dropdown-toggle').contains('Actions').should('be.visible').click();
  15. cy.get('.dropdown-menu li:visible').should('have.length', 6).each((el, index) => {
  16. cy.wrap(el).contains(actions[index]);
  17. }).then((elements) => {
  18. cy.server();
  19. cy.route({
  20. method: 'POST',
  21. url:'api/method/frappe.model.workflow.bulk_workflow_approval'
  22. }).as('bulk-approval');
  23. cy.route({
  24. method: 'GET',
  25. url:'api/method/frappe.desk.reportview.get*'
  26. }).as('update-list');
  27. cy.wrap(elements).contains('Approve').click();
  28. cy.wait(['@bulk-approval', '@update-list']);
  29. cy.get('.list-row-container:visible').should('contain', 'Approved');
  30. });
  31. });
  32. });