Coder Social home page Coder Social logo

campsite-checker's Introduction

Campsite-Checker

Stories in Ready

Use the Nightwatch.js end-to-end testing framework to check if campsites or permits have become available.

##Setup Local Environment

  1. Clone repo to your computer.
  2. Within the directory Campsite-Checker, run npm install from the terminal.
  3. Download latest Selenium server from http://selenium-release.storage.googleapis.com/index.html
  • Click on the latest version
  • Click on selenium-server-standalone-(version number).jar
  1. Open the nightwatch.json file in the main directiory for editing.
  • Save.
  1. Copy nightwatch.json.

##Run Automatic Checks Campsite Checker uses forever to run, well, forever, in the background of your computer.

  1. Open your command line window to the root directory for Campsite-Checker/.
  2. Run forever start server.js.

Inside server.js there is a simple loop which runs npm test every 10 minutes. It also appends the event to runlog.txt to confirm that the test ran.

To stop the tests, go back to the command line and root directory. Type forever stop server.js.

##Run Manual Checks Tests which are in-use will be flagged with the "run" tag. This allows other tests to remain archived for future use, without the need to run them unneccessarily or delete them.

To run tests, open a terminal window and navigate to theCampsite-Checker/ directory, then enter:

npm test

##Other Browsers

Chrome

The default browser is currently PhantomJS, but Chrome could be another option. Check to ensure that your tests are compatible with different browsers by running tests from the command line using the --env flag.

./nightwatch -a run --env chrome

This is already aliased in package.json because it's easier to see your development process when it pops open a browser, unlike the headless PhantomJS.

npm run test-chrome

Firefox

Firefox does not like dropdown selection menus. In tests/SteepRavine.js, you may notice commented-lines which indicate they are firefox only. These lines should generally be uncommented, with the lines below them being removed.

For some reason, you have to use keystrokes as a work-around. Here's a Stack Overflow topic explaining the issue and solution.

##Writing Tests See Nightwatch.js documentation: http://nightwatchjs.org/guide#usage

There are also examples in node_modules/nightwatch/examples/tests/google/.

##Manually Start the Selenium-Standalone Server The nightwatch.json file asks the selenium process to start automatically, but sometimes you may wish to start the server manually for debugging purposes.

  1. Open a terminal window to the root director Campsite-Checker/.
  2. Enter java -jar selenium-server-standalone-VERSION#.jar.

##Todos

  • Update README to include mandrill, etc.
  • Update README to include forever
  • Generalize code for other sites/locations/needs

campsite-checker's People

Contributors

adamjaffeback avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

campsite-checker's Issues

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.