Git Product home page Git Product logo

charon's Introduction

README

Purpose

This project is for automating my monthly pass renewal from the AT HOP website.

  1. It’s a pain to do, have to login and click all the right buttons, it isn’t obvious

  2. There’s no way to automate it like the auto top up feature

  3. I can automate it using Selenium WebDriver

Risks

Since it’s an expensive operation ($140/month), I’ll want to be notified of any successful or failed purchases.

I’ll also need to store my AT HOP credentials in the database. This is also risky, encryption is necessary.

Records of any purchase should be kept, and any failures should be made apparent with enough time left on the monthly pass to prevent it from lapsing

Models

An AT HOP account has the data needed to access the AT HOP website.

  1. email

  2. password

  3. run_on_day - the day of the month it should renew its monthly pass

A purchase record is associated with an account, it should record what happened when we tried to buy something. Any kind of data related to the purchase should be stored here in case something goes wrong.

  1. state - queued, success, failure

  2. simulated - just a test of the account and the webdriver flow

  3. log - webdriver events that occurred during the purchase

  4. url - the starting url?

Interacting with the AT HOP website

Renewing a monthly pass goes like this

  1. Navigate to at.govt.nz/athop

  2. Click login button (dodge the session storage crap)

  3. Submit login form

  4. Click Top up my card button

  5. Click Buy a pass link

  6. Select HOP Monthly

  7. (optional) choose start and end zone (default Zone A for both)

  8. Click Apply button

  9. If card details are saved, it will be filled out automatically and you can click purchase

  10. (optional) Click Pending transactions link

  11. (optional) Verify that the table contains a transaction with transaction type “Buy travel pass”

Todo

  • Introduce Sidekiq and Redis for complete automation

  • deploy to Heroku

  • Check time remaining on current monthly pass

  • Verify the pending transaction before and after purchasing

charon's People

Contributors

rowinf avatar

Stargazers

Mark Coleman 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.