您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

73 行
2.4 KiB

  1. context('Recorder', () => {
  2. before(() => {
  3. cy.login();
  4. });
  5. it('Navigate to Recorder', () => {
  6. cy.visit('/desk');
  7. cy.awesomebar('recorder');
  8. cy.get('h1').should('contain', 'Recorder');
  9. cy.location('hash').should('eq', '#recorder');
  10. });
  11. it('Recorder Empty State', () => {
  12. cy.visit('/desk#recorder');
  13. cy.get('.title-text').should('contain', 'Recorder');
  14. cy.get('.indicator').should('contain', 'Inactive').should('have.class', 'red');
  15. cy.get('.primary-action').should('contain', 'Start');
  16. cy.get('.btn-secondary').should('contain', 'Clear');
  17. cy.get('.msg-box').should('contain', 'Inactive');
  18. cy.get('.msg-box .btn-primary').should('contain', 'Start Recording');
  19. });
  20. it('Recorder Start', () => {
  21. cy.visit('/desk#recorder');
  22. cy.get('.primary-action').should('contain', 'Start').click();
  23. cy.get('.indicator').should('contain', 'Active').should('have.class', 'green');
  24. cy.get('.msg-box').should('contain', 'No Requests');
  25. cy.server();
  26. cy.visit('/desk#List/DocType/List');
  27. cy.route('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
  28. cy.wait('@list_refresh');
  29. cy.get('.title-text').should('contain', 'DocType');
  30. cy.get('.list-count').should('contain', '20 of ');
  31. cy.visit('/desk#recorder');
  32. cy.get('.title-text').should('contain', 'Recorder');
  33. cy.get('.result-list').should('contain', '/api/method/frappe.desk.reportview.get');
  34. cy.get('#page-recorder .primary-action').should('contain', 'Stop').click();
  35. cy.get('#page-recorder .btn-secondary').should('contain', 'Clear').click();
  36. cy.get('.msg-box').should('contain', 'Inactive');
  37. });
  38. it('Recorder View Request', () => {
  39. cy.visit('/desk#recorder');
  40. cy.get('.primary-action').should('contain', 'Start').click();
  41. cy.server();
  42. cy.visit('/desk#List/DocType/List');
  43. cy.route('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
  44. cy.wait('@list_refresh');
  45. cy.get('.title-text').should('contain', 'DocType');
  46. cy.get('.list-count').should('contain', '20 of ');
  47. cy.visit('/desk#recorder');
  48. cy.contains('.list-row-container span', 'frappe.desk.reportview.get').click();
  49. cy.location('hash').should('contain', '#recorder/request/');
  50. cy.get('form').should('contain', 'frappe.desk.reportview.get');
  51. cy.get('#page-recorder .primary-action').should('contain', 'Stop').click();
  52. cy.get('#page-recorder .btn-secondary').should('contain', 'Clear').click();
  53. cy.location('hash').should('eq', '#recorder');
  54. });
  55. });