GithubHelp home page GithubHelp logo

ivodimitrov / rest-api-ruby-framework Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 38 KB

API test framework

Ruby 100.00%
rspec ruby api-testing automation-framework automation-testing test-automation test-automation-framework testing api-framework api-testing-framework testing-framework

rest-api-ruby-framework's Introduction

api-framework

Tests Parallel Tests

Don't forget to give a ⭐ to make the project popular.

An automated API / web service / integration testing framework

The framework using the following:

  • Allure Report - A flexible lightweight test report tool.
  • Faker - A library for generating fake data such as names, addresses, and phone numbers.
  • Parallel tests - Speed up RSpec by running parallel on multiple CPU cores.
  • Pry - A runtime developer console.
  • Rake - Allows us to create tasks to manage dependencies and run our checks.
  • Rest-client - Builds and triggers HTTP requests whilst handling
  • Rspec - Framework to create and organise our checks. responses to be used in our checks.
  • Rubocop - RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter..
  • Ruby - A popular language with testers.

The framework contains following areas:

  • spec - stores automated checks. The tests will call functions from the API and Payload areas of the framework and be responsible for asserting responses.
  • api - a library of API endpoints which are used in spec to communication with restful-booker. They are grouped based on the resource you are calling so if there are two resources called Booking and Auth then we create two classes named Booking and Auth. Each function is tied to an individual request that can be called multiple times. This means if the request changes it requires a single change to propagate through the framework.
  • payloads a suite of builders to create payloads for POST requests. Payloads that are required for requests and responses are stored in this area. The idea is similar to the API area in that one class is responsible for one payload that may be called multiple times. Again, this means if the payload changes it requires a single change to propagate through the framework.
  • gemfile / Rakefile manages the running of framework and it’s dependencies.
  • steps - Preconditions and/or multi-action test steps.

Tests

Suite of automated checks against the web service restful-booker

Setup

  1. Clone this repository.

  2. Run the following step that installs the necessary dependencies. Bundler is required.

bundle install

Configurations

ENV_URL -> defaults to https://restful-booker.herokuapp.com, any valid url can be passed to set the target environment.

Executing tests

To start tests, run:

bundle exec rake

or execute individual test with provided ID (symbol after test's name, which contains digits enclosed in quotes: tms:'101' )

bundle exec rspec --tag tms:101

Run tests in parallel:

bundle exec parallel_rspec

Generating local HTML Allure report

To generate the report from existing Allure results you can use the following command:

allure generate report/allure-results --clean

When the report is generated you can open it in your default system browser. Simply run:

allure open allure-report

For more info, please visit: Allure Framework official documentation

API documentation for the playground

restful-booker detailed API documentation

What is the builder pattern?

@FriendlyTester has a great blog post on what the builder pattern is and it’s context to data creation.

rest-api-ruby-framework's People

Contributors

ivodimitrov avatar

Stargazers

 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.