diff --git a/packages/techdocs-cli/cypress.config.js b/packages/techdocs-cli/cypress.config.js index c4b007634a..b33ab2eace 100644 --- a/packages/techdocs-cli/cypress.config.js +++ b/packages/techdocs-cli/cypress.config.js @@ -21,9 +21,25 @@ module.exports = defineConfig({ setupNodeEvents(on, config) { initPlugin(on, config); }, +<<<<<<< HEAD excludeSpecPattern: ['**/__snapshots__/*', '**/__image_snapshots__/*'], }, +======= + }, + excludeSpecPattern: ['**/__snapshots__/*', '**/__image_snapshots__/*'], + env: { + mkDocsBaseUrl: 'http://localhost:8000', + backstageBaseUrl: 'http://localhost:3000', + 'cypress-plugin-snapshots': { + autoCleanUp: false, + imageConfig: { + resizeDevicePixelRatio: true, + threshold: 0.01, + }, + }, + }, +>>>>>>> 533a1a2db2 (update to cypress 10) viewportWidth: 1920, viewportHeight: 1080, includeShadowDom: true, diff --git a/packages/techdocs-cli/cypress/plugins/index.js b/packages/techdocs-cli/cypress/plugins/index.js new file mode 100644 index 0000000000..61af7e7f9b --- /dev/null +++ b/packages/techdocs-cli/cypress/plugins/index.js @@ -0,0 +1,30 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// *********************************************************** +// This example plugins/index.js can be used to load plugins +// +// You can change the location of this file or turn off loading +// the plugins file with the 'pluginsFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/plugins-guide +// *********************************************************** + +// This function is called when a project is opened or re-opened (e.g. due to +// the project's config changing) + +require('@frsource/cypress-plugin-visual-regression-diff/plugin'); diff --git a/yarn.lock b/yarn.lock index 5b268ef6fd..7844d0fadb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,3 +1,6 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + __metadata: version: 6 cacheKey: 8 @@ -13398,7 +13401,7 @@ __metadata: "@backstage/cli-common": "workspace:^" "@backstage/config": "workspace:^" "@backstage/plugin-techdocs-node": "workspace:^" - "@frsource/cypress-plugin-visual-regression-diff": ^3.2.4 + "@frsource/cypress-plugin-visual-regression-diff": ^3.2.8 "@types/commander": ^2.12.2 "@types/dockerode": ^3.3.0 "@types/fs-extra": ^9.0.6