Estoy tratando de ejecutar el archivo de características usando pepino en Cypress 10.2.0.
Me está arrojando un problema de "Error de compilación de WebPack"
Error: Webpack Compilation Error ./cypress/e2e/BankManagerLogin.feature 1:14 Module parse failed: Unexpected token (1:14) You may need an appropriate loader to handle this file type, currently, no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Cualquier ayuda sería apreciada
El archivo cypress.config
necesita ajustarse para borrar ese error.
Prueba esto, es un código bolier-plate del repositorio de badeball.
Esto supone que tiene Typescript (avíseme si solo está usando Javascript).
import { defineConfig } from "cypress"; import * as webpack from "@cypress/webpack-preprocessor"; import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor"; async function setupNodeEvents( on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions ): Promise<Cypress.PluginConfigOptions> { await addCucumberPreprocessorPlugin(on, config); on( "file:preprocessor", webpack({ webpackOptions: { resolve: { extensions: [".ts", ".js"], }, module: { rules: [ { test: /\.ts$/, exclude: [/node_modules/], use: [ { loader: "ts-loader", }, ], }, { test: /\.feature$/, use: [ { loader: "@badeball/cypress-cucumber-preprocessor/webpack", options: config, }, ], }, ], }, }, }) ); // Make sure to return the config object as it might have been modified by the plugin. return config; } export default defineConfig({ e2e: { specPattern: "**/*.feature", supportFile: false, setupNodeEvents, }, });