jam411 3 лет назад
Родитель
Сommit
20e77a400e

+ 1 - 2
packages/app/test/cypress/integration/20-basic-features/access-to-page.spec.ts

@@ -74,7 +74,6 @@ context('Access to /me page', () => {
   //   cy.visit('/me/drafts');
   //   cy.visit('/me/drafts');
   //   cy.screenshot(`${ssPrefix}-draft-page`);
   //   cy.screenshot(`${ssPrefix}-draft-page`);
   // });
   // });
-
 });
 });
 
 
 
 
@@ -93,7 +92,7 @@ context('Access to special pages', () => {
 
 
   it('/trash is successfully loaded', () => {
   it('/trash is successfully loaded', () => {
     cy.visit('/trash', {  });
     cy.visit('/trash', {  });
-    cy.getByTestid('trash-page-list', { timeout: 10000 }).should('be.visible');
+    cy.getByTestid('trash-page-list').should('be.visible');
     cy.screenshot(`${ssPrefix}-trash`);
     cy.screenshot(`${ssPrefix}-trash`);
   });
   });
 
 

+ 1 - 1
packages/app/test/cypress/integration/20-basic-features/access-to-pagelist.spec.ts

@@ -90,7 +90,7 @@ context('Access to timeline', () => {
       cy.get('.nav-title > li').eq(1).find('a').click();
       cy.get('.nav-title > li').eq(1).find('a').click();
       cy.get('button.close').eq(0).click();
       cy.get('button.close').eq(0).click();
     });
     });
-    cy.get('.modal').should('be.visible');
+    cy.get('.modal').should('be.visible').scrollTo('top');
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     cy.wait(500); // wait for loading wiki
     cy.wait(500); // wait for loading wiki
     cy.screenshot(`${ssPrefix}2-timeline-list-fullscreen`, {capture: 'viewport'});
     cy.screenshot(`${ssPrefix}2-timeline-list-fullscreen`, {capture: 'viewport'});

+ 6 - 5
packages/app/test/cypress/integration/20-basic-features/click-page-icons.spec.ts

@@ -14,13 +14,13 @@ context('Click page icons button', () => {
     cy.visit('/Sandbox');
     cy.visit('/Sandbox');
     cy.get('#grw-subnav-container').within(() => {
     cy.get('#grw-subnav-container').within(() => {
       // Subscribe
       // Subscribe
-      cy.get('#subscribe-button').click({force: true});
-      cy.get('#subscribe-button').should('have.class', 'active');
+      cy.get('#subscribe-button').eq(0).click({force: true});
+      cy.get('#subscribe-button').eq(0).should('have.class', 'active');
       cy.screenshot(`${ssPrefix}1-subscribe-page`);
       cy.screenshot(`${ssPrefix}1-subscribe-page`);
 
 
       // Unsubscribe
       // Unsubscribe
       cy.get('#subscribe-button.active').eq(0).click({force: true});
       cy.get('#subscribe-button.active').eq(0).click({force: true});
-      cy.get('#subscribe-button').should('not.have.class', 'active');
+      cy.get('#subscribe-button').eq(0).should('not.have.class', 'active');
       cy.screenshot(`${ssPrefix}2-unsubscribe-page`);
       cy.screenshot(`${ssPrefix}2-unsubscribe-page`);
     });
     });
   });
   });
@@ -77,8 +77,9 @@ context('Click page icons button', () => {
 
 
   it('Successfully display list of "seen by user"', () => {
   it('Successfully display list of "seen by user"', () => {
     cy.visit('/Sandbox');
     cy.visit('/Sandbox');
-    cy.get('#grw-subnav-container');
-    cy.get('#btn-seen-user').click({force: true});
+    cy.get('#grw-subnav-container').within(() => {
+      cy.get('#btn-seen-user').click({force: true});
+    });
 
 
     cy.get('.user-list-popover').should('be.visible');
     cy.get('.user-list-popover').should('be.visible');
 
 

+ 4 - 6
packages/app/test/cypress/integration/21-basic-features-for-guest/access-to-page.spec.ts

@@ -11,7 +11,7 @@ context('Access to page by guest', () => {
     cy.visit('/Sandbox#Headers');
     cy.visit('/Sandbox#Headers');
     cy.collapseSidebar(true, true);
     cy.collapseSidebar(true, true);
 
 
-    // // eslint-disable-next-line cypress/no-unnecessary-waiting
+    // eslint-disable-next-line cypress/no-unnecessary-waiting
     // cy.wait(500);
     // cy.wait(500);
 
 
     // hide fab // disable fab for sticky-events warning
     // hide fab // disable fab for sticky-events warning
@@ -24,7 +24,7 @@ context('Access to page by guest', () => {
     cy.visit('/Sandbox/Math');
     cy.visit('/Sandbox/Math');
     cy.collapseSidebar(true, true);
     cy.collapseSidebar(true, true);
 
 
-    cy.get('div.layout-root > div:nth-child(2) > div:nth-child(4) > div.content-main > div:nth-child(2) > div.wiki'),within(() => {
+    cy.get('div.layout-root > div:nth-child(2) > div:nth-child(4) > div.content-main > div:nth-child(2) > div.wiki').within(() => {
       cy.get('.math').should('be.visible');
       cy.get('.math').should('be.visible');
     }).screenshot(`${ssPrefix}-sandbox-math`);
     }).screenshot(`${ssPrefix}-sandbox-math`);
   });
   });
@@ -64,8 +64,7 @@ context('Access to special pages by guest', () => {
   it('/trash is successfully loaded', () => {
   it('/trash is successfully loaded', () => {
     cy.visit('/trash', {  });
     cy.visit('/trash', {  });
     cy.collapseSidebar(true, true);
     cy.collapseSidebar(true, true);
-    cy.get('.page-wrapper > div:nth-child(2) > div:nth-child(1) > div').getByTestid('trash-page-list').should('be.visible');
-    // cy.getByTestid('trash-page-list', { timeout: 10000 }).should('be.visible');
+    cy.getByTestid('trash-page-list').should('be.visible');
     cy.screenshot(`${ssPrefix}-trash`);
     cy.screenshot(`${ssPrefix}-trash`);
   });
   });
 
 
@@ -80,8 +79,7 @@ context('Access to special pages by guest', () => {
     cy.getByTestid('grw-tags-list').should('be.visible');
     cy.getByTestid('grw-tags-list').should('be.visible');
     cy.getByTestid('grw-tags-list').contains('You have no tag, You can set tags on pages');
     cy.getByTestid('grw-tags-list').contains('You have no tag, You can set tags on pages');
 
 
-    cy.get('div.layout-root > div:nth-child(2) > div:nth-child(2) > div').getByTestid('tags-page').should('be.visible');
-    // cy.getByTestid('tags-page', { timeout: 10000 }).should('be.visible');
+    cy.getByTestid('tags-page').should('be.visible');
     cy.screenshot(`${ssPrefix}-tags`);
     cy.screenshot(`${ssPrefix}-tags`);
   });
   });