瀏覽代碼

Screenshot partially

Taichi Masuyama 3 年之前
父節點
當前提交
16d0e9166e
共有 1 個文件被更改,包括 9 次插入12 次删除
  1. 9 12
      packages/app/test/cypress/integration/30-search/search.spec.ts

+ 9 - 12
packages/app/test/cypress/integration/30-search/search.spec.ts

@@ -128,30 +128,27 @@ context('Search all pages', () => {
 
 
     // Duplicate page
     // Duplicate page
     cy.getByTestid('open-page-duplicate-modal-btn').first().click({force: true});
     cy.getByTestid('open-page-duplicate-modal-btn').first().click({force: true});
-    cy.getByTestid('page-duplicate-modal').should('be.visible');
-    // for avoid mismatch by auto scrolling
-    cy.get('.search-result-content-body-container').scrollTo('top');
-    cy.screenshot(`${ssPrefix}6-duplicate-page`, {capture: 'viewport'});
+    cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
+      cy.screenshot(`${ssPrefix}6-duplicate-page`, {capture: 'viewport'});
+    });
 
 
     // Close Modal
     // Close Modal
     cy.get('body').type('{esc}');
     cy.get('body').type('{esc}');
 
 
     // Move / Rename Page
     // Move / Rename Page
     cy.getByTestid('open-page-move-rename-modal-btn').first().click({force: true});
     cy.getByTestid('open-page-move-rename-modal-btn').first().click({force: true});
-    cy.getByTestid('page-rename-modal').should('be.visible');
-    // for avoid mismatch by auto scrolling
-    cy.get('.search-result-content-body-container').scrollTo('top');
-    cy.screenshot(`${ssPrefix}7-move-rename-page`, {capture: 'viewport'});
+    cy.getByTestid('page-rename-modal').should('be.visible').within(() => {
+      cy.screenshot(`${ssPrefix}7-move-rename-page`, {capture: 'viewport'});
+    });
 
 
     // Close Modal
     // Close Modal
     cy.get('body').type('{esc}');
     cy.get('body').type('{esc}');
 
 
     // Delete page
     // Delete page
     cy.getByTestid('open-page-delete-modal-btn').first().click({ force: true});
     cy.getByTestid('open-page-delete-modal-btn').first().click({ force: true});
-    cy.getByTestid('page-delete-modal').should('be.visible');
-    // for avoid mismatch by auto scrolling
-    cy.get('.search-result-content-body-container').scrollTo('top');
-    cy.screenshot(`${ssPrefix}8-delete-page`, {capture: 'viewport'});
+    cy.getByTestid('page-delete-modal').should('be.visible').within(() => {
+      cy.screenshot(`${ssPrefix}8-delete-page`, {capture: 'viewport'});
+    });
   });
   });
 
 
   it(`Search all pages by tag is successfully loaded `, () => {
   it(`Search all pages by tag is successfully loaded `, () => {