Coder Social home page Coder Social logo

xotabu4 / demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from typicode/demo

16.0 5.0 10.0 5.01 MB

Old demo: Typescript+MochaJS+ChaiJS+RequestsJS for API testing. RAML validation as a bonus!

Home Page: https://my-json-server.typicode.com/typicode/demo

License: MIT License

RAML 18.03% TypeScript 81.97%

demo's Introduction

Old Demo: Typescript tests against fake API server

This project is for API tests presentation as demo code

In this project i showing POSSIBLE (my vision) of API testing framework that needs to be scaled to big test numbers. It can be overengineering if test number will be low.

In this project i demonstating aproach how Models data objects could be built, how create Models with Builders, how can controllers be used. And as a bonus - possible way to use automatic data validation against documentation (RAMLvalidator) - this can greatly reduce number of assertions in tests, since most of shape assertions will be done automatically.

API Server

https://my-json-server.typicode.com/Xotabu4/demo

Thanks this great tool for such easy API mocking: https://my-json-server.typicode.com/

RAML file

https://raml.org/

Is written by my own and located: ./api.raml

Provides description of what API must looks like.

Run tests

npm test

Used technologies

  • typescript
  • ts-node
  • mocha
  • chai
  • allure reports
  • raml-parser

Allure HTML reports

// TODO: wrap to docker container For reports generation - java is needed.

After tests executed, they put .xml files with results into ./allure-results/ folder

To convert those .xml into .html report - call npm run report After, open ./index.html file in generated ./allure-report folder.

Keep in mind, that report is re-created each time you call npm run report - so older reports will be overwritten

demo's People

Contributors

typicode avatar xotabu4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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