Connecting features to step definitions within the configuration file for the "VSCode Cucumber (Gherkin) Full Language Support + Formatting + Autocomplete" extension

After installing the "VSCode Cucumber (Gherkin) Full Language Support + Formatting + Autocomplete" plugin on my vscode editor, I was impressed by its ability to assist with cucumber formatting. According to the documentation, this plugin offers a feature that allows users to easily navigate between feature files, step definitions, and page objects by simply hovering over the corresponding text in the .feature file.

However, I found the documentation regarding path mapping between files to be lacking. Can anyone provide guidance on how to establish the desired syntax linking between feature files, step definitions, and page objects based on the directory structure shown below?

src
├── features
│   ├── accessibility
│   │   └── FeatureFile.feature
│   ├── Directory
│   │   ├── featureFile.feature
│   │   ├── SomeDirectory
│   │   │   ├── FeatureFile.feature
│   ├── step_definitions
│   │   ├── SomeDirectory
│   │   │   ├── someFile.js
│   │   │   ├── given.js
│   │   │   └── then.js
│   │   ├── given.js
│   │   ├── someFeature.js
│   │   ├── then.js
│   │   └── when.js
├── pageobjects
│   ├── SomeDirectory
│   │   ├── SomeFeature

To enable these features, refer to the example configuration provided in their documentation:

