Git Product home page Git Product logo

automation_api_test_golang_testify's Introduction

Testing Restful API with Golang Testify

Testdata

Purpose

Directory Structure

git ls-tree -r --name-only HEAD | tree --fromfile

.
├── .gitignore
├── README.md
├── api
│   ├── product
│   │   └── const.go
│   └── users
│       └── const.go
├── deployments
│   └── Dockerfile
├── go.mod
├── go.sum
├── http_client
│   └── client.go
├── readme
│   └── getproduct_result.png
└── test_suites
    ├── product
    │   ├── deleteProduct_test.go
    │   ├── getProduct_test.go
    │   └── postProduct_test.go
    └── users
        └── isAvailable_test.go

        ... ...

Step-by-step

Before Testing

Option 1. Build up a simple Docker

Input the command

docker build -t testify_learn_image -f ./deployments/Dockerfile .

Option 2. Set up on local

Pls input the command before testing.

$ go mod init automation_api_test_golang_testify
$ go mod tidy
$ go mod download

Testing

After the code completed, then run the command to launch the API test.

$ go test -v ./...
OR
$ go test -v ./test_suites/product/getProduct_test.go

getproduct_result.png

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.