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.
 
 
 
 
 
 

71 regels
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('Navigate to Recorder', () => {
  15. cy.visit('/app');
  16. cy.awesomebar('recorder');
  17. cy.get('h3').should('contain', 'Recorder');
  18. cy.url().should('include', '/recorder/detail');
  19. });
  20. it('Recorder Empty State', () => {
  21. cy.get('.title-text').should('contain', 'Recorder');
  22. cy.get('.indicator-pill').should('contain', 'Inactive').should('have.class', 'red');
  23. cy.get('.primary-action').should('contain', 'Start');
  24. cy.get('.btn-secondary').should('contain', 'Clear');
  25. cy.get('.msg-box').should('contain', 'Inactive');
  26. cy.get('.msg-box .btn-primary').should('contain', 'Start Recording');
  27. });
  28. it('Recorder Start', () => {
  29. cy.get('.primary-action').should('contain', 'Start').click();
  30. cy.get('.indicator-pill').should('contain', 'Active').should('have.class', 'green');
  31. cy.get('.msg-box').should('contain', 'No Requests');
  32. cy.visit('/app/List/DocType/List');
  33. cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
  34. cy.wait('@list_refresh');
  35. cy.get('.title-text').should('contain', 'DocType');
  36. cy.get('.list-count').should('contain', '20 of ');
  37. cy.visit('/app/recorder');
  38. cy.get('.title-text').should('contain', 'Recorder');
  39. cy.get('.result-list').should('contain', '/api/method/frappe.desk.reportview.get');
  40. });
  41. it('Recorder View Request', () => {
  42. cy.get('.primary-action').should('contain', 'Start').click();
  43. cy.visit('/app/List/DocType/List');
  44. cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
  45. cy.wait('@list_refresh');
  46. cy.get('.title-text').should('contain', 'DocType');
  47. cy.get('.list-count').should('contain', '20 of ');
  48. cy.visit('/app/recorder');
  49. cy.get('.list-row-container span').contains('/api/method/frappe').click();
  50. cy.url().should('include', '/recorder/request');
  51. cy.get('form').should('contain', '/api/method/frappe');
  52. });
  53. });