npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

walnutjs

v2.0.3

Published

Walnut Framework - Automated BDD Tests for Web Applications

Downloads

58

Readme

walnutjs

walnutjs is a collection of generic steps for interact with web-applications.

You can easily simulate user interactions using a business-readable way. You only need to write some feature files using the Gherkin syntax and plan your tests with BDD (Behavior Driven Development) pattern.

Enjoy It!

https://nodei.co/npm/walnutjs.png?downloads=true&downloadRank=true&stars=true

CircleCI Npm version License contributions welcome

Usage: walnut [options]

Walnut Framework - Automated BDD Tests for Web Applications

Options:
  -V, --version              output the version number
  -c, --config <path>        path to JSON config file
  -t, --tags <tagName>       name of tag to run (default: [])
  -m, --execMethod <method>  execution method [e.g runOnlyAPI]
  -h, --help                 output usage information

Please see our wiki DOCs for more details.

Getting Started

These instructions will give you a sample feature file to show you how easy is to make your own tests

Prerequisites

Before continue, check that you have completed the following requirements:

  • java - Java runtime environment - tested on 1.8.0_211
  • nodejs - A javascript runtime - tested on v10.16.0
  • selenium webserver:

Setup the project

  1. Start by creating a simple nodejs project and add walnutjs to it:

    mkdir my-app && cd my-app
    npm init -y
    npm i --save walnutjs
  2. Setting up a walnut-config.js file inside rootFolder based on this file

  3. Create a folder structure like that:

    > my-app
        > test
            > features
                sample.feature
            > step-defs
                custom-steps.js
            > locators
                locators.json
            > params
                params.json

    You can create these folders above on your own, just be sure to indicate the correct paths inside walnut-config.js file.

  4. Add the folowing content to locators.json file:

    {
        "containers":[
            {
                "name": "GoogleHome",
                "locators":[
                    { "key": "SearchInput", "type": "name", "value": "q" },
                    { "key": "SearchButton", "type": "p:xpath", "value": "//input[@value='{0}']" }
                ]
            }
        ]
    }
  5. Add the following content to sample.feature file:

    Feature: First test with walnutjs
    
        @simple_web
        Scenario: I want see the Google Page
            Given user navigates to 'http://www.google.com'
            When user fills 'GoogleHome-SearchInput' by replacing text with 'led zeppelin wikipedia'
            And user clicks on 'GoogleResult-SearchButton'
  6. Before execution check that selenium webserver was started correctly. For this sample we will use webdriver-manager

    webdriver-manager start
    ...
    10:15:57.230 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
  7. Define a single start script in your package.json:

     "scripts": {
        "start": "walnut",
      }
  8. Execute your script

    npm start

    You can also run using $(npm bin)/walnut on your terminal

More details

Review this project boilerplate to get more insights and this documentation to see more details.

Running the tests

Just run the following command inside the root folder:

  • test: npm run test
  • coverage: npm run coverage

Built With

  • nodejs - A JavaScript runtime
  • cucumber - tool for running automated tests written in plain language
  • selenium-webdriver - The official Webdriver Javascript bindings from the Selenium project.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License.