Просмотр исходного кода

modify VRT screenshot default option

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

+ 1 - 1
packages/app/test/cypress/integration/1-install/install.spec.ts

@@ -52,7 +52,7 @@ context('Installing', () => {
 
 
     cy.getByTestid('btnSubmit').click();
     cy.getByTestid('btnSubmit').click();
 
 
-    cy.screenshot(`${ssPrefix}-installed`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-installed`);
   });
   });
 
 
 });
 });

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

@@ -37,43 +37,43 @@ context('Access to Admin page', () => {
   it('/admin is successfully loaded', () => {
   it('/admin is successfully loaded', () => {
     cy.visit('/admin');
     cy.visit('/admin');
     cy.getByTestid('admin-home').should('be.visible');
     cy.getByTestid('admin-home').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin`);
   });
   });
 
 
   it('/admin/app is successfully loaded', () => {
   it('/admin/app is successfully loaded', () => {
     cy.visit('/admin/app');
     cy.visit('/admin/app');
     cy.getByTestid('admin-app-settings').should('be.visible');
     cy.getByTestid('admin-app-settings').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-app`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-app`);
   });
   });
 
 
   it('/admin/security is successfully loaded', () => {
   it('/admin/security is successfully loaded', () => {
     cy.visit('/admin/security');
     cy.visit('/admin/security');
     cy.getByTestid('admin-security').should('be.visible');
     cy.getByTestid('admin-security').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-security`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-security`);
   });
   });
 
 
   it('/admin/markdown is successfully loaded', () => {
   it('/admin/markdown is successfully loaded', () => {
     cy.visit('/admin/markdown');
     cy.visit('/admin/markdown');
     cy.getByTestid('admin-markdown').should('be.visible');
     cy.getByTestid('admin-markdown').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-markdown`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-markdown`);
   });
   });
 
 
   it('/admin/customize is successfully loaded', () => {
   it('/admin/customize is successfully loaded', () => {
     cy.visit('/admin/customize');
     cy.visit('/admin/customize');
     cy.getByTestid('admin-customize').should('be.visible');
     cy.getByTestid('admin-customize').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-customize`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-customize`);
   });
   });
 
 
   it('/admin/importer is successfully loaded', () => {
   it('/admin/importer is successfully loaded', () => {
     cy.visit('/admin/importer');
     cy.visit('/admin/importer');
     cy.getByTestid('admin-import-data').should('be.visible');
     cy.getByTestid('admin-import-data').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-importer`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-importer`);
   });
   });
 
 
   it('/admin/export is successfully loaded', () => {
   it('/admin/export is successfully loaded', () => {
     cy.visit('/admin/export');
     cy.visit('/admin/export');
     cy.getByTestid('admin-export-archive-data').should('be.visible');
     cy.getByTestid('admin-export-archive-data').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-export`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-export`);
   });
   });
 
 
   it('/admin/notification is successfully loaded', () => {
   it('/admin/notification is successfully loaded', () => {
@@ -81,32 +81,32 @@ context('Access to Admin page', () => {
     cy.getByTestid('admin-notification').should('be.visible');
     cy.getByTestid('admin-notification').should('be.visible');
     // wait for retrieving slack integration status
     // wait for retrieving slack integration status
     cy.getByTestid('slack-integration-list-item').should('be.visible');
     cy.getByTestid('slack-integration-list-item').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-notification`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-notification`);
   });
   });
 
 
   it('/admin/slack-integration is successfully loaded', () => {
   it('/admin/slack-integration is successfully loaded', () => {
     cy.visit('/admin/slack-integration');
     cy.visit('/admin/slack-integration');
     cy.getByTestid('admin-slack-integration').should('be.visible');
     cy.getByTestid('admin-slack-integration').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-slack-integration`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-slack-integration`);
   });
   });
 
 
   it('/admin/slack-integration-legacy is successfully loaded', () => {
   it('/admin/slack-integration-legacy is successfully loaded', () => {
     cy.visit('/admin/slack-integration-legacy');
     cy.visit('/admin/slack-integration-legacy');
     cy.getByTestid('admin-slack-integration-legacy').should('be.visible');
     cy.getByTestid('admin-slack-integration-legacy').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-slack-integration-legacy`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-slack-integration-legacy`);
   });
   });
 
 
   it('/admin/users is successfully loaded', () => {
   it('/admin/users is successfully loaded', () => {
     cy.visit('/admin/users');
     cy.visit('/admin/users');
     cy.getByTestid('admin-users').should('be.visible');
     cy.getByTestid('admin-users').should('be.visible');
     cy.getByTestid('user-table-tr').first().should('be.visible');
     cy.getByTestid('user-table-tr').first().should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-users`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-users`);
   });
   });
 
 
   it('/admin/user-groups is successfully loaded', () => {
   it('/admin/user-groups is successfully loaded', () => {
     cy.visit('/admin/user-groups');
     cy.visit('/admin/user-groups');
     cy.getByTestid('admin-user-groups').should('be.visible');
     cy.getByTestid('admin-user-groups').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-user-groups`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-user-groups`);
   });
   });
 
 
   it('/admin/search is successfully loaded', () => {
   it('/admin/search is successfully loaded', () => {
@@ -114,7 +114,7 @@ context('Access to Admin page', () => {
     cy.getByTestid('admin-full-text-search').should('be.visible');
     cy.getByTestid('admin-full-text-search').should('be.visible');
     // wait for connected
     // wait for connected
     cy.getByTestid('connection-status-badge-connected').should('be.visible');
     cy.getByTestid('connection-status-badge-connected').should('be.visible');
-    cy.screenshot(`${ssPrefix}-admin-search`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-admin-search`);
   });
   });
 
 
 });
 });

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

@@ -23,12 +23,12 @@ context('Access to /me page', () => {
 
 
   it('/me is successfully loaded', () => {
   it('/me is successfully loaded', () => {
     cy.visit('/me', {  });
     cy.visit('/me', {  });
-    cy.screenshot(`${ssPrefix}-me`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-me`);
   });
   });
 
 
   it('Draft page is successfully shown', () => {
   it('Draft page is successfully shown', () => {
     cy.visit('/me/drafts');
     cy.visit('/me/drafts');
-    cy.screenshot(`${ssPrefix}-draft-page`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-draft-page`);
   });
   });
 
 
 });
 });

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

@@ -24,29 +24,32 @@ context('Access to page', () => {
 
 
   it('/Sandbox is successfully loaded', () => {
   it('/Sandbox is successfully loaded', () => {
     cy.visit('/Sandbox', {  });
     cy.visit('/Sandbox', {  });
-    cy.screenshot(`${ssPrefix}-sandbox`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-sandbox`);
   });
   });
 
 
   it('/Sandbox with anchor hash is successfully loaded', () => {
   it('/Sandbox with anchor hash is successfully loaded', () => {
     cy.visit('/Sandbox#Headers');
     cy.visit('/Sandbox#Headers');
+    // eslint-disable-next-line cypress/no-unnecessary-waiting
+    cy.wait(400);
+
     cy.getByTestid('grw-fab-create-page').should('be.visible');
     cy.getByTestid('grw-fab-create-page').should('be.visible');
     cy.getByTestid('grw-fab-return-to-top').should('be.visible');
     cy.getByTestid('grw-fab-return-to-top').should('be.visible');
-    cy.screenshot(`${ssPrefix}-sandbox-headers`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-sandbox-headers`);
   });
   });
 
 
   it('/Sandbox/Math is successfully loaded', () => {
   it('/Sandbox/Math is successfully loaded', () => {
     cy.visit('/Sandbox/Math');
     cy.visit('/Sandbox/Math');
-    cy.screenshot(`${ssPrefix}-sandbox-math`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-sandbox-math`);
   });
   });
 
 
   it('/Sandbox with edit is successfully loaded', () => {
   it('/Sandbox with edit is successfully loaded', () => {
     cy.visit('/Sandbox#edit');
     cy.visit('/Sandbox#edit');
-    cy.screenshot(`${ssPrefix}-sandbox-edit-page`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-sandbox-edit-page`);
   })
   })
 
 
   it('/user/admin is successfully loaded', () => {
   it('/user/admin is successfully loaded', () => {
     cy.visit('/user/admin', {  });
     cy.visit('/user/admin', {  });
-    cy.screenshot(`${ssPrefix}-user-admin`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-user-admin`);
   });
   });
 
 
 });
 });

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

