Code Monkey home page Code Monkey logo

calculator_tests's Introduction

Basic Calculator Test Suite

This is a study repository that shows a Robot Framework + SeleniumLibrary + ChromeDriver solution to test the Basic Calculator found in:

https://testsheepnz.github.io/BasicCalculator.html

Test Cases

There's a total os 29 test cases, the test case files as well as a resource file used by them are located in the calculator_tests directory.

TIP: You can click on the file names to see the latest versions.

Tests related to happy path scenarios of the 5 operations, this suite also demonstrates using test setup and teardown

Tests related to invalid operations return messages

Tests related to the feature (checkbox) that only shows the answer as an integer value

A test suite with a single Gherkin style test, simulating a bugfix verification

The resource file with the global variables and reusable keywords

Running the tests

You will need 4 thing to run the tests:

  1. Python 3+;
  2. RobotFramework;
  3. SeleniumLibrary
  4. Google ChromeDriver;

Installing (MAC OS):

  1. Download the latest Python Version from https://www.python.org/downloads/macos/

  2. Verify if everything is running fine:
    python3 --version
    pip3 --version

  3. Install Robot Framework and Selenium Library via pip:
    pip install robotframework
    pip install robotframework-SeleniumLibrary

  4. Install the ChromeDriver via Brew:
    brew install chromedriver

Click here for more detailed installation instructions

Running Tests

To run all the tests you can simple run this command:
robot calculator_tests
You can also run a single test suite:
robot calculator_tests/bug_verification.robot
You can check more detailed examples here

Using Other Build or Browser

By default the tests are running on the BUILD 2, you can edit the resource file or simple add the --variable BUILD:3 to your command, for example:
robot --variable BUILD:3 calculator_tests/bug_verification.robot
The same applies if you are looking for a different browser (note that you will need the respective browser driver), for example:
robot --variable BROWSER:firefox calculator_tests

Test Results

On the Prototype Build all the tests passed, but using the Build #2, only 19 of the 29 tests passed, the detailed report can be found here:

Conclusions/observations

  • Since all the elements had an clear ID name, was not necessary create a resource with the locators of the elements;
  • We are dealing with 5 operations and infinite possibilites of numbers combinations, so we have to define a test strategy to have enough scenarios to cover the most common numbers/operations, a boundary Value Analysis and/or Equivalence Partitioning Testing approach seems to be a good place to start;
  • Robot Framework is an funny and efficient way to make test automations! :ห†)

calculator_tests's People

Contributors

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