type { Cypress . PluginConfig } import * as browserify from '@cypress/browserify-preprocessor' ; import cucumber from 'cypress-cucumber-preprocessor' ; import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin' ; import * as processFixtureTemplate from 'cypress-template-fixtures' ; import * as resolve from 'resolve' ; import { getFixturePath } from './fixture-plugin' ; import { clearBusinessLog , hasBusinessLog } from './log-plugin' ; import { addTracks } from './tracks-plugin' ; module . exports = ( on , config ) => { processFixtureTemplate ( on , config ) ; addMatchImageSnapshotPlugin ( on , config ) ; const options = { ... browserify . defaultOptions , typescript : resolve . sync ( 'typescript' , { baseDir : config . projectRoot } ) , } ; on ( 'task' , { addTracks , clearBusinessLog , getFixturePath , hasBusinessLog , } ) ; on ( 'file:preprocessor' , cucumber ( options ) ) ; const { env : { TEST_ENV : testEnv = '' , BASE_URLS : baseUrls = { } } = { } } = config ; if ( baseUrls [ testEnv ] ) { config . baseUrl = baseUrls [ testEnv ] ; } if ( testEnv === 'integ01' ) { link link config . chromeWebSecurity = false ; } return config ; } ;