Git Product home page Git Product logo

pawelwritescode / godog-http-api Goto Github PK

View Code? Open in Web Editor NEW
9.0 0.0 0.0 112.52 MB

Skeleton that allows to write E2E tests for HTTP API with use of framework godog and test library gdutils.

Home Page: https://pawelwritescode.github.io/godog-http-api.documentation/

License: MIT License

Go 16.90% Gherkin 81.30% Makefile 1.70% Dockerfile 0.10%
godog gdutils golang go cucumber gherkin testing end-to-end http api

godog-http-api's Introduction

Hi , I'm Paweł Chmielewski 🇵🇱


Linkedin Badge

Typing SVG

godog-http-api's People

Contributors

pawelwritescode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godog-http-api's Issues

New features for v2.1.0

  1. Steps:
  • the "(JSON|YAML|XML)" node "([^"]*)" should be "(string|int|float|bool)" of value "([^"]*)"
  • the "(JSON|YAML)" node "([^"]*)" should (not )?be "(nil|string|int|float|bool|map|slice)

Should now accept more types as stated here. And method

  1. New steps will be added:
  • the response cookie should (not )?match regExp "([^"]*)"
  • the "(JSON|YAML|XML)" node "([^"]*)" should (not) contain substring "([^"]*)
  • the "(JSON|YAML|XML)" node "([^"]*)" should be "(string|int|float|bool)" and contain one of values "([^"]*)
  • I print scenario cache data
  1. Steps:
  • I generate a random word having from "(\d+)" to "(\d+)" of "(ASCII|UNICODE|polish|english|russian)" characters...
  • I generate a random sentence having from "(\d+)" to "(\d+)" of "(ASCII|UNICODE|polish|english|russian)" words...

Will have more charsets available.

  1. Update godog to v0.12.5 which solves go 1.18 problem.
  2. Change QJSON - json path engine to GJSON

Create new step that allows to save multi line characters

Background

Usual test scenario consist of multiple steps. One step may produce/obtain data that need to be used in next steps. That is why currently there exists few steps that allows to save data into scenario cache.

Objective

Create step and it's definition that allows to save arbitrary multi-line data into scenario cache.

New changes for v2.0.0

  1. Following methods should accept optional negation (not )?:
  • the response should have header "([^"]*)"
  • the response should have cookie "([^"]*)"
  • the response status code should be (\d+)
  • the "(JSON|YAML|XML)" response should have node "([^"]*)"
  • the "(JSON|YAML|XML)" node "([^"]*)" should be slice of length "(\d+)"
  • the "(JSON|YAML)" node "([^"]*)" should be "(nil|string|int|float|bool|map|slice)"
  • the "(JSON|YAML|XML)" node "([^"]*)" should match regExp "([^"]*)"
  • the response body should have format "(JSON|YAML|XML|plain text)"

Add new project usage examples

Background

This project allows to test HTTP(s) API. It consists of over 40 basic methods grouped into different categories (random data generation, debugging, sending http requests, ...). More information describing detailed aspects can be found in project's wiki

Objective

Task is to find free publicly available API and test it using this project. Tests should be placed in features directory.

Project uses godog therefore tests should be written using predefined sentences listed in main.go file. Current tests covering simple rest API server can be found in features directory.

  • Find publicly available API that can be easily accessed without API-key, authorization required
  • Write basic tests covering this API

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.