@@ -25,7 +25,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').should('be.visible');
     cy.getByTestid('trash-page-list').should('be.visible');
-    cy.screenshot(`${ssPrefix}-trash`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-trash`);
   });
   });
 
 
   it('/tags is successfully loaded', () => {
   it('/tags is successfully loaded', () => {
@@ -38,7 +38,7 @@ context('Access to special pages', () => {
     cy.getByTestid('grw-sidebar-content-tags').should('be.visible');
     cy.getByTestid('grw-sidebar-content-tags').should('be.visible');
 
 
     cy.getByTestid('tags-page').should('be.visible');
     cy.getByTestid('tags-page').should('be.visible');
-    cy.screenshot(`${ssPrefix}-tags`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-tags`);
   });
   });
 
 
 });
 });

+ 3 - 3
packages/app/test/cypress/integration/2-basic-features/open-presentation-modal.spec.ts

@@ -30,7 +30,7 @@ context('Open presentation modal', () => {
 
 
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     cy.wait(1500);
     cy.wait(1500);
-    cy.screenshot(`${ssPrefix}-opne-top`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-opne-top`);
   });
   });
 
 
   it('PageCreateModal for "/Sandbox/Bootstrap4" is shown successfully', () => {
   it('PageCreateModal for "/Sandbox/Bootstrap4" is shown successfully', () => {
@@ -43,7 +43,7 @@ context('Open presentation modal', () => {
 
 
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     cy.wait(1500);
     cy.wait(1500);
-    cy.screenshot(`${ssPrefix}-open-bootstrap4`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-open-bootstrap4`);
   });
   });
 
 
   it('PageCreateModal for /Sandbox/Bootstrap4#Cards" is shown successfully', () => {
   it('PageCreateModal for /Sandbox/Bootstrap4#Cards" is shown successfully', () => {
@@ -56,6 +56,6 @@ context('Open presentation modal', () => {
 
 
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     cy.wait(1500);
     cy.wait(1500);
-    cy.screenshot(`${ssPrefix}-open-bootstrap4-with-ancker-link`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-open-bootstrap4-with-ancker-link`);
   });
   });
 });
 });

+ 1 - 1
packages/app/test/cypress/integration/3-search/access-to-private-legacy-pages-directly.spec.ts

@@ -26,7 +26,7 @@ context('Access to legacy private pages directly', () => {
 
 
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-base').should('be.visible');
 
 
-    cy.screenshot(`${ssPrefix}-shown`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-shown`);
   });
   });
 
 
 });
 });

