Yuki Takei 4 лет назад
Родитель
Сommit
3adbbf3331

+ 38 - 16
packages/app/test/cypress/integration/2-basic-features/modal-for-page-operation.spec.ts

@@ -1,28 +1,17 @@
-context('Open PageCreateModal', () => {
+context('Modal for page operation', () => {
 
 
-  const ssPrefix = 'open-page-create-modal-';
+  const ssPrefix = 'modal-for-page-operation-';
 
 
-  let connectSid: string | undefined;
-
-  before(() => {
+  beforeEach(() => {
     // login
     // login
     cy.fixture("user-admin.json").then(user => {
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
       cy.login(user.username, user.password);
     });
     });
-    cy.getCookie('connect.sid').then(cookie => {
-      connectSid = cookie?.value;
-    });
-    // collapse sidebar
-    cy.collapseSidebar(true);
-  });
-
-  beforeEach(() => {
-    if (connectSid != null) {
-      cy.setCookie('connect.sid', connectSid);
-    }
   });
   });
 
 
   it("PageCreateModal is shown successfully", () => {
   it("PageCreateModal is shown successfully", () => {
+    cy.visit('/me');
+
     cy.getByTestid('newPageBtn').click();
     cy.getByTestid('newPageBtn').click();
 
 
     cy.getByTestid('page-create-modal').should('be.visible').screenshot(`${ssPrefix}-open`);
     cy.getByTestid('page-create-modal').should('be.visible').screenshot(`${ssPrefix}-open`);
@@ -34,4 +23,37 @@ context('Open PageCreateModal', () => {
     cy.screenshot(`${ssPrefix}-create-clicked`, {capture: 'viewport'});
     cy.screenshot(`${ssPrefix}-create-clicked`, {capture: 'viewport'});
   });
   });
 
 
+  it('PageDeleteModal is shown successfully', () => {
+    cy.visit('/Sandbox/Bootstrap4');
+
+     cy.get('#grw-subnav-container').within(() => {
+       cy.getByTestid('open-page-item-control-btn').click();
+       cy.getByTestid('open-page-delete-modal-btn').click();
+    });
+
+     cy.getByTestid('page-delete-modal').should('be.visible').screenshot(`${ssPrefix}-delete-bootstrap4`);
+  });
+
+  it('PageDuplicateModal is shown successfully', () => {
+    cy.visit('/Sandbox/Bootstrap4', {  });
+
+    cy.get('#grw-subnav-container').within(() => {
+      cy.getByTestid('open-page-item-control-btn').click();
+      cy.getByTestid('open-page-duplicate-modal-btn').click();
+    });
+
+    cy.getByTestid('page-duplicate-modal').should('be.visible').screenshot(`${ssPrefix}-duplicate-bootstrap4`);
+  });
+
+  it('PageMoveRenameModal is shown successfully', () => {
+    cy.visit('/Sandbox/Bootstrap4', {  });
+
+    cy.get('#grw-subnav-container').within(() => {
+      cy.getByTestid('open-page-item-control-btn').click();
+      cy.getByTestid('open-page-move-rename-modal-btn').click();
+    });
+
+    cy.getByTestid('page-rename-modal').should('be.visible').screenshot(`${ssPrefix}-rename-bootstrap4`);
+  });
+
 });
 });

+ 0 - 36
packages/app/test/cypress/integration/2-basic-features/open-page-delete-modal.spec.ts

@@ -1,36 +0,0 @@
-context('Open Page Delete Modal', () => {
-
-  const ssPrefix = 'access-to-page-delete-modal-';
-
-  let connectSid: string | undefined;
-
-  before(() => {
-    // login
-    cy.fixture("user-admin.json").then(user => {
-      cy.login(user.username, user.password);
-    });
-    cy.getCookie('connect.sid').then(cookie => {
-      connectSid = cookie?.value;
-    });
-    // collapse sidebar
-    cy.collapseSidebar(true);
-  });
-
-  beforeEach(() => {
-    if (connectSid != null) {
-      cy.setCookie('connect.sid', connectSid);
-    }
-  });
-
-  it('PageDeleteModal is shown successfully', () => {
-     cy.visit('/Sandbox/Bootstrap4', {  });
-     cy.get('#grw-subnav-container').within(() => {
-       cy.getByTestid('open-page-item-control-btn').click();
-       cy.getByTestid('open-page-delete-modal-btn').click();
-    });
-
-     cy.getByTestid('page-delete-modal').should('be.visible').screenshot(`${ssPrefix}-open-bootstrap4`);
-  });
-
-});
-

+ 0 - 34
packages/app/test/cypress/integration/2-basic-features/open-page-duplicate-modal.spec.ts

@@ -1,34 +0,0 @@
-context('Open Page Duplicate Modal', () => {
-
-  const ssPrefix = 'access-to-page-duplicate-modal-';
-
-  let connectSid: string | undefined;
-
-  before(() => {
-    // login
-    cy.fixture("user-admin.json").then(user => {
-      cy.login(user.username, user.password);
-    });
-    cy.getCookie('connect.sid').then(cookie => {
-      connectSid = cookie?.value;
-    });
-    // collapse sidebar
-    cy.collapseSidebar(true);
-  });
-
-  beforeEach(() => {
-    if (connectSid != null) {
-      cy.setCookie('connect.sid', connectSid);
-    }
-  });
-
-  it('PageDuplicateModal is shown successfully', () => {
-     cy.visit('/Sandbox/Bootstrap4', {  });
-     cy.get('#grw-subnav-container').within(() => {
-       cy.getByTestid('open-page-item-control-btn').click();
-       cy.getByTestid('open-page-duplicate-modal-btn').click();
-    });
-     cy.getByTestid('page-duplicate-modal').should('be.visible').screenshot(`${ssPrefix}-open-bootstrap4`);
-  });
-
-});

+ 0 - 35
packages/app/test/cypress/integration/2-basic-features/open-page-move-rename-modal.spec.ts

@@ -1,35 +0,0 @@
-context('Open Page Move Rename Modal', () => {
-
-  const ssPrefix = 'access-to-page-move-rename-modal';
-
-  let connectSid: string | undefined;
-
-  before(() => {
-    // login
-    cy.fixture("user-admin.json").then(user => {
-      cy.login(user.username, user.password);
-    });
-    cy.getCookie('connect.sid').then(cookie => {
-      connectSid = cookie?.value;
-    });
-    // collapse sidebar
-    cy.collapseSidebar(true);
-  });
-
-  beforeEach(() => {
-    if (connectSid != null) {
-      cy.setCookie('connect.sid', connectSid);
-    }
-  });
-
-  it('PageMoveRenameModal is shown successfully', () => {
-     cy.visit('/Sandbox/Bootstrap4', {  });
-     cy.get('#grw-subnav-container').within(() => {
-       cy.getByTestid('open-page-item-control-btn').click();
-       cy.getByTestid('open-page-move-rename-modal-btn').click();
-    });
-
-     cy.getByTestid('page-rename-modal').should('be.visible').screenshot(`${ssPrefix}-open-bootstrap4`);
-  });
-
-});