Git Product home page Git Product logo

petstoreapiassignment's Introduction

Build Status

Document purpose

I will try briefly to explain how I wanted to approach testing, which difficulties I faced and what I actually was able to produce.

Initial technical task:

Setup BDD framework based on Cucumber Write tests for https://petstore.swagger.io/

Original plan was:

  1. Write tests in Java.
  2. Use generated client.
  3. Write next tests:
    • CRUD operations with API
  4. Use Allure for reporting.

What was achieved:

  1. Maven project that has a series of API tests.
  2. API tests include:
    • CRUD tests with PET API. This few tests shows ability to work with Rest API.
  3. After tests are finished, allure report is generated.

Difficulties I have faced during testing :

Initial project setup was done with generated client from swager. Test was runnable but client had an issues. So I had to rewrite client using RestAssured library. Requests were returning JasonPath and I was working with stings for validating response. But then I decided to rewrite string validations to data models. So I can work with objects instead of strings. Most of the time I had to spend on figuring out right dependencies as maven would not start tests what blocked possibility of going to CI.

In order to run test you can use IDE or you need to call mvn cleat test task inside the project folder. In order to get report you need to call allure serve target/surefire-reports/ task inside the project folder. But to be able to do so you need to install allure with brew install allure.

What could be improved :

  • Data provider with various test data sets can be created. Can be added logger to requests and responses. Extend amount of test to cover all endpoints and add negative cases.

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.