test: percy visual testing (#1053)

* test: percy visual testing init

* Try PR checks with custom command

* Only run percy visual tests for PWA on merge for now
This commit is contained in:
Danny Brown authored and GitHub committed 2019-10-15 14:52:23 -04:00
1 parent c217b8bbde
commit 8a7706b286
11 files changed
+521 -51

No files matched your search

@@ -5,6 +5,8 @@ describe('OHIFStandaloneViewer', () => {
it('loads route with at least 2 rows', () => {
cy.screenshot();
cy.percySnapshot();
cy.get('#studyListData tr')
.its('length')
.should('be.gt', 2);
@@ -12,6 +12,8 @@ describe('OHIF Study Viewer Page', () => {
it('checks if series thumbnails are being displayed', () => {
cy.screenshot();
cy.percySnapshot();
cy.get('.ThumbnailEntryContainer')
.its('length')
.should('be.gt', 1);
+3 -1
View File
@@ -7,10 +7,10 @@
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
let percyHealthCheck = require('@percy/cypress/task');
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
@@ -24,4 +24,6 @@ module.exports = (on, config) => {
return args;
}
});
on('task', percyHealthCheck);
};
@@ -1,3 +1,4 @@
import '@percy/cypress';
import { DragSimulator } from '../helpers/DragSimulator.js';
import {
initCornerstoneToolsAliases,
+1 -1
View File
@@ -27,7 +27,7 @@
"dev:viewer": "yarn run dev",
"start": "yarn run dev",
"test:e2e": "cypress open",
"test:e2e:ci": "cypress run",
"test:e2e:ci": "percy exec -- cypress run",
"test:e2e:dist": "start-server-and-test test:e2e:serve http://localhost:3000 test:e2e:ci",
"test:e2e:serve": "serve -n -l 3000 -s dist",
"test:unit": "jest --watchAll",