Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

folder_navigation.js 3.5 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. context('Folder Navigation', () => {
  2. before(() => {
  3. cy.visit('/login');
  4. cy.login();
  5. cy.visit('/app/file');
  6. });
  7. it('Adding Folders', () => {
  8. //Adding filter to go into the home folder
  9. cy.get('.filter-selector > .btn').findByText('1 filter').click();
  10. cy.findByRole('button', {name: 'Clear Filters'}).click();
  11. cy.get('.filter-action-buttons > .text-muted').findByText('+ Add a Filter').click();
  12. cy.get('.fieldname-select-area > .awesomplete > .form-control').type('Fol{enter}');
  13. cy.get('.filter-field > .form-group > .link-field > .awesomplete > .input-with-feedback').type('Home{enter}');
  14. cy.get('.filter-action-buttons > div > .btn-primary').findByText('Apply Filters').click();
  15. //Adding folder (Test Folder)
  16. cy.get('.menu-btn-group > .btn').click();
  17. cy.get('.menu-btn-group [data-label="New Folder"]').click();
  18. cy.get('form > [data-fieldname="value"]').type('Test Folder');
  19. cy.findByRole('button', {name: 'Create'}).click();
  20. });
  21. it('Navigating the nested folders, checking if the URL formed is correct, checking if the added content in the child folder is correct', () => {
  22. //Navigating inside the Attachments folder
  23. cy.get('[title="Attachments"] > span').click();
  24. //To check if the URL formed after visiting the attachments folder is correct
  25. cy.location('pathname').should('eq', '/app/file/view/home/Attachments');
  26. cy.visit('/app/file/view/home/Attachments');
  27. //Adding folder inside the attachments folder
  28. cy.get('.menu-btn-group > .btn').click();
  29. cy.get('.menu-btn-group [data-label="New Folder"]').click();
  30. cy.get('form > [data-fieldname="value"]').type('Test Folder');
  31. cy.findByRole('button', {name: 'Create'}).click();
  32. //Navigating inside the added folder in the Attachments folder
  33. cy.get('[title="Test Folder"] > span').click();
  34. //To check if the URL is correct after visiting the Test Folder
  35. cy.location('pathname').should('eq', '/app/file/view/home/Attachments/Test%20Folder');
  36. cy.visit('/app/file/view/home/Attachments/Test%20Folder');
  37. //Adding a file inside the Test Folder
  38. cy.findByRole('button', {name: 'Add File'}).eq(0).click({force: true});
  39. cy.get('.file-uploader').findByText('Link').click();
  40. cy.get('.input-group > .form-control').type('https://wallpaperplay.com/walls/full/8/2/b/72402.jpg');
  41. cy.findByRole('button', {name: 'Upload'}).click();
  42. //To check if the added file is present in the Test Folder
  43. cy.get('span.level-item > span').should('contain', 'Test Folder');
  44. cy.get('.list-row-container').eq(0).should('contain.text', '72402.jpg');
  45. cy.get('.list-row-checkbox').eq(0).click();
  46. //Deleting the added file from the Test folder
  47. cy.findByRole('button', {name: 'Actions'}).click();
  48. cy.get('.actions-btn-group [data-label="Delete"]').click();
  49. cy.wait(700);
  50. cy.findByRole('button', {name: 'Yes'}).click();
  51. cy.wait(700);
  52. //Deleting the Test Folder
  53. cy.visit('/app/file/view/home/Attachments');
  54. cy.get('.list-row-checkbox').eq(0).click();
  55. cy.findByRole('button', {name: 'Actions'}).click();
  56. cy.get('.actions-btn-group [data-label="Delete"]').click();
  57. cy.findByRole('button', {name: 'Yes'}).click();
  58. });
  59. it('Deleting Test Folder from the home', () => {
  60. //Deleting the Test Folder added in the home directory
  61. cy.visit('/app/file/view/home');
  62. cy.get('.level-left > .list-subject > .file-select >.list-row-checkbox').eq(0).click({force: true, delay: 500});
  63. cy.findByRole('button', {name: 'Actions'}).click();
  64. cy.get('.actions-btn-group [data-label="Delete"]').click();
  65. cy.findByRole('button', {name: 'Yes'}).click();
  66. });
  67. });