open-presentation-modal.spec.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. context('Open presentation modal', () => {
  2. const ssPrefix = 'access-to-presentation-modal-';
  3. let connectSid: string | undefined;
  4. before(() => {
  5. // login
  6. cy.fixture("user-admin.json").then(user => {
  7. cy.login(user.username, user.password);
  8. });
  9. cy.getCookie('connect.sid').then(cookie => {
  10. connectSid = cookie?.value;
  11. });
  12. });
  13. beforeEach(() => {
  14. if (connectSid != null) {
  15. cy.setCookie('connect.sid', connectSid);
  16. }
  17. });
  18. it('Successfully loaded the presentation modal in /', () => {
  19. cy.visit('/');
  20. cy.getByTestid('sub-nav-buttons-page-item-control').first().click();
  21. cy.getByTestid('open-presentation-modal-btn').first().click();
  22. // eslint-disable-next-line cypress/no-unnecessary-waiting
  23. cy.wait(1500);
  24. cy.screenshot(`${ssPrefix}-top`, { capture: 'viewport' });
  25. });
  26. it('Successfully loaded the presentation modal in "/Sandbox/Bootstrap4"', () => {
  27. cy.visit('/Sandbox/Bootstrap4');
  28. cy.getByTestid('sub-nav-buttons-page-item-control').first().click();
  29. cy.getByTestid('open-presentation-modal-btn').first().click();
  30. // eslint-disable-next-line cypress/no-unnecessary-waiting
  31. cy.wait(1500);
  32. cy.screenshot(`${ssPrefix}-sandbox`, { capture: 'viewport' });
  33. });
  34. it('Successfully loaded the presentation modal in "/Sandbox/Bootstrap4#Cards"', () => {
  35. cy.visit('/Sandbox/Bootstrap4#Cards');
  36. cy.getByTestid('sub-nav-buttons-page-item-control').first().click();
  37. cy.getByTestid('open-presentation-modal-btn').first().click();
  38. // eslint-disable-next-line cypress/no-unnecessary-waiting
  39. cy.wait(1500);
  40. cy.screenshot(`${ssPrefix}-Bootstrap4-with-anker-lint`, { capture: 'viewport' });
  41. });
  42. });