+ 7 - 7
packages/app/test/cypress/integration/3-search/access-to-result-page-directly.spec.ts

@@ -27,7 +27,7 @@ context('Access to search result page directly', () => {
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
 
 
-    cy.screenshot(`${ssPrefix}-with-q`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-with-q`);
   });
   });
 
 
   it('checkboxes behaviors', () => {
   it('checkboxes behaviors', () => {
@@ -37,19 +37,19 @@ context('Access to search result page directly', () => {
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-list').should('be.visible');
 
 
     cy.getByTestid('cb-select').first().click({force: true});
     cy.getByTestid('cb-select').first().click({force: true});
-    cy.screenshot(`${ssPrefix}-the-first-checkbox-on`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-the-first-checkbox-on`);
     cy.getByTestid('cb-select').first().click({force: true});
     cy.getByTestid('cb-select').first().click({force: true});
-    cy.screenshot(`${ssPrefix}-the-first-checkbox-off`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-the-first-checkbox-off`);
 
 
     // click select all checkbox
     // click select all checkbox
     cy.getByTestid('cb-select-all').click({force: true});
     cy.getByTestid('cb-select-all').click({force: true});
-    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-1`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-1`);
     cy.getByTestid('cb-select').first().click({force: true});
     cy.getByTestid('cb-select').first().click({force: true});
-    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-2`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-2`);
     cy.getByTestid('cb-select').first().click({force: true});
     cy.getByTestid('cb-select').first().click({force: true});
-    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-3`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-3`);
     cy.getByTestid('cb-select-all').click({force: true});
     cy.getByTestid('cb-select-all').click({force: true});
-    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-4`, { capture: 'viewport' });
+    cy.screenshot(`${ssPrefix}-the-select-all-checkbox-4`);
   });
   });
 
 
 });
 });

+ 2 - 1
packages/app/test/cypress/support/screenshot.ts

@@ -1,3 +1,4 @@
 Cypress.Screenshot.defaults({
 Cypress.Screenshot.defaults({
-  blackout: ['[data-hide-in-vrt=true]']
+  blackout: ['[data-hide-in-vrt=true]'],
+  capture: 'viewport',
 })
 })