click-page-icons.spec.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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').eq(0).click({force: true});
  16. cy.get('#subscribe-button').eq(0).should('have.class', 'active');
  17. cy.screenshot(`${ssPrefix}1-subscribe-page`);
  18. // Unsubscribe
  19. cy.get('#subscribe-button.active').eq(0).click({force: true});
  20. cy.get('#subscribe-button').eq(0).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.get('#grw-subnav-container').within(() => {
  69. cy.get('#btn-seen-user').click({force: true});
  70. });
  71. cy.get('.user-list-popover').should('be.visible');
  72. cy.get('#grw-subnav-container').within(() => {
  73. cy.screenshot(`${ssPrefix}11-seen-user-list`);
  74. });
  75. });
  76. });