diff --git a/cypress.config.ts b/cypress.config.ts index 2e79133..43ee11e 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,27 +1,11 @@ -import { defineConfig } from "cypress"; -import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'; -import webpack from '@cypress/webpack-preprocessor'; - -// async function setupNodeEvents( -// on: Cypress.PluginEvents, -// config: Cypress.PluginConfigOptions -// ): Promise { -// await addCucumberPreprocessorPlugin(on, config); - -// on( -// "file:preprocessor", -// preprocessor(config, { -// typescript: require.resolve("typescript"), -// }) -// ); - -// return config; -// } +import { defineConfig } from 'cypress' +import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor' +import webpack from '@cypress/webpack-preprocessor' const setupNodeEvents = async (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { await addCucumberPreprocessorPlugin(on, config, { omitAfterRunHandler: true, - }); + }) on( 'file:preprocessor', webpack({ @@ -53,22 +37,19 @@ const setupNodeEvents = async (on: Cypress.PluginEvents, config: Cypress.PluginC }, }, }), - ); + ) return config; -}; +} export default defineConfig({ e2e: { - defaultCommandTimeout: 60000, - pageLoadTimeout:180000, chromeWebSecurity: false, - baseUrl: "http://localhost:3000", - specPattern: "cypress/e2e/**/*.feature", - supportFile: "cypress/support/e2e.ts", + baseUrl: 'https://the-internet.herokuapp.com/', + specPattern: 'cypress/e2e/features/*.feature', + supportFile: false, retries: 0, video: false, setupNodeEvents, - experimentalInteractiveRunEvents: true, } -}); \ No newline at end of file +}) \ No newline at end of file diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts deleted file mode 100644 index aa8238d..0000000 --- a/cypress/support/e2e.ts +++ /dev/null @@ -1,15 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** -import './commands/commands' \ No newline at end of file diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json index 83fb87e..1ad5b40 100644 --- a/cypress/tsconfig.json +++ b/cypress/tsconfig.json @@ -2,7 +2,12 @@ "compilerOptions": { "target": "es5", "lib": ["es5", "dom"], - "types": ["cypress", "node"] + "types": ["cypress", "node"], + "paths": { + "#pages/*": [ + "../pages/*.ts" + ] + }, }, - "include": ["**/*.ts"] + "include": ["./**/*.ts"] } \ No newline at end of file diff --git a/package.json b/package.json index 864ddbc..bf644d5 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "author": "mahula", "license": "Apache-2.0", "scripts": { - "cypress:open": "cypress open", + "cypress:open": "cypress open --e2e --browser electron", "cypress:run": "cypress run" }, "devDependencies": {