{"id":32124246,"url":"https://github.com/nguyenngoclongdev/step-definition-generator","last_synced_at":"2025-10-20T21:48:01.547Z","repository":{"id":165104986,"uuid":"640487747","full_name":"nguyenngoclongdev/step-definition-generator","owner":"nguyenngoclongdev","description":"Generate step definition for multiple frameworks, such as Cypress, Playwright, and Cucumberjs.","archived":false,"fork":false,"pushed_at":"2024-09-16T08:36:40.000Z","size":48797,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-20T21:47:54.254Z","etag":null,"topics":["cucumber","generator","gherkin","javascript","playwright","step-definitions","testing","typescript","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=nguyenngoclong.cypress-cucumber-step-definition-generator","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nguyenngoclongdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["nguyenngoclongdev"],"ko_fi":"nguyenngoclong","patreon":"nguyenngoclong","custom":"https://paypal.me/longnguyenngoc"}},"created_at":"2023-05-14T08:58:32.000Z","updated_at":"2024-11-19T02:43:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"7433497e-a619-4c50-a98e-5ffa572226d7","html_url":"https://github.com/nguyenngoclongdev/step-definition-generator","commit_stats":null,"previous_names":["nguyenngoclongdev/cucumber-step-definition-generator"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/nguyenngoclongdev/step-definition-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenngoclongdev%2Fstep-definition-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenngoclongdev%2Fstep-definition-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenngoclongdev%2Fstep-definition-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenngoclongdev%2Fstep-definition-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nguyenngoclongdev","download_url":"https://codeload.github.com/nguyenngoclongdev/step-definition-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenngoclongdev%2Fstep-definition-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280166617,"owners_count":26283782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cucumber","generator","gherkin","javascript","playwright","step-definitions","testing","typescript","vscode-extension"],"created_at":"2025-10-20T21:48:00.661Z","updated_at":"2025-10-20T21:48:01.538Z","avatar_url":"https://github.com/nguyenngoclongdev.png","language":"TypeScript","funding_links":["https://github.com/sponsors/nguyenngoclongdev","https://ko-fi.com/nguyenngoclong","https://patreon.com/nguyenngoclong","https://paypal.me/longnguyenngoc"],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/nguyenngoclongdev/step-definition-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/nguyenngoclongdev/step-definition-generator/actions/workflows/ci.yml)\n\n[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/nguyenngoclong.cypress-cucumber-step-definition-generator)](https://marketplace.visualstudio.com/items?itemName=nguyenngoclong.cypress-cucumber-step-definition-generator)\n[![Open VSX Installs](https://img.shields.io/open-vsx/dt/nguyenngoclong/cypress-cucumber-step-definition-generator?color=%2396C41F\u0026label=open-vsx)](https://open-vsx.org/extension/nguyenngoclong/cypress-cucumber-step-definition-generator)\n[![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/nguyenngoclong.cypress-cucumber-step-definition-generator?label=vs-marketplace)](https://marketplace.visualstudio.com/items?itemName=nguyenngoclong.cypress-cucumber-step-definition-generator)\n[![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/nguyenngoclong.cypress-cucumber-step-definition-generator)](https://marketplace.visualstudio.com/items?itemName=nguyenngoclong.cypress-cucumber-step-definition-generator)\n[![Visual Studio Marketplace Rating (Stars)](https://img.shields.io/visual-studio-marketplace/stars/nguyenngoclong.cypress-cucumber-step-definition-generator)](https://marketplace.visualstudio.com/items?itemName=nguyenngoclong.cypress-cucumber-step-definition-generator)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)\n\n# Cucumber Step Definition Generator\n\nThis extension is designed to help developers using the testing framework with Gherkin style feature files to generate step definition more easily and efficiently. With just a few clicks, you can automatically generate step definition for your feature files, saving you time and reducing the risk of errors.\n\nIf you find this extension useful for your projects, please consider supporting me by [Github](https://github.com/sponsors/nguyenngoclongdev), [Patreon](https://patreon.com/nguyenngoclong), [KO-FI](https://ko-fi.com/nguyenngoclong) or [Paypal](https://paypal.me/longnguyenngoc). It's a great way to help me maintain and improve this tool in the future. Your support is truly appreciated!\n\n[![Github](https://img.shields.io/badge/Github-F15689?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/sponsors/nguyenngoclongdev)\n[![Patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge\u0026logo=patreon\u0026logoColor=white)](https://patreon.com/nguyenngoclong)\n[![KO-FI](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/nguyenngoclong)\n[![Paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge\u0026logo=paypal\u0026logoColor=white)](https://paypal.me/longnguyenngoc)\n\n# Supported Languages and Frameworks\n\n\u003cp align=\"center\"\u003e\n    \u003c!-- JavaScript --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge\u0026logo=javascript\u0026logoColor=black\"\u003e\n    \u003c!-- Typescript --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003c!-- Cypress --\u003e\n    \u003ca href=\"https://www.cypress.io\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/-cypress-49666E?style=for-the-badge\u0026logo=cypress\u0026logoColor=white\"\u003e\n    \u003c/a\u003e\n    \u003c!-- Cucumberjs --\u003e\n    \u003ca href=\"https://cucumber.io/docs/installation/javascript/\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Cucumber-55BB68?style=for-the-badge\u0026logo=Cucumber\u0026logoColor=white\"\u003e\n    \u003c/a\u003e\n      \u003c!-- Playwright --\u003e\n    \u003ca href=\"https://playwright.dev\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Playwright-314B58?style=for-the-badge\u0026logo=Playwright\u0026logoColor=white\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# Installation\n\nGet it from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=nguyenngoclong.cypress-cucumber-step-definition-generator) or [Open VSX Registry](https://open-vsx.org/extension/nguyenngoclong/cypress-cucumber-step-definition-generator).\n\n# Features\n\n-   [Cucumber Step Definition Generator](#using-the-extension) offers multiple options to generate step definition.\n-   Automatically opens the generated step definition file and syncs it with the currently opened window if you are in split editor mode. This saves you time and increases efficiency by allowing you to quickly view and edit the generated file.\n-   Automatically detecting various types of information, such as `DataTable`, `DocString`, `int`, `float`, `string`, and other types of information that are supported by **[Gherkin Syntax](https://cucumber.io/docs/gherkin/)**.\n-   The automatic detection of an asterisk (*) will be defined by a keyword type in the preceding steps.\n-   Additionally, step definition are de-duplicated when regenerating code, ensuring they remain organized and efficient, even when making changes to your testing scenario.\n\n## Using the extension \n\n![Generate step definition](https://github.com/nguyenngoclongdev/step-definition-generator/raw/HEAD/images/generate-step-definition-from-editor-title.gif)\n\nYou have multiple options when it comes to generating step definition using this extension:\n\n-   The extension can automatically create a new file for the step definition when you generate it. To do this, you can either right-click on the feature file or click an icon in the Editor Actions menu.\n-   The extension can also generate the step definition and copy it to the clipboard, which makes it easy to access and paste into the appropriate file. To use this option, you can again right-click on the feature file or click an icon in the Editor Actions menu.\n-   Finally, you can use the Command Palette within the extension to generate step definitions directly. This method may be particularly useful if you prefer to use keyboard shortcuts or if you're working with a particularly large or complex test file.\n\n### Generate a step definition and create a new file\n\n1. Open any .feature file in vs code editor\n2. Right click on the editor and select `Generate step definition to file`\n3. If the file for the step definition doesn't exist, the extension will create it. Otherwise, if the file already exists, the extension will simply append the new step definition to the end of the existing file.\n\n![Generate step definition](https://github.com/nguyenngoclongdev/step-definition-generator/raw/HEAD/images/generate-step-definition-in-editor.gif)\n\n### Generate a step definition and copy to clipboard\n\n1. Open any .feature file in vs code editor\n2. Right click on the editor and select `Generate step definition to clipboard`\n\n![Generate step definition](https://github.com/nguyenngoclongdev/step-definition-generator/raw/HEAD/images/generate-step-definition-to-clipboard.gif)\n\n### Generate step definition from Command Palette\n\n1. Open the Command Palette with Ctrl + Shift + P or Cmd + Shift + P.\n2. Search for \"Generate step definition\" and select \"Generate step definition to clipboard or Generate step definition to file\".\n3. Press Enter to generate the step definition.\n\n![Generate step definition](https://github.com/nguyenngoclongdev/step-definition-generator/raw/HEAD/images/generate-step-definition-from-cmd.gif)\n\n## Configuration\n\n![Configuration](https://github.com/nguyenngoclongdev/step-definition-generator/raw/HEAD/images/step-definition-generator-configuration.gif)\n\n### Change the settings\n\n1. Access the settings and search for \"Step Definition Generator\".\n2. Modify the desired setting value.\n3. Save the updated settings.\n\n```json\n{\n    // Change the testing framework used for step deinitions\n    \"step-definition-generator.runner\": \"cypress\",\n\n    // Change the programing language used for step deinitions\n    \"step-definition-generator.language\": \"typescript\",\n\n    // Choose to generate step definitions using either arrow or regular functions.\n    \"step-definition-generator.arrow\": true,\n\n    // Choose to generate step definitions using either async or sync functions.\n    \"step-definition-generator.async\": false\n}\n```\n\n## Examples\n\n```feature\n@web @regression\nFeature: Search functionality\n\n    As a user,\n    I want to be able to search for products on the website,\n    So that I can find what I need quickly and easily.\n\n    Background:\n        Given I am on the home page\n        And I am logged in as \"user@example.com\"\n\n    Rule: Search by keyword\n\n        Scenario: Search with a valid keyword\n            When I enter \"laptop\" in the search bar\n            And I click the search button\n            Then I should see a list of products containing \"laptop\"\n            And the total number of results should be 10\n\n        Scenario Outline: Search with invalid keyword\n            When I enter \u003ckeyword\u003e in the search bar\n            And I click the search button\n            Then I should see an error message\n\n            Examples:\n                | keyword   |\n                | 12345     |\n                | $%^\u0026*     |\n                | \"invalid\" |\n\n    Rule: Search by category\n\n        Scenario: Search for a specific category\n            When I select \"Electronics\" from the category dropdown\n            And I click the search button\n            Then I should see a list of products in the Electronics category\n            And the total number of results should be a float value between 10.0 and 20.0\n\n        Scenario Outline: Search with multiple categories\n            When I select the following categories:\n                | category    |\n                | Electronics |\n                | Clothing    |\n            And I click the search button\n            Then I should see a list of products in the selected categories\n            And the total number of results should be an integer value\n\n    Rule: Search with filters\n\n        Scenario: Search with filters applied\n            When I select \"Brand A\" from the brand filter\n            And I select \"Price \u003e $100\" from the price filter\n            And I click the search button\n            Then I should see a list of products that match the applied filters\n            And the total number of results should be greater than 0\n\n    Rule: Search with docstring and datatable\n\n        Scenario: Search with advanced options\n            When I click the \"Advanced Search\" link\n            And I fill in the following information:\n                \"\"\"\n                {\n                    \"category\": \"Electronics\",\n                    \"brand\": \"Brand B\",\n                    \"priceRange\": [\n                        50,\n                        100\n                    ],\n                    \"features\": [\n                        {\n                            \"name\": \"WiFi\",\n                            \"value\": \"Yes\"\n                        },\n                        {\n                            \"name\": \"Bluetooth\",\n                            \"value\": \"No\"\n                        }\n                    ]\n                }\n                \"\"\"\n            And I click the search button\n            Then I should see a list of products that match the advanced search criteria\n            And the total number of results should be a float value\n\n        @smoke\n        Scenario: Search withno keyword\n            When I click the search button without entering a keyword\n            Then I should see the home page with no search results displayed\n```\n\n```typescript\nimport { Given, When, Then, DataTable } from '@badeball/cypress-cucumber-preprocessor';\n\nGiven(`I am on the home page`, () =\u003e {\n    // [Given] Sets up the initial state of the system.\n});\n\nGiven(`I am logged in as {string}`, (arg0: string) =\u003e {\n    // [Given] Sets up the initial state of the system.\n});\n\nWhen(`I enter {string} in the search bar`, (arg0: string) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nWhen(`I click the search button`, () =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nThen(`I should see a list of products containing {string}`, (arg0: string) =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nThen(`the total number of results should be {int}`, (arg0: number) =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nWhen(`I enter {any} in the search bar`, (arg0: any) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nThen(`I should see an error message`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nWhen(`I select {string} from the category dropdown`, (arg0: string) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nThen(`I should see a list of products in the Electronics category`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nThen(`the total number of results should be a float value between {float} and {float}`, (arg0: number, arg1: number) =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nWhen(`I select the following categories:`, (arg0: DataTable) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n    // \u003cDataTable\u003e argument is detected:\n    // - With column headers: use DataTable.rowsHash(), which outputs an object containing key-value pairs for each row (e.g. { key1: value, key2: value }).\n    // - With row headers: use DataTable.hashes(), which outputs an array of objects (e.g. [{ key1: value, key2: value }]).\n});\n\nThen(`I should see a list of products in the selected categories`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nThen(`the total number of results should be an integer value`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nWhen(`I select {string} from the brand filter`, (arg0: string) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nWhen(`I select {string} from the price filter`, (arg0: string) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nThen(`I should see a list of products that match the applied filters`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nThen(`the total number of results should be greater than {int}`, (arg0: number) =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nWhen(`I click the {string} link`, (arg0: string) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nWhen(`I fill in the following information:`, (arg0: string) =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n    // \u003cDocString\u003e argument is detected:\n    // - DocString allows for passing a multi-line string as an argument.\n    // - It can also be used to provide large amounts of text data, such as JSON or XML payloads.\n});\n\nThen(`I should see a list of products that match the advanced search criteria`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nThen(`the total number of results should be a float value`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n\nWhen(`I click the search button without entering a keyword`, () =\u003e {\n    // [When] Describes the action or event that triggers the scenario.\n});\n\nThen(`I should see the home page with no search results displayed`, () =\u003e {\n    // [Then] Describes the expected outcome or result of the scenario.\n});\n```\n\n## Feedback\n\nIf you discover a bug, or have a suggestion for a feature request, please\nsubmit an [issue](https://github.com/nguyenngoclongdev/step-definition-generator/issues).\n\n## LICENSE\n\nThis extension is licensed under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenngoclongdev%2Fstep-definition-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnguyenngoclongdev%2Fstep-definition-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenngoclongdev%2Fstep-definition-generator/lists"}