Giter Site home page Giter Site logo

pwojt / peteshow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brousalis/peteshow

0.0 2.0 0.0 2.51 MB

A customizable javascript framework for filling out forms with fake data

License: MIT License

Ruby 0.09% JavaScript 97.74% CSS 1.50% HTML 0.67%

peteshow's Introduction

Peteshow

a customizable javascript framework for filling out forms with fake data

Imgur

Getting Started

See the Wiki on GitHub for documentation.

Also specific pages for frameworks:

API

Peteshow.init()

Adds the seen above menu to the top left of your page. Press backtick ` to toggle the menu.

Peteshow.fillOutForms()

Using the default rules, fills out inputs, checkboxes, selects, and radio buttons. While the menu is open, press f to call this method.

Peteshow.fillOutFormsAndSubmit()

Does the same as above, but also submits the form. Press q to call this method.


It also has several other methods exposed:

Methods Description
submitForm() Submits the form on the page, can be customized
destroy() Removes the Peteshow menu from the dom
hide() Hides the Peteshow menu
show() Shows the Peteshow menu
formatDate(format, Date) Returns a string with the specified format
randomChars(length, chars) Returns a string made up of specific characters
randomDate(format) Returns a random date string
randomEmail() Returns a random email, customized using init options
randomLetters(length) Returns random letters
randomNumber(length) Returns a random number, you can pass an optional prefix
randomNumberRange(min,max) Returns a number between min and max

To access the stored values used in the reuse option, use Peteshow.storage:

Methods Description
storage.clear() Clears saved fields from cookies and localstorage
storage.get() Prints out the saved fields used in the reuse option
storage.set(hash) Sets either cookie or localstorage, takes a hash

Default options

Peteshow can be customized by creating a custom plugin. Here are the default options:

options = {
  emailPrefix : 'test-',
  emailDomain : 'example.com',
  form        : '',
  blur        : false,
  cookies     : false,
  rules       : {},
  ignore      : [],
  filter      : [],
  force       : {},
  reuse       : {},
  commands    : '',
  special     : function(){},
  events      : function(){},
}
$(function() {
  Peteshow.init(options)
})
Name Description
emailPrefix Prefix for your generated email addresses. Random numbers are added to the end
emailDomain The domain for your generated email addresses
form The selector of the form/forms you want to be filled out, defaults to last form on page
blur Triggers blur() event after filling out an input
cookies Store saved fields (from reuse) in cookies rather than localStorage
rules A hash of selectors to values that you want to be used when filling out forms. It ignores hidden inputs
special Called after the rules are applied and can include custom javascript
ignore An array of selectors you wish to have fill out forms ignore
force Similar to rules, but can be used for hidden inputs
filters Filters out options from select boxes
reuse Define input selectors to be saved and reused on certain URLs
events Used in the off chance you need to add extra javascript on Peteshow's init

Further notes

enova

Developed by Pete Brousalis in his spare time for use at Enova in Chicago, IL.

Special thanks to Matthew Bergman & Marak Squires for Faker.js, Adam Gschwender for jquery.formatDateTime, Klaus Hartl for jquery.cookie, all used by Peteshow.

And especially Donnie Hall for creating the original Peepshow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.