Giter Site home page Giter Site logo

test-automation-challenge's Introduction

Test automation challenge

This project is part of the 'Test Automation Without the Headache' workshop. It contains a simple web application with some horribly bad automated tests, and allows workshop participants to explore some better ways of automating tests.

The application allows two types of access - administrators can create user accounts and items, but cannot purchase anything. Regular users cannot create any items or accounts, but they can put items into a shopping cart, check out and top-up their balance. The orders will fail if users do not have enough money in their account. (Note the code is intentionally buggy, to demonstrate the effects of good tests).

Prerequisites

  • NodeJS (at least 4.3)
  • A modern web browser (ideally Chrome)

Setting up

  • run npm install to get all the dependencies

Using the web app

  • Run npm start to start the web application on https://localhost:3000.
  • Sign in as the administrator, with the username admin and password admin.
  • Create some user accounts in the web site -- the password will always be the same as the username.
  • You can use the following test credit card numbers:
expected outcome number
Insufficient funds 5555555555554444
Server is offline 4242424242424242
Payment successful 4000000000000077

Running tests

Run all the tests:

npm test

Run a subset of tests:

npm test -- filter='some part of the test name'

(note the space between -- and filter).

For example, to execute all the tests containing the phrase account balance in the name, use the following command line:

npm test -- filter='account balance'

Links for more information on the tools

  • Zombie.js, "Insanely fast, headless full-stack testing using Node.js"
  • Jasmine, "Jasmine is a behavior-driven development framework for testing JavaScript code."
  • Express, "Fast, unopinionated, minimalist web framework for Node.js"

test-automation-challenge's People

Contributors

gojko 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.