Browse Source

fix VRT tests

Yuki Takei 3 years ago
parent
commit
ea71ee70d8

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

@@ -112,7 +112,9 @@ context('Click page icons button', () => {
       // do
       // do
       cy.get('#po-total-bookmarks').click({force: true});
       cy.get('#po-total-bookmarks').click({force: true});
       // wait until
       // wait until
-      return Cypress.$('.user-list-popover').is(':visible');
+      return cy.get('body').within(() => {
+        return Cypress.$('.user-list-popover').is(':visible');
+      });
     });
     });
     cy.waitUntilSpinnerDisappear();
     cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}8-bookmarks-counter`) });
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}8-bookmarks-counter`) });
@@ -137,7 +139,9 @@ context('Click page icons button', () => {
       // do
       // do
       cy.get('#po-total-bookmarks').click({force: true});
       cy.get('#po-total-bookmarks').click({force: true});
       // wait until
       // wait until
-      return Cypress.$('.user-list-popover').is(':visible');
+      return cy.get('body').within(() => {
+        return Cypress.$('.user-list-popover').is(':visible');
+      });
     });
     });
     cy.waitUntilSpinnerDisappear();
     cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}10-bookmarks-counter`) });
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}10-bookmarks-counter`) });

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

@@ -50,7 +50,7 @@ context('Modal for page operation', () => {
       // do
       // do
       cy.getByTestid('save-page-btn').should('be.visible').click();
       cy.getByTestid('save-page-btn').should('be.visible').click();
       // wait until
       // wait until
-      return Cypress.$('.layout-root').hasClass('editing');
+      return cy.get('.layout-root').then($elem => $elem.hasClass('editing'));
     });
     });
 
 
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
@@ -69,7 +69,9 @@ context('Modal for page operation', () => {
       // do
       // do
       cy.getByTestid('newPageBtn').click({force: true});
       cy.getByTestid('newPageBtn').click({force: true});
       // wait until
       // wait until
-      return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
+      return cy.get('body').within(() => {
+        return Cypress.$('[data-testid=page-create-modal]').is(':visible');
+      });
     });
     });
 
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {