Giter Site home page Giter Site logo

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 input IDs 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

peteshow's People

Contributors

brousalis avatar gsilis avatar itsthatguy avatar rnubel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

peteshow's Issues

Enhance usability of stored fields in peteshow panel

When using peteshow and capturing an email address on the sign-up page of our app I often refer back to the peteshow panel to grab the email address and sign-in to the account.

  1. The email address overflows the panel.
  2. The email address/stored fields would be great if they had a "click to copy" option.

Expose Faker again

Faker used to be globally exposed which allowed the consuming Rails app to do things like: Faker.Address.streetAddress()
But the introduction of gulp in #2 stopped doing this which now causes the error: Uncaught ReferenceError: Faker is not defined and stops Peteshow from loading.

I wouldn't mind if Faker would be scoped within Peteshow, but such a breaking change should probably be mentioned in a Changelog.md file

Affected apps based on a GitHub search are:

Peteshow mutates checkbox values to non boolean

Peteshow is mutating the true/false values of checkboxes by overriding with other string values.

Example: if a checkbox is for receiving Email/Direct Mail, Peteshow will override the value of checkbox to values such as an email address or a postal code

๐Ÿ˜ฆ

Is this project still active?

I remember us talking about a future release of your newer version, but haven't seen any activity in quite a few months.

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.