Giter Club home page Giter Club logo

ukhomeoffice.swappr's Introduction

swappr

Client / Server app for managing shift swaps

Running the app

Swappr uses MySQL. Before running for the first time, ensure the database and user exist and have appropriate permissions. E.g. by executing the contents of schema.sql.

Start the MySQL server:

mysql.server start

Then set up the db:

mysql -u root < schema.sql

and run the seed:

mysql -u root < seed.sql

Smoke tests

Requirements

Install PhantomJS eg. using Homebrew on Mac:

brew update && brew install phantomjs

Navigate to /integration/smoke_tests and run

bundle install

Running

To run the tests locally, ie localhost:8080, use:

rake smoke_test

This will reset the database and seed it with 2 users, bill and ben, before running the test suite.

To run the test suite against another instance of the app, pass the hostname of that server as an argument:

rake "smoke_test['http://www.google.com']"

Writing

The tests are written in Capybara.

Shared code for steps is in step_definitions/common_steps.rb

Debugging

To aid debugging of tests, open integration/smoke_tests/spec/spec_helper.rb and set

Capybara.default_driver = :selenium

This will run the tests in Firefox by default so you can see what's going on.

To set a breakpoint in a test, insert this line into your step definition:

binding.pry

This will pause execution in the command prompt and let you examine variables, run Capybara queries etc. You can also step through the test using next / continue. See pry-nav

ukhomeoffice.swappr's People

Contributors

jonnywyatt avatar tarttelin avatar mgladdish avatar richiv avatar kevinpotgieter avatar atrvrs 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.