Cypress-cucumber-preprocessor: Error: Step implementation missing for: I open Google page

Created on 20 Aug 2019  Â·  12Comments  Â·  Source: TheBrainFamily/cypress-cucumber-preprocessor

Screenshot 2019-08-20 at 20 35 23

I have followed the guide in the README.md word for word but I keep getting this error. My feature file is at cypress/integration/google.feature and my step file is at cypress/support/step_definitions/google.js Would appreciate if anyone could help.

Thanks

Most helpful comment

Ah it's ok, I managed to guess around and fix it. I thought there was more required after I read the cosmiconfig docs. Maybe some further clarifications would be nice for the README, I think the sentence "First please use cosmiconfig to create a configuration for the plugin, for example put this section:" is misleading as it implies you need to install cosmiconfig, head over to the cosmiconfig docs and learn how to use it first. Maybe omitting all mention of cosmiconfig would be better as it's not relevant for most users, you could just mention it in an implementation section instead for those who're interested.

All 12 comments

it would be great if you could push what you have to github and link here, otherwise it's hard ot guess, especially for such basic usage.

sure will do, i'll isolate the problem into its own project on Thursday

Great, thanks!

ok so I understand what the problem is now... it's because my cypress tests are in a test folder so I need to change the step_definitions option, but I am confused with how to use cosmiconfig to do this, is there an example anywhere I can see of where it has been used with cypress-cucumber-preprocessor to change the config options?

Ah it's ok, I managed to guess around and fix it. I thought there was more required after I read the cosmiconfig docs. Maybe some further clarifications would be nice for the README, I think the sentence "First please use cosmiconfig to create a configuration for the plugin, for example put this section:" is misleading as it implies you need to install cosmiconfig, head over to the cosmiconfig docs and learn how to use it first. Maybe omitting all mention of cosmiconfig would be better as it's not relevant for most users, you could just mention it in an implementation section instead for those who're interested.

image
i have same problem, i am not able to setup it. I am getting this Error: Step implementation missing for: I open Google page

@shweta8996
Try to delete:
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}
from package.json

Hi Mate,

I am also facing the same issue, even after deleting the below code from cypress.json it's not working. Could you please me here I have added the feature file and code?

"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}

Scenariooutline not working

Scenario Outline: Buy books worth
Given I am logged in to demowebshop
And I click on signin
When I enter a username and password
Then Verify the logout is enabled

Examples:
|Username |Password|
|[email protected] |Boy123|
|[email protected] |Boy123|
|[email protected] |Boy123|

Code:

///
import {Given, When, Then, And} from "cypress-cucumber-preprocessor/steps"

Given('I am logged in to demowebshop',()=>{
cy.visit('http://demowebshop.tricentis.com/');
})

And('I click on signin', () =>{
cy.get('.ico-login').click()
cy.wait(3000)
})

When('I enter a username {string} and password {string}',(a, b)=>{

cy.get('#Email').type(a.Username)
cy.get('#Password').type(b.Password)        
cy.get('.button-1.login-button').click()

})

Then('Verify the logout is enabled', ()=>{
cy.get('.ico-logout').should('have.text', 'Log out')
})

This just isn't how scenario outlines work. Check out the official reference and the tests, which ultimately is the source of truth (valid for v2.0.1, which might not be your specific version whenever you're reading this comment).

I'm still getting Error: Step implementation missing for: Please find below error logs

Error

Step implementation missing for: I open basic mortgage calculator page

View stack trace
Error: Step implementation missing for: I open basic mortgage calculator page
• at Context.resolveAndRunStepDefinition (https://react-redux.realworld.io/__cypress/tests?p=cypress/integration/mortgage.feature-207:24485:11)
• at Context. (https://react-redux.realworld.io/__cypress/tests?p=cypress/integration/mortgage.feature-207:23851:35)
• From previous event:
• at Context.thenFn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:132380:26)
• at Context.then (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:132819:21)
• at Context. (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144927:21)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144402:33
• From previous event:
• at runCommand (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144381:14)
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144524:14)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144552:16
• From previous event:
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144524:34)
• From previous event:
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144565:37
• From previous event:
• at run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144558:19)
• at Object.cy. [as then] (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144970:11)
• at Context.runnable.fn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:145202:24)
• at callFn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88335:21)
• at Test.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88322:7)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149207:28
• From previous event:
• at Object.onRunnableRun (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149195:20)
• at $Cypress.action (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:141473:61)
• at Test.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:148003:13)
• at Runner.../driver/node_modules/mocha/lib/runner.js.Runner.runTest (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88994:10)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:89120:12
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88903:14)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88913:7
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88815:14)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88876:7
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149131:16)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149152:11
• From previous event:
• at onNext (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149149:57)
• at done (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88275:5)
• at callFn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88358:7)
• at Hook.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88322:7)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149207:28
• From previous event:
• at Object.onRunnableRun (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149195:20)
• at $Cypress.action (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:141473:61)
• at Hook.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:148003:13)
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88837:10)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88881:5
• at timeslice (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:82807:27)

