Giter VIP home page Giter VIP logo

capycorder's Introduction

CAPYCORDER

Capycorder helps to record user interactions, generates simple Capybara request specs (Rspec) and copies them into the clipboard for usage in specs. Read more over at polarblau.com.

A word about TDD & BDD

Some will likely feel that this helper and what it does goes against the "tests first" philosophy and may support bad habbits.

Test driven development is great and should definitely be prefered over adding tests after the fact. But we all know, that sometimes testing just doesn't happen at all or that projects come with a few unit tests only.

I'm hoping that in this case, a small tool like Capycorder could lower the barrier and aid in learning the Capybara API as well as to get some specs running a tad faster.

Usage

Navigate to and set-up the page you want to test as needed.

  1. Activate the extension via the icon next to the browser bar
  2. Enter a description for your test (optional) -- this input will be used for the it 'should do something…do … end` block.
  3. Click the Capycorder icon again to enable the actions recorder.
  4. Interact with your page, fill in forms, click links etc. the extension will create form scopes automatically where possible.
  5. Click the icon a third time to switch to the matchers recorder.
  6. Use the highlighter to select a DOM element or select a text range which should be existing within the page as a result.
  7. Click the icon a last time to stop the recorder, generate the specs and copy everything to your clipboard.

Done, now you can use the generated specs e.g. in your Rails project.

What's next?

As mentioned, I've build this tool for myself, so there's no roadmap. A few things I would like to do:

  • Settings panel
  • Support for the syntax of other text frame works than Rspec
  • Improve, refactor and test a few internals more thoroughly
  • Release jquery.get_selector separately once stable
  • Deal with iframes

Want to help?

By all means, any help is highly appreciated.

  • The project is written in Coffeescript, please respect that
  • Add specs for your changes
  • Create a feature branch
  • Send push request

Contributors

  • Josef Šimánek (simi)

Build

The included build script will copy all files listed in the manifest (incl. dependencies) to /build by default or any other DESTINATION defined. It will also first compile all coffescript files and finally create a .zip package ready to use.

thor build [DESTINATION]

You can install the ruby dependencies using bundler.

Check the changelog for latest updates.

Specs

Since the specs are loading fixtures via AJAX, you should run them off a server to avoid cross-origin issues. I prefer to use serve.

The specs are written using Jasmine -- you can find the docs here.

capycorder's People

Contributors

pietia avatar polarblau avatar simi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.