TheBrainFamily / cypress-cucumber-webpack-typescript-example

cypress cucumber webpack typescript example
40 stars 24 forks source link

Is it possible to run All.features file within this example? #3

Closed AdamOakman closed 4 years ago

AdamOakman commented 4 years ago

I am trying to figure out how to run All.features using typescript with cucumber config - did anybody try and manage to run it? I created All.features and added .features extension to cypress.json after cloning this repo but looks like something is still missing in the config because it does not execute any tests

~/D/c/c/c/integration> npm run testall        master!?

> cypress-cucumber-webpack-example@0.1.0 testall /Users/<***>/Desktop/cypress/cypress-cucumber-webpack-typescript-example
> cypress run --spec "**/*.features"

================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.7.0                                                                              │
  │ Browser:    Electron 73 (headless)                                                             │
  │ Specs:      1 found (All.features)                                                             │
  │ Searched:   **/*.features                                                                      │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  All.features                                                                    (1 of 1)

  0 passing (2ms)

  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        0                                                                                │
  │ Passing:      0                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     0 seconds                                                                        │
  │ Spec Ran:     All.features                                                                     │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

  (Video)

  -  Started processing:  Compressing to 32 CRF
  -  Finished processing: /Users/<***>/Desktop/cypress/cypress-cucumber-webpa    (0 seconds)
                          ck-typescript-example/cypress/videos/All.features.mp4

================================================================================

  (Run Finished)

       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  All.features                               1ms        -        -        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                          1ms        -        -        -        -        -
lgandecki commented 4 years ago

Good point. There was a bit of extra configuration needed, but the library itself had to be changed a bit - https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/pull/281 , please checkout the newest master and give the npm run test:all a try, also, please not the changes in the webpack.config.js file, in particular the addition of this section:

{
  test: /\.features$/,
  use: [
    {
      loader: "cypress-cucumber-preprocessor/lib/featuresLoader"
    }
  ]
}
weihsu767 commented 4 years ago

It can do it when nonGlobalStepDefinitions is false. But it can't run All.features when nonGlobalStepDefinitions is true. It will have an error message No tests found in your file Does anyone have the same problem?