Shun Miyazawa 3 lat temu
rodzic
commit
98bf00e8a6

+ 27 - 7
packages/app/test/cypress/integration/20-basic-features/use-tools.spec.ts

@@ -11,6 +11,8 @@ context('Switch Sidebar content', () => {
   it('PageTree is successfully shown', () => {
   it('PageTree is successfully shown', () => {
     cy.collapseSidebar(false);
     cy.collapseSidebar(false);
     cy.visit('/page');
     cy.visit('/page');
+    cy.waitUntilSkeletonDisappear();
+
     cy.getByTestid('grw-sidebar-nav-primary-page-tree').click();
     cy.getByTestid('grw-sidebar-nav-primary-page-tree').click();
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     cy.wait(1500);
     cy.wait(1500);
@@ -47,8 +49,8 @@ context('Modal for page operation', () => {
   it("Successfully Create Today's page", () => {
   it("Successfully Create Today's page", () => {
     const pageName = "Today's page";
     const pageName = "Today's page";
     cy.visit('/');
     cy.visit('/');
-
     cy.waitUntilSkeletonDisappear();
     cy.waitUntilSkeletonDisappear();
+
     cy.getByTestid('newPageBtn').click();
     cy.getByTestid('newPageBtn').click();
 
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
@@ -61,7 +63,13 @@ context('Modal for page operation', () => {
     cy.get('.layout-root').should('not.have.class', 'editing');
     cy.get('.layout-root').should('not.have.class', 'editing');
 
 
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
-    cy.waitUntilSkeletonDisappear();
+
+    // eslint-disable-next-line cypress/no-unnecessary-waiting
+    cy.wait(300);
+
+    // Do not use "cy.waitUntilSkeletonDisappear()"
+    cy.get('.grw-skeleton').should('not.exist');
+
     cy.screenshot(`${ssPrefix}create-today-page`);
     cy.screenshot(`${ssPrefix}create-today-page`);
   });
   });
 
 
@@ -69,8 +77,8 @@ context('Modal for page operation', () => {
     const pageName = 'child';
     const pageName = 'child';
 
 
     cy.visit('/SandBox');
     cy.visit('/SandBox');
-
     cy.waitUntilSkeletonDisappear();
     cy.waitUntilSkeletonDisappear();
+
     cy.getByTestid('newPageBtn').click();
     cy.getByTestid('newPageBtn').click();
 
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
@@ -83,13 +91,18 @@ context('Modal for page operation', () => {
     cy.get('.layout-root').should('not.have.class', 'editing');
     cy.get('.layout-root').should('not.have.class', 'editing');
 
 
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
-    cy.waitUntilSkeletonDisappear();
+
+    // eslint-disable-next-line cypress/no-unnecessary-waiting
+    cy.wait(300);
+
+    // Do not use "cy.waitUntilSkeletonDisappear()"
+    cy.get('.grw-skeleton').should('not.exist');
+
     cy.screenshot(`${ssPrefix}create-page-under-specific-page`);
     cy.screenshot(`${ssPrefix}create-page-under-specific-page`);
   });
   });
 
 
   it('Trying to create template page under the root page fail', () => {
   it('Trying to create template page under the root page fail', () => {
     cy.visit('/');
     cy.visit('/');
-
     cy.waitUntilSkeletonDisappear();
     cy.waitUntilSkeletonDisappear();
 
 
     cy.getByTestid('newPageBtn').click();
     cy.getByTestid('newPageBtn').click();
@@ -118,6 +131,7 @@ context('Modal for page operation', () => {
 
 
   it('PageDeleteModal is shown successfully', () => {
   it('PageDeleteModal is shown successfully', () => {
     cy.visit('/Sandbox/Bootstrap4');
     cy.visit('/Sandbox/Bootstrap4');
+    cy.waitUntilSkeletonDisappear();
 
 
      cy.get('#grw-subnav-container').within(() => {
      cy.get('#grw-subnav-container').within(() => {
        cy.getByTestid('open-page-item-control-btn').click({force: true});
        cy.getByTestid('open-page-item-control-btn').click({force: true});
@@ -128,7 +142,8 @@ context('Modal for page operation', () => {
   });
   });
 
 
   it('PageDuplicateModal is shown successfully', () => {
   it('PageDuplicateModal is shown successfully', () => {
-    cy.visit('/Sandbox/Bootstrap4', {  });
+    cy.visit('/Sandbox/Bootstrap4');
+    cy.waitUntilSkeletonDisappear();
 
 
     cy.get('#grw-subnav-container').within(() => {
     cy.get('#grw-subnav-container').within(() => {
       cy.getByTestid('open-page-item-control-btn').click({force: true});
       cy.getByTestid('open-page-item-control-btn').click({force: true});
@@ -197,6 +212,8 @@ context('Page Accessories Modal', () => {
 
 
   it('Page History is shown successfully', () => {
   it('Page History is shown successfully', () => {
      cy.visit('/Sandbox/Bootstrap4');
      cy.visit('/Sandbox/Bootstrap4');
+     cy.waitUntilSkeletonDisappear();
+
      cy.get('#grw-subnav-container').within(() => {
      cy.get('#grw-subnav-container').within(() => {
       cy.getByTestid('open-page-item-control-btn').within(() => {
       cy.getByTestid('open-page-item-control-btn').within(() => {
         cy.get('button.btn-page-item-control').click({force: true});
         cy.get('button.btn-page-item-control').click({force: true});
@@ -227,7 +244,9 @@ context('Page Accessories Modal', () => {
   });
   });
 
 
   it('Share Link Management is shown successfully', () => {
   it('Share Link Management is shown successfully', () => {
-    cy.visit('/Sandbox/Bootstrap4', { });
+    cy.visit('/Sandbox/Bootstrap4');
+    cy.waitUntilSkeletonDisappear();
+
     cy.get('#grw-subnav-container').within(() => {
     cy.get('#grw-subnav-container').within(() => {
       cy.getByTestid('open-page-item-control-btn').within(() => {
       cy.getByTestid('open-page-item-control-btn').within(() => {
         cy.get('button.btn-page-item-control').click({force: true});
         cy.get('button.btn-page-item-control').click({force: true});
@@ -338,6 +357,7 @@ context('Tag Oprations', { scrollBehavior: false }, () =>{
     cy.getByTestid('page-duplicate-modal').within(() => {
     cy.getByTestid('page-duplicate-modal').within(() => {
       cy.get('.modal-footer > button.btn').click();
       cy.get('.modal-footer > button.btn').click();
     });
     });
+
     cy.visit(`Sandbox-${newPageName}`);
     cy.visit(`Sandbox-${newPageName}`);
     cy.waitUntilSkeletonDisappear();
     cy.waitUntilSkeletonDisappear();
     cy.screenshot(`${ssPrefix}4-duplicated-page`);
     cy.screenshot(`${ssPrefix}4-duplicated-page`);