{"id":20999795,"url":"https://github.com/mmendesas/walnutjs","last_synced_at":"2025-09-06T17:45:39.524Z","repository":{"id":19847185,"uuid":"81599000","full_name":"mmendesas/walnutjs","owner":"mmendesas","description":"A framework that helps you build your e2e tests easily using the BDD style","archived":false,"fork":false,"pushed_at":"2023-01-04T04:21:56.000Z","size":13126,"stargazers_count":16,"open_issues_count":25,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-25T18:17:53.817Z","etag":null,"topics":["automation","bdd-style","cucumber","e2e-tests","es6","nodejs","selenium","ui-testing"],"latest_commit_sha":null,"homepage":"https://mmendesas.github.io/walnutjs/","language":"JavaScript","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/mmendesas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-10T19:24:21.000Z","updated_at":"2023-08-22T16:22:59.000Z","dependencies_parsed_at":"2023-01-11T20:37:49.734Z","dependency_job_id":null,"html_url":"https://github.com/mmendesas/walnutjs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmendesas%2Fwalnutjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmendesas%2Fwalnutjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmendesas%2Fwalnutjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmendesas%2Fwalnutjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmendesas","download_url":"https://codeload.github.com/mmendesas/walnutjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254248132,"owners_count":22038971,"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","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":["automation","bdd-style","cucumber","e2e-tests","es6","nodejs","selenium","ui-testing"],"created_at":"2024-11-19T08:08:19.088Z","updated_at":"2025-05-14T23:31:09.208Z","avatar_url":"https://github.com/mmendesas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **walnutjs**\n\n**walnutjs** is a collection of generic steps for interact with web-applications.\n\nYou can easily simulate user interactions using a business-readable way.\nYou only need to write some feature files using the **Gherkin** syntax and plan your tests with **BDD (Behavior Driven Development)** pattern.\n\nEnjoy It!\n\n\n[![https://nodei.co/npm/walnutjs.png?downloads=true\u0026downloadRank=true\u0026stars=true](https://nodei.co/npm/walnutjs.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/walnutjs)\n\n[![CircleCI](https://circleci.com/gh/mmendesas/walnutjs.svg?style=svg)](https://circleci.com/gh/mmendesas/walnutjs)\n[![Npm version](https://img.shields.io/npm/v/walnutjs.svg?style=flat-square)](https://www.npmjs.com/package/walnutjs)\n![License](https://img.shields.io/npm/l/walnutjs.svg?style=flat-square)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)\n\n\n```sh\nUsage: walnut [options]\n\nWalnut Framework - Automated BDD Tests for Web Applications\n\nOptions:\n  -V, --version              output the version number\n  -c, --config \u003cpath\u003e        path to JSON config file\n  -t, --tags \u003ctagName\u003e       name of tag to run (default: [])\n  -m, --execMethod \u003cmethod\u003e  execution method [e.g runOnlyAPI]\n  -h, --help                 output usage information\n```\n\n\u003e Please see our wiki **[DOCs](https://github.com/sednemm/walnutjs/wiki)** for more details.\n\n\n## Getting Started\nThese instructions will give you a sample feature file to show you how easy is to make your own tests\n\n### Prerequisites\nBefore continue, check that you have completed the following requirements:\n* [**java**](https://www.java.com/en/download/) - Java runtime environment - _tested on 1.8.0_211_\n* [**nodejs**](https://nodejs.org) - A javascript runtime - _tested on v10.16.0_\n* **selenium webserver**:\n    * [**webdriver-manager**](https://www.npmjs.com/package/webdriver-manager) - A selenium server and browser driver manager.\n    * [**zalenium**](https://opensource.zalando.com/zalenium/) - A flexible and scalable selenium grid.\n\n### Setup the project\n1. Start by creating a simple `nodejs` project and add **walnutjs** to it:\n    ```sh\n    mkdir my-app \u0026\u0026 cd my-app\n    npm init -y\n    npm i --save walnutjs\n    ```\n2. Setting up a `walnut-config.js` file inside rootFolder based on [this file](https://github.com/mmendesas/walnutjs-boilerplate/blob/master/walnut-config.json)\n3. Create a folder structure like that:\n    ```sh\n    \u003e my-app\n        \u003e test\n            \u003e features\n                sample.feature\n            \u003e step-defs\n                custom-steps.js\n            \u003e locators\n                locators.json\n            \u003e params\n                params.json\n    ```\n    \u003e You can create these folders above on your own, just be sure to indicate the correct paths inside `walnut-config.js` file.\n4. Add the folowing content to `locators.json` file:\n    ```json\n    {\n        \"containers\":[\n            {\n                \"name\": \"GoogleHome\",\n                \"locators\":[\n                    { \"key\": \"SearchInput\", \"type\": \"name\", \"value\": \"q\" },\n                    { \"key\": \"SearchButton\", \"type\": \"p:xpath\", \"value\": \"//input[@value='{0}']\" }\n                ]\n            }\n        ]\n    }\n    ```\n5. Add the following content to `sample.feature` file:\n    ```gherkin\n    Feature: First test with walnutjs\n\n        @simple_web\n        Scenario: I want see the Google Page\n            Given user navigates to 'http://www.google.com'\n            When user fills 'GoogleHome-SearchInput' by replacing text with 'led zeppelin wikipedia'\n            And user clicks on 'GoogleResult-SearchButton'\n    ```\n\n6. Before execution check that `selenium webserver` was started correctly. For this sample we will use `webdriver-manager`\n    ```sh\n    webdriver-manager start\n    ...\n    10:15:57.230 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444\n    ```\n\n7. Define a single start script in your `package.json`:\n    ```json\n     \"scripts\": {\n        \"start\": \"walnut\",\n      }\n    ```\n8. Execute your script\n    ```sh\n    npm start\n    ```\n    \u003e You can also run using `$(npm bin)/walnut` on your terminal\n\n### More details\n\u003e Review this [project boilerplate](https://github.com/mmendesas/walnutjs-test) to get more insights and [this documentation](https://github.com/mmendesas/walnutjs/wiki) to see more details.\n\n\n## Running the tests\n\nJust run the following command inside the root folder:\n  * test: `npm run test`\n  * coverage: `npm run coverage`\n\n\n## Built With\n\n* [nodejs](https://nodejs.org/en/) - A JavaScript runtime\n* [cucumber](https://www.npmjs.com/package/cucumber) - tool for running automated tests written in plain language\n* [selenium-webdriver](https://www.npmjs.com/package/selenium-webdriver) - The official Webdriver Javascript bindings from the Selenium project.\n\n## Authors\n\n* **Marcio Mendes** - *Initial work* - [mmendesas](https://github.com/mmendesas)\n\nSee also the list of [contributors](https://github.com/mmendesas/walnutjs/graphs/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmendesas%2Fwalnutjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmendesas%2Fwalnutjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmendesas%2Fwalnutjs/lists"}