cypress-io / cypress-example-recipes

Various recipes for testing common scenarios with Cypress
https://on.cypress.io/examples
3.43k stars 1.34k forks source link

(feature files) don't work with Cypress 10 #779

Closed ahmad-alsermany closed 11 months ago

ahmad-alsermany commented 2 years ago

I'm trying to run my test files (feature files) with last version from Cypress 10.0.3 after I finish the configuration, I can see the test file in Cypress interface, but it doesn't work and Cypress give me back an error with my webpack.

My webpack file:

module.exports = {
    resolve: {
        extensions: [".cy.ts", ".cy.js"]
    },
    node: {fs: "empty", child_process: "empty", readline: "empty"},
    module: {
        rules: [
            {
                test: /\.cy.ts$/,
                exclude: [/node_modules/],
                use: [
                    {
                        loader: "ts-loader"
                    }
                ]
            },
            {
                test: /\.cy.feature$/,
                use: [
                    {
                        loader: "cypress-cucumber-preprocessor/loader"
                    }
                ]
            },
            {
                test: /\.cy.features$/,
                use: [
                    {
                        loader: "cypress-cucumber-preprocessor/lib/featuresLoader"
                    }
                ]
            }
        ]
    }
};

My Cypress.config.ts:

import { defineConfig } from "cypress";

export default defineConfig({
  fileServerFolder: ".",
  fixturesFolder: "./cypress/fixtures",
  video: true,
  videosFolder: "./cypress/videos",
  videoUploadOnPasses: false,
  screenshotsFolder: "./cypress/screenshots",
  chromeWebSecurity: false,
  requestTimeout: 60000,
  responseTimeout: 60000,
  defaultCommandTimeout: 60000,
  reporter: "cypress-multi-reporters",
  numTestsKeptInMemory: 1,

  reporterOptions: {
    configFile: "cypress/reporter-config.json",
  },

  e2e: {
    specPattern: "**/*.cy.feature",
    // testFiles:
  },
})

Error:

Screenshot 2022-06-07 at 16 08 03

How i can resolve this issue?

jennifer-shehane commented 11 months ago

Closing as stale. Please open an issue in the cypress repo if you're still experiencing an issue.