File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { defineConfig } from 'cypress'
2+ import plugins from './cypress/plugins/index.mjs'
3+ import viteConfig from './vite.config.mjs'
4+
5+ export default defineConfig ( {
6+ projectId : '3paxvy' ,
7+ viewportWidth : 1920 ,
8+ viewportHeight : 1080 ,
9+ defaultCommandTimeout : 6000 ,
10+
11+ env : viteConfig . test . env ,
12+
13+ screenshotsFolder : 'cypress/snapshots/actual' ,
14+ trashAssetsBeforeRuns : true ,
15+
16+ component : {
17+ devServer : {
18+ framework : 'vue' ,
19+ bundler : 'vite' ,
20+ viteConfig,
21+ } ,
22+ specPattern : 'tests/visual/**/*.visual.*' ,
23+ setupNodeEvents ( on , config ) {
24+ return plugins ( on , config )
25+ } ,
26+ } ,
27+ } )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88// https://on.cypress.io/plugins-guide
99// ***********************************************************
1010
11- // This function is called when a project is opened or re-opened (e.g. due to
12- // the project's config changing)
13-
14- const getCompareSnapshotsPlugin = require ( 'cypress-visual-regression/dist/plugin' )
15-
16- const webpack = require ( '@cypress/webpack-preprocessor' )
17- const { startDevServer } = require ( '@cypress/webpack-dev-server' )
18-
19- module . exports = async ( on , config ) => {
20- const webpackOptions = await require ( '../../webpack.config.js' ) ( )
21- webpackOptions . externals = { }
22-
23- const options = {
24- // send in the options from your webpack.config.js, so it works the same
25- // as your app's code
26- webpackOptions,
27- watchOptions : { } ,
28- }
11+ import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin.js'
2912
13+ export default async ( on , config ) => {
3014 getCompareSnapshotsPlugin ( on , config )
31- on ( 'file:preprocessor' , webpack ( options ) )
32-
33- on ( 'dev-server:start' , ( options ) => {
34- return startDevServer ( { options, webpackConfig : webpackOptions } )
35- } )
3615
3716 // Disable spell checking to prevent rendering differences
3817 on ( 'before:browser:launch' , ( browser , launchOptions ) => {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width,initial-scale=1.0 ">
7+ < title > Components App</ title >
8+ < div id ="__next_css__DO_NOT_USE__ "> </ div >
9+ </ head >
10+ < body >
11+ < div data-cy-root > </ div >
12+ </ body >
13+ </ html >
Original file line number Diff line number Diff line change 11// ***********************************************************
2- // This example support/index .js is processed and
2+ // This example support/component .js is processed and
33// loaded automatically before your test files.
44//
55// This is a great place to put global configuration and
1313// https://on.cypress.io/configuration
1414// ***********************************************************
1515
16- import './commands'
16+ import { mount } from 'cypress/vue2'
17+ import compareSnapshotCommand from 'cypress-visual-regression/dist/command.js'
18+
19+ compareSnapshotCommand ( )
20+
21+ const Cypress = window . Cypress
22+
23+ Cypress . Commands . add ( 'mount' , mount )
24+
25+ if ( global . process === undefined ) global . process = { }
26+ global . process . env = {
27+ ...Cypress . env ( ) ,
28+ }
Original file line number Diff line number Diff line change 9595 "@vue/test-utils" : " ^1.3.3" ,
9696 "browserslist-to-esbuild" : " ^1.2.0" ,
9797 "concurrently" : " ^7.6.0" ,
98- "cypress" : " ^9.7 .0" ,
99- "cypress-visual-regression" : " ^1.5 .0" ,
100- "eslint-plugin-cypress" : " ^2.11 .1" ,
98+ "cypress" : " ^11.2 .0" ,
99+ "cypress-visual-regression" : " ^1.7 .0" ,
100+ "eslint-plugin-cypress" : " ^2.12 .1" ,
101101 "gettext-extractor" : " ^3.6.0" ,
102102 "gettext-parser" : " ^6.0.0" ,
103103 "jsdom" : " ^20.0.3" ,
Original file line number Diff line number Diff line change 2020 *
2121 */
2222
23- import { mount } from '@cypress/vue'
2423import sanitize from 'sanitize-filename'
2524
2625import NcAppSidebar from '../../../../src/components/NcAppSidebar/NcAppSidebar.vue'
@@ -96,7 +95,7 @@ export default function(compact) {
9695 }
9796
9897 it ( 'Renders ' + fileName , ( ) => {
99- mount ( NcAppSidebar , defaultOptions )
98+ cy . mount ( NcAppSidebar , defaultOptions )
10099 cy . get ( '.app-sidebar-header' ) . compareSnapshot ( fileName )
101100 } )
102101 } )
You can’t perform that action at this time.
0 commit comments