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.
 
 
 
 
 
 

64 lines
2.1 KiB

  1. context('Recorder', () => {
  2. before(() => {
  3. cy.login();
  4. });
  5. beforeEach(() => {
  6. cy.visit('/app/recorder');
  7. return cy.window().its('frappe').then(frappe => {
  8. // reset recorder
  9. return frappe.xcall("frappe.recorder.stop").then(() => {
  10. return frappe.xcall("frappe.recorder.delete");
  11. });
  12. });
  13. });
  14. it('Recorder Empty State', () => {
  15. cy.get('.page-head').findByTitle('Recorder').should('exist');
  16. cy.get('.indicator-pill').should('contain', 'Inactive').should('have.class', 'red');
  17. cy.get('.page-actions').findByRole('button', {name: 'Start'}).should('exist');
  18. cy.get('.page-actions').findByRole('button', {name: 'Clear'}).should('exist');
  19. cy.get('.msg-box').should('contain', 'Recorder is Inactive');
  20. cy.get('.msg-box').findByRole('button', {name: 'Start Recording'}).should('exist');
  21. });
  22. it('Recorder Start', () => {
  23. cy.get('.page-actions').findByRole('button', {name: 'Start'}).click();
  24. cy.get('.indicator-pill').should('contain', 'Active').should('have.class', 'green');
  25. cy.get('.msg-box').should('contain', 'No Requests found');
  26. cy.visit('/app/List/DocType/List');
  27. cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
  28. cy.wait('@list_refresh');
  29. cy.get('.page-head').findByTitle('DocType').should('exist');
  30. cy.get('.list-count').should('contain', '20 of ');
  31. cy.visit('/app/recorder');
  32. cy.get('.page-head').findByTitle('Recorder').should('exist');
  33. cy.get('.frappe-list .result-list').should('contain', '/api/method/frappe.desk.reportview.get');
  34. });
  35. it('Recorder View Request', () => {
  36. cy.get('.page-actions').findByRole('button', {name: 'Start'}).click();
  37. cy.visit('/app/List/DocType/List');
  38. cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
  39. cy.wait('@list_refresh');
  40. cy.get('.page-head').findByTitle('DocType').should('exist');
  41. cy.get('.list-count').should('contain', '20 of ');
  42. cy.visit('/app/recorder');
  43. cy.get('.frappe-list .list-row-container span').contains('/api/method/frappe').should('be.visible').click();
  44. cy.url().should('include', '/recorder/request');
  45. cy.get('form').should('contain', '/api/method/frappe');
  46. });
  47. });