{
"cucumberautocomplete.steps": [
    "test/features/step_definitions/*.js",
    "node_modules/qa-lib/src/step_definitions/*.js"
],
"cucumberautocomplete.syncfeatures": "test/features/*feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"cucumberautocomplete.strictGherkinValidation": true,
"cucumberautocomplete.smartSnippets": true,
"cucumberautocomplete.stepsInvariants": true,
"cucumberautocomplete.customParameters": [
    {
        "parameter":"{ab}",
        "value":"(a|b)"
    },
    {
        "parameter":/\{a.*\}/,
        "value":"a"
    },
],
"cucumberautocomplete.pages": {
    "users": "test/features/page_objects/users.storage.js",
    "pathes": "test/features/page_objects/pathes.storage.js",
    "main": "test/features/support/page_objects/main.page.js"
},
"cucumberautocomplete.skipDocStringsFormat": true,
"cucumberautocomplete.formatConfOverride": {
    "And": 3,
    "But": "relative",
},
"cucumberautocomplete.onTypeFormat": true,
"editor.quickSuggestions": {
    "comments": false,
    "strings": true,
    "other": true
}

Answer №1

cucumberautocomplete.steps it is essential to have an array of valid paths. For instance, you could simply define it as

["path_to_src/features/step_definitions/*.js"]
. Alternatively, if you wish to access steps from multiple folders within src, you can easily specify ["path_to_src/**/*.js"].

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Navigating with Link in React Router DOM v5 to successfully pass and catch data

In the process of developing a basic chat application, I encountered an issue with passing the username via the Link component. Below is the relevant code snippet: <Link to={{ pathname: `/${room}`, state: { the: user } }}> Enter room </Link> ...

Transferring Data with Json through PHP and Ajax

I'm new to working with Json. I have some values stored in an HTML table that I need to pass using json to the prescription.php page. I've attempted this, but after a successful ajax call, it shows an error message in the log: e = {readyState: 4 ...

Leveraging react props with the .map method

Imagine having this render function in one of your components. You've passed a changeTid prop function from the parent element. Parent Component: <RequestsList data={this.state.data} changeTid={this.changeTid} /> Child Component: (Using ES6 ...

Stacked divs experiencing layout issues in Firefox browser

An innovative book animation has been crafted, showcasing flipping pages with a clever use of z-index to stack the pages. While everything displays correctly in the browser UI, an interesting situation arises when inspecting elements. In Firefox, selectin ...

Perform the trigger function when scrolling for the first time

I am working on a project where I need to trigger a click event when the user scrolls down 700px. This is the code I have so far: $(window).scroll(function(){ playVideo(); }); function playVideo() { var wScroll = $(window).scrollTop(); if (wS ...

Having trouble retrieving response headers in Angular 5

After sending a post request to a server, I receive a response with two crucial headers for the client: username and access-token. The Chrome debug tool's Network Tab displays the data from the response like this: https://i.sstatic.net/XN9iv.png In ...

Error in Sequelize and Express JS: Cannot access undefined properties while attempting to read 'findAll'

I am currently facing an issue while working with Express JS and Sequelize in connection to a MSSQL database. The error message "Cannot read properties of undefined (reading 'findAll')" is blocking me from making any requests. Can anyone provide ...

Why is the jQuery change event only firing when the page loads?

I am experiencing an issue with a .js file. The change event is only triggering when the page loads, rather than when the selection changes as expected. $(document).ready(function(){ $("#dropdown").on("change keyup", colorizeSelect()).change(); }); f ...

I am encountering an issue with this code. The objective is to determine the frequency at which a specific word appears in the provided paragraph

function processWords(){ text = document.getElementById("inputText").value; text = text.replace(/(^\s*)|(\s*$)/gi,""); text = text.replace(/[ ]{2,}/gi," "); text = text.replace(/\n /,"&bso ...

Understanding the Distinction Between Arrays and Objects in Javascript. How can we differentiate between arrays and objects, and when do arrays inherit array-specific methods?

Although I have experience in C/C++/PIC assembly and VHDL, I am struggling with JavaScript. Currently, I am developing a single page application in React, but my question is more about improving my understanding rather than fixing an issue (as I have alrea ...

Updating the color of the hamburger menu based on the scroll position using an event listener

Is there a way to change the color of my burger bar lines using event listeners? I'm trying to target the spans that make up the burger menu lines by assigning them a class "span". Here's what I have: var distFromTop = document.querySelector(".o ...

endless cycle of scrolling for div tags

My goal is to incorporate a tweet scroller on I believe it uses the tweet-scroller from Unfortunately, this link seems broken as the demo is not functioning. I searched for an alternative solution and came across http://jsfiddle.net/doktormolle/4c5tt/ ...

Unable to access a PHP file within a JavaScript loop

In my HTML document, there is a button with an onclick method inside a JavaScript <script> tag. When this button is clicked, it triggers the deleteRow function, which is responsible for removing a row from a table on the page. Within the deleteRow f ...

Steering clear of inserting 'Array' into a database through autocomplete using Js, Ajax, and Json

I'm currently working on a script that auto-populates input fields based on the autocomplete feature of the first input field. Although the script works fine and everything looks good when I hit submit, the problem arises when I check the database. A ...

Problems encountered when transferring information from jQuery to PHP through .ajax request

Hey there! I am currently working with Yii and facing an issue while trying to pass some data to a controller method called events. This is how my jQuery ajax call looks like: var objectToSend = { "categories" : [selectedOption],"datefrom" : month + "" + ...

The Carousel created using only CSS and npm packages does not function properly when implemented in a ReactJS environment

I have been attempting to incorporate a basic carousel in my react project. I have experimented with both pure CSS and various libraries, but in every instance, the outcome has been consistent. View the screenshot of the result All child elements are dis ...

Having trouble changing the query string in the URL with Angular 4?

My search form includes various filters such as text inputs, checkboxes, and radio buttons. Whenever the user interacts with these filters, the query string in the URL needs to be updated. Consider the following scenario: http://example.com/search?myFilt ...

Unable to send parameters via URL when making an Ajax request in Rails

Struggling to pass a parameter through a URL in an Ajax request that's triggered by a confirmation dialog. Need the value of that parameter in my Rails controller upon successful request but can't seem to make it work. Tried the following code s ...

Tips for using the .join() method in React when the array is not initially present

I'm currently working on a functional React component that retrieves data from an API request and displays it. The object initially is empty until the request is made. Inside the object, there is an array structured like this: ['US', ' ...

Check for duplicates within 2 arrays by implementing a filtering process

I am trying to figure out how to compare two arrays to determine if there are any duplicates within them. const result = this.specialRange.filter(d => !dayMonth.includes(d)); What I have attempted so far just returns the entire array back to me, but I ...