click-page-icons.spec.ts 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. context('Click page icons button', () => {
  2. const ssPrefix = 'click-page-icon-';
  3. beforeEach(() => {
  4. // login
  5. cy.fixture("user-admin.json").then(user => {
  6. cy.login(user.username, user.password);
  7. });
  8. // collapse sidebar
  9. cy.collapseSidebar(true);
  10. });
  11. it('Successfully subscribe/unsubscribe a page', () => {
  12. cy.visit('/Sandbox');
  13. cy.get('#grw-subnav-container').within(() => {
  14. // Subscribe
  15. cy.get('#subscribe-button').click({force: true});
  16. cy.get('#subscribe-button').should('have.class', 'active');
  17. cy.screenshot(`${ssPrefix}1-subscribe-page`);
  18. // Unsubscribe
  19. cy.get('#subscribe-button.active').click({force: true});
  20. cy.get('#subscribe-button').should('not.have.class', 'active');
  21. cy.screenshot(`${ssPrefix}2-unsubscribe-page`);
  22. });
  23. });
  24. it('Successfully Like / Dislike a page', () => {
  25. cy.visit('/Sandbox');
  26. cy.get('#grw-subnav-container').within(() => {
  27. cy.get('#like-button').click({force: true});
  28. cy.get('#like-button').should('have.class', 'active');
  29. cy.screenshot(`${ssPrefix}3-like-page`);
  30. cy.get('#po-total-likes').click({force: true});
  31. });
  32. cy.get('.user-list-popover').should('be.visible');
  33. cy.get('#grw-subnav-container').within(() => {
  34. cy.screenshot(`${ssPrefix}4-likes-counter`);
  35. cy.get('#like-button.active').click({force: true});
  36. cy.get('#like-button').should('not.have.class', 'active');
  37. cy.screenshot(`${ssPrefix}5-dislike-page`);
  38. cy.get('#po-total-likes').click({force: true});
  39. });
  40. cy.get('.user-list-popover').should('be.visible');
  41. cy.get('#grw-subnav-container').within(() => {
  42. cy.screenshot(`${ssPrefix}6-likes-counter`);
  43. });
  44. });
  45. it('Successfully Bookmark / Unbookmark a page', () => {
  46. cy.visit('/Sandbox');
  47. cy.get('#grw-subnav-container').within(() => {
  48. cy.get('#bookmark-button').click({force: true});
  49. cy.get('#bookmark-button').should('have.class', 'active');
  50. cy.screenshot(`${ssPrefix}7-bookmark-page`);
  51. cy.get('#po-total-bookmarks').click({force: true});
  52. });
  53. cy.get('.user-list-popover').should('be.visible');
  54. cy.get('#grw-subnav-container').within(() => {
  55. cy.screenshot(`${ssPrefix}8-bookmarks-counter`);
  56. cy.get('#bookmark-button.active').click({force: true});
  57. cy.get('#bookmark-button').should('not.have.class', 'active');
  58. cy.screenshot(`${ssPrefix}9-unbookmark-page`);
  59. cy.get('#po-total-bookmarks').click({force: true});
  60. });
  61. cy.get('.user-list-popover').should('be.visible');
  62. cy.get('#grw-subnav-container').within(() => {
  63. cy.screenshot(`${ssPrefix}10-bookmarks-counter`);
  64. });
  65. });
  66. it('Successfully display list of "seen by user"', () => {
  67. cy.visit('/Sandbox');
  68. cy.waitUntilSkeletonDisappear();
  69. // eslint-disable-next-line cypress/no-unnecessary-waiting
  70. cy.wait(2000); // wait for get method
  71. cy.get('#grw-subnav-container').within(() => {
  72. cy.get('div.grw-seen-user-info').find('button#btn-seen-user').click({force: true});
  73. });
  74. cy.get('.user-list-popover').should('be.visible')
  75. cy.get('#grw-subnav-container').within(() => {
  76. cy.screenshot(`${ssPrefix}11-seen-user-list`);
  77. });
  78. });
  79. });