Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

64 righe
2.2 KiB

  1. context('Dashboard links', () => {
  2. before(() => {
  3. cy.visit('/login');
  4. cy.login();
  5. });
  6. it('Adding a new contact, checking for the counter on the dashboard and deleting the created contact', () => {
  7. cy.visit('/app/contact');
  8. cy.clear_filters();
  9. cy.visit('/app/user');
  10. cy.get('.list-row-col > .level-item > .ellipsis').eq(0).click();
  11. //To check if initially the dashboard contains only the "Contact" link and there is no counter
  12. cy.get('[data-doctype="Contact"]').should('contain', 'Contact');
  13. //Adding a new contact
  14. cy.get('.btn[data-doctype="Contact"]').click();
  15. cy.get('[data-doctype="Contact"][data-fieldname="first_name"]').type('Admin');
  16. cy.findByRole('button', {name: 'Save'}).click();
  17. cy.visit('/app/user');
  18. cy.get('.list-row-col > .level-item > .ellipsis').eq(0).click();
  19. //To check if the counter for contact doc is "1" after adding the contact
  20. cy.get('[data-doctype="Contact"] > .count').should('contain', '1');
  21. cy.get('[data-doctype="Contact"]').contains('Contact').click();
  22. //Deleting the newly created contact
  23. cy.visit('/app/contact');
  24. cy.get('.list-subject > .select-like > .list-row-checkbox').eq(0).click();
  25. cy.findByRole('button', {name: 'Actions'}).click();
  26. cy.get('.actions-btn-group [data-label="Delete"]').click();
  27. cy.findByRole('button', {name: 'Yes'}).click({delay: 700});
  28. //To check if the counter from the "Contact" doc link is removed
  29. cy.wait(700);
  30. cy.visit('/app/user');
  31. cy.get('.list-row-col > .level-item > .ellipsis').eq(0).click();
  32. cy.get('[data-doctype="Contact"]').should('contain', 'Contact');
  33. });
  34. it('Report link in dashboard', () => {
  35. cy.visit('/app/user');
  36. cy.visit('/app/user/Administrator');
  37. cy.get('[data-doctype="Contact"]').should('contain', 'Contact');
  38. cy.findByText('Connections');
  39. cy.window()
  40. .its('cur_frm')
  41. .then(cur_frm => {
  42. cur_frm.dashboard.data.reports = [
  43. {
  44. 'label': 'Reports',
  45. 'items': ['Permitted Documents For User']
  46. }
  47. ];
  48. cur_frm.dashboard.render_report_links();
  49. cy.get('[data-report="Permitted Documents For User"]').contains('Permitted Documents For User').click();
  50. cy.findByText('Permitted Documents For User');
  51. cy.findByPlaceholderText('User').should("have.value", "Administrator");
  52. });
  53. });
  54. });