alexkrechik / VSCucumberAutoComplete

Cucumber (Gherkin) Full Support Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete
MIT License
331 stars 80 forks source link

Features file is not Mapped to my Step Definition ,While Entering "ctrl +click" in cypress #439

Open Sambit-23 opened 2 years ago

Sambit-23 commented 2 years ago

Features File:

Feature: Personnel Module Validation Feature

@Personnel_TC_01 @Personnel @Department @WDMS @ETPRO @ITPRO Scenario: TC_01: To Verify whether user is able to Add a Department

Given I Login and I am in the main page When I click on department Then I Add a department Then I click confirm

Steps:

Cypress.on('uncaught:exception', (err, runnable) => { // returning false here prevents Cypress from // failing the test return false }) Given('I am in easy time pro page', () => { cy.visit('/') })

Given('I Login and I am in the main page', () => {

cy.visit('/')
cy.viewport(1500, 1200)
cy.url().then(urlStr => {
    if (urlStr.includes("10.10.10.140")) {
        cy.fixture('TestData').then((test) => {
            const uname = test.username
            const pass = test.password
            lpobj.login(uname, pass)
            cy.fixture('System_Locators').then((locators) => {
                personnelPOBJ.gotoPersonnel()
            })
        })
    }
    else if (urlStr.includes("192.168.13.39")) {
        cy.fixture('TestData').then((test) => {
            const uname = test.username
            const pass = test.password
            lpobj.login(uname, pass)
            cy.fixture('System_Locators').then((locators) => {
                personnelPOBJ.gotoPersonnel()
                cy.wait(3000)
                personnelPOBJ.gotoPersonnel()
            })
        })
    }
    else {
        cy.fixture('TestData').then((test) => {
            const uname = test.ITPRO_emailID
            const comp = test.ITPRO_company
            const pass = test.ITPRO_password
            lpobj.loginITIME(uname, comp, pass)
            cy.fixture('System_Locators').then((locators) => {
                personnelPOBJ.gotoPersonnel()
            })
        })
    }
})
cy.wait(3000)

})

When('I click on department', () => {

personnelPOBJ.gotoDepartment()
//cy.get('[title="Organization"] > .layui-nav-child > :nth-child(1) > a').click()

}) Then('I click on Department tab', () => { personnelPOBJ.gotoDepartment() })

cypress.json file :

{ "baseUrl":"http://10.10.10.140", "numTestsKeptInMemory": 0, "watchForFileChanges":false, "chromeWebSecurity": false, "projectId": "8cue3m", "video": false, "reporter": "mochawesome", "reporterOptions": {

"inline": true,
"cdn":true,
"overwrite": false,
"html": true

}, "screenshotsFolder": "cypress/screenshots" }

package.json :

{ "cypress-cucumber-preprocessor": { "step_definitions": "cypress/integration/**/", "nonGlobalStepDefinitions": true }, "name": "easytimepro_v9.0.5", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "devDependencies": { "cypress": "^9.5.3" }, "dependencies": { "cucumber-html-reporter": "^5.5.0", "cypress-cucumber-preprocessor": "^4.3.1", "cypress-downloadfile": "^1.2.1", "cypress-file-upload": "^5.0.8", "cypress-multi-reporters": "^1.5.0", "cypress-xpath": "^1.6.2", "fs-extra": "^10.0.1", "lodash": "^4.17.21", "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mochawesome": "^7.1.2", "mochawesome-merge": "^4.2.1", "mochawesome-report-generator": "^6.1.1", "node-xlsx": "^0.21.0", "ts-loader": "^9.2.8", "typescript": "^4.6.3", "xlsx": "^0.18.5" } }

alexkrechik commented 2 years ago

What is the path to the steps files? What is the content of the .vscode settings file?

sujeethc4t commented 1 year ago

Was this problem solved? I am also encountering same problem. could be of great help. thanks

I am using vscode(1.72) & Cucumber (Gherkin) Full Support v2.15.2

vs code setting file:

{ "cucumberautocomplete.steps": [ "cypress/integration/*/.ts" ], "cucumberautocomplete.strictGherkinCompletion": true }

Steps file path: */cypress/Integration/common/