create-page.spec.ts 842 B

1234567891011121314151617181920212223242526272829303132333435
  1. context('Create page modal', () => {
  2. const ssPrefix = 'create-page';
  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. cy.visit('/');
  17. }
  18. });
  19. it("Page create modal is shown successfully", () => {
  20. cy.getByTestid('newPageBtn').click();
  21. cy.screenshot(`${ssPrefix}-opne-modal at '/' page`)
  22. });
  23. it("Page create modal is shown successfully at /Sandbox page", ()=>{
  24. cy.visit('/Sandbox');
  25. cy.getByTestid('newPageBtn').click();
  26. cy.screenshot(`${ssPrefix}-open-modal-at /Sandbox`)
  27. });
  28. });