Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including nemo-poster with all npm packages installed. Try it out:

var nemoPoster = require("nemo-poster")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

nemo-poster v1.0.0

plugin for posting a form via webdriver and nemo

nemo-poster

A nemo plugin for posting a form via webdriver

Install

npm install --save-dev nemo-poster

Usage

In your config.json:

"plugins": {
    ...
    "post": {
        "module": "nemo-poster"
    } 
    ...
}

In your script:

//nemo instantiated above

//I want to post a couple of name/value pairs to localhost
var action = 'http://localhost:8000';
var params = [{name: 'param1', value: 'val1'}, {name: 'param2', value: 'val2'}];

nemo.post(params, action); //returns a webdriver promise

//whatever comes next

API

nemo-poster will add a post object to the nemo object. It is a function that you call with two arguments:

params

Array of objects. Each object is of the form {name: 'nvpname', value: 'nvpvalue'}

action

The server endpoint where you want to POST

returns

A webdriver promise. You can call it in the synchronous style along with your other webdriver commands.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free