Feature file

Feature: Ultimate Mortgage Calculator Basic Mortgage Calculator successful submit

Scenario: Check if Ultimate Mortgage Calculator Basic Mortgage Calculator returns successful messages

  Given I open basic mortgage calculator page
  When I enter the values for amount and term
   |amount|term|
   |250000| 27 |
   |300000| 28 |

  And I enter the values for interest rate and mortgage fees
   |rate  | fee  |
   |1.41  | 1198 |
   |1.60  | 2500 |
  Then I submit the form

Step definitions file code

import {Given, When, Then} from "cypress-cucumber-preprocessor/steps"

Given('Given I open basic mortgage calculator page', () => {

cy.visit('https://www.moneysavingexpert.com/mortgages/mortgage-rate-calculator/')

});

When('I enter the value for mortgage debt', datatable => {

datatable.hashes().forEach [element => {
    cy.get('#amount').clear(element.amount) 
    cy.get('#amount').type(element.amount)
    cy.get('#term').clear(element.term) 
    cy.get('#term').type(element.term)

}]

When('I enter the values for interest rate and mortgage fees', datatable => {

       datatable.hashes().forEach[element => {
        cy.get('#rate').clear(element.rate) 
        cy.get('#rate').type(element.rate)
        cy.get('#fees-value').clear(element.fee) 
        cy.get('#fees-value').type(element.fee)

    }];

Then('I submit the form')
    cy.get('.btn--default').click()


  })

})

Package JSON

{
"name": "cypressger",
"version": "1.0.0",
"description": "mortgage cypress test",
"main": "index.js",
"scripts": {
"test": "test"
},
"author": "oluseun",
"license": "ISC",
"devDependencies": {
"cypress": "^4.5.0"
},

"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}

}

Archivo de características

Característica: Calculadora de hipotecas definitiva Calculadora de hipotecas básica con éxito

Escenario: verificar si la calculadora de hipotecas definitiva calculadora de hipotecas básica devuelve mensajes exitosos

  Given I open basic mortgage calculator page
  When I enter the values for amount and term
   |amount|term|
   |250000| 27 |
   |300000| 28 |

  And I enter the values for interest rate and mortgage fees
   |rate  | fee  |
   |1.41  | 1198 |
   |1.60  | 2500 |
  Then I submit the form

Código de archivo de definiciones de paso

importar {Dado, Cuándo, Entonces} desde "cypress-cucumber-preprocessor / steps"

Given ('Dado que abro la página básica de la calculadora de hipotecas', () => {

cy.visit('https://www.moneysavingexpert.com/mortgages/mortgage-rate-calculator/')

});

Cuando ('Ingreso el valor de la deuda hipotecaria', datatable => {

datatable.hashes().forEach [element => {
    cy.get('#amount').clear(element.amount) 
    cy.get('#amount').type(element.amount)
    cy.get('#term').clear(element.term) 
    cy.get('#term').type(element.term)

}]

When('I enter the values for interest rate and mortgage fees', datatable => {

       datatable.hashes().forEach[element => {
        cy.get('#rate').clear(element.rate) 
        cy.get('#rate').type(element.rate)
        cy.get('#fees-value').clear(element.fee) 
        cy.get('#fees-value').type(element.fee)

    }];

Then('I submit the form')
    cy.get('.btn--default').click()


  })

})

Paquete JSON

{
"nombre": "ciprés",
"versión": "1.0.0",
"descripción": "prueba de ciprés hipotecario",
"principal": "index.js",
"scripts": {
"prueba": "prueba "
},
" author ":" oluseun ",
" license ":" ISC ",
" devDependencies ": {
" cypress ":" ^ 4.5.0 "
},

"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}

}

lo he solucionado de la siguiente manera compañero:
modificando las rutas de la siguiente manera, según el valor que indique en el archivo package.json para "cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": false
}
cypress/integration cuando nonGlobalStepDefinitionses sea igual a true
cypress/support/step_definitionscuando nonGlobalStepDefinitionses sea igual a false

Was this page helpful?
0 / 5 - 0 ratings

Related issues

roschaefer picture roschaefer  Â·  5Comments

DanielStoica85 picture DanielStoica85  Â·  4Comments

badeball picture badeball  Â·  5Comments

raisapirgari picture raisapirgari  Â·  6Comments

claudiunicolaa picture claudiunicolaa  Â·  4Comments