Coder Social home page Coder Social logo

yas's Introduction

Yas

Yet Another Silk Test Tool. This project is originally inspired by silk test.

  • Markdown based document-driven RESTful API testing.
  • This tool is not compatible with silk markdown.

Usage

yas -u <base-api-url> [path/file]

Test Suite

Test Suite is a markdown file. Test Suite can contain several test cases.

Test Case

Test Case uses H1 (#) to identify beginning of test case and its name.

# Test case name

Method and URI

Method and URI uses H2 (##) to identify method and URI.

## POST /login

Request headers

Request headers will be in a table with 2 columns named "Header" and "Value".

| Header | Value |
| - | - |
| Content-Type | application/json |

Request body

Request body uses code block (3 backticks).

```
{
    "login": "admin",
    "password": "secret"
}
```

Expectation

Expectation section starts by using H2 (##) with title "Expectation".

## Expectation

Assertion

Assertion uses table with 2 columns. The header must be "Assert" and "Expected".

  • Value in response header can be addressed by using "Header" object, e.g. Header.Content-Type.
  • Value in response body can be addressd by using "Data" object, e.g. Data.token.
  • StatusCode is response status code.
  • Expected value will be treated as regular expression when surrounded by /.

Test Setup

Test setup section starts by using H2 (##) with title "Precondition".

Steps in test setup are written using bullets with links. Title of link are just a text explaining what to be done. The link is an actual task to be performed.

* [Login](./library/login.md)
* [Get User Data](./library/get-user-data.md)

You can put anything you want surrounding the link to make the step clearer.

* [Login](./library/login.md) with valid credential and collect access token.
* Then [Get User Data](./library/get-user-data.md) with the token above.

Test Teardown

Test setup section starts by using H2 (##) with title "Finally".

Declaring steps in test teardown is like doing so in test setup.

Tasks

Tasks are used in Setup and Teardown. Task does not contain any assertion. Capture table can be declared in Task for future use.

Capture Table

Capture Table is a table telling what to be collected. It has 2 columns with header "Name" and "Value". Name is referrable name. Value is what to be kept. Value syntax is identical to Assertion.

Comment

All lines not mentioned above are comment.

License

License

yas's People

Contributors

chonla avatar

Watchers

 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.