Skip to content

Commit e577828

Browse files
authored
Merge pull request #57 from chkware/release/v0.4.2-site
Release: v0.4.2 site documentation update
2 parents b9567d4 + 725b8ee commit e577828

24 files changed

Lines changed: 2723 additions & 10759 deletions

README.md

Lines changed: 5 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,8 @@
1-
# `chkware` website
1+
# CHKware website
22

3-
This repository holds source code and publishable website for [**`chkware`**](https://github.com/chkware/cli#readme). Please access using https://chkware.github.io.
3+
This repository holds source code and publishable website for [CHKware](https://github.com/chkware/cli).
44

5-
### Installation
5+
### Install and setup
66

7-
Clone the repo:
8-
9-
```sh
10-
git clone https://github.com/chkware/chkware.github.io.git
11-
cd chkware.github.io
12-
```
13-
14-
Install dependencies:
15-
16-
```sh
17-
npm install
18-
```
19-
20-
### Local Development
21-
22-
```
23-
$ npm start
24-
```
25-
26-
This command starts a local development server and opens up a browser window. You can also follow `http://localhost:3000/` URL in any browser.
27-
28-
Most changes are reflected live reload without having to restart the server.
29-
30-
### Build
31-
32-
```
33-
$ npm run build
34-
```
35-
36-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
37-
38-
### Guides
39-
40-
Learn how to contribute to this website.
41-
42-
### Configs
43-
44-
All the configs can be found in `docusaurus.config.js`.
45-
46-
#### Create a doc page
47-
48-
Create a Markdown file, `example.md`, and place it under the `docs` directory. Any markdown file will render into the site without needing any extra configuration. It will be displayed alphabetically on the sidebar.
49-
50-
```bash
51-
root
52-
├── docs
53-
│ └── example.md
54-
├── docusaurus.config.js
55-
├── ...
56-
```
57-
58-
Markdown documents can use the Markdown front matter metadata fields, enclosed by a line `---` on either side. At the top of the file, you can optionally specify attributes in the front matter, so that Docusaurus will pick them up correctly when generating the site. Accepted fields can be found [here](https://docusaurus.io/docs/next/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter).
59-
60-
#### Create a doc category
61-
62-
Creating a `example.md` in a sub folder will create a category in the sidebar.
63-
64-
```bash
65-
root
66-
├── docs
67-
│ └── sub-folder
68-
│ └── example.md
69-
```
70-
71-
To change the category name or other category meta data, an optional file `_category_.json` can be created in the respective sub folder. More [here](https://docusaurus.io/docs/next/sidebar/autogenerated#autogenerated-sidebar-metadata).
72-
73-
```json
74-
{
75-
"label": "Tutorial"
76-
}
77-
```
78-
79-
#### Static Assets
80-
81-
The Static Assets can be found in the `static` folder. More [here](https://docusaurus.io/docs/next/static-assets).
82-
83-
#### Change theme color
84-
85-
Generate the variables from [here](https://docusaurus.io/docs/next/styling-layout#styling-your-site-with-infima). Then replace the variables in `src/css/custom.css` with these new variables. Don't forget variables for dark mode.
86-
87-
#### Change codeBlock theme
88-
89-
Docusaurus uses [Prism React Renderer](https://github.com/FormidableLabs/prism-react-renderer) to highlight code blocks. All configuration are in the `prism` object of `docusaurus.config.js`. You can specify a custom theme from the [list of available themes](https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/themes).
90-
91-
#### Syntax highlighting
92-
93-
To add syntax highlighting for any of the other [Prism-supported languages](https://prismjs.com/#supported-languages), define it in an array of additional languages. More [here](https://docusaurus.io/docs/next/markdown-features/code-blocks#supported-languages).
94-
95-
#### Change footer
96-
97-
You can add logo and a copyright to the footer via `themeConfig.footer`. More [here](https://docusaurus.io/docs/next/api/themes/configuration#footer-1).
98-
99-
#### Blog
100-
101-
To set up blog, start by creating a `blog` directory. More [here](https://docusaurus.io/docs/next/blog).
102-
103-
#### Admonitions
104-
105-
In addition to the basic Markdown syntax, Docusaurus use [remark-admonitions](https://github.com/elviswolcott/remark-admonitions) alongside MDX to add support for admonitions. Admonitions are wrapped by a set of 3 colons. More [here](https://docusaurus.io/docs/next/markdown-features/admonitions).
106-
107-
#### Update Docusaurus version
108-
109-
To update Docusaurus version, manually change the version number in `package.json` to the desired version. Then run `npm run install`.
110-
111-
Any required change/depricated message will be shown on the terminal when running the command `npm run start`. More [here](https://docusaurus.io/docs/next/installation#updating-your-docusaurus-version).
112-
113-
### Status
114-
115-
The current status of the website is **under construction**. Please follow us on Twitter [@chkware](https://twitter.com/chkware) for update. Thank you for your patience.
116-
117-
---
118-
119-
`chkware` website uses [docusaurus v2.0.0-beta.17](https://github.com/facebook/docusaurus/releases/tag/v2.0.0-beta.17) as CMS backend.
7+
- Head to [CHKware website](https://chkware.github.io/setup), for documentation, if you want to use *CHKware* in your project.
8+
- Jump to the [setup for website developer](http://chkware.github.io/setup/setup-site-dev) if you want to contribute to this repository.

docs/assets/http-resp-xkcdcom.png

212 KB
Loading

docs/assets/testcase-eximg-01.png

56.5 KB
Loading

docs/examples/http-examples.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ request:
5151
two: 2
5252

5353
# get only response code
54-
return: .code
54+
expose:
55+
- $_response.code
5556
```
5657
5758
### Request with query string and header
@@ -149,8 +150,9 @@ request:
149150
150151
body[json]: { user_id: 32, roll_no: 1, class: 2, name: 'Student name' }
151152
152-
# get every thing out of response received
153-
return: ~
153+
# get every thing out of response received
154+
# not writing the following statement also does similar behavior
155+
expose: ~
154156
```
155157

156158
### Request with form
@@ -185,8 +187,8 @@ request:
185187
# but will not upload the actual file
186188
photo: file:///home/username/student-photo-01.png
187189
188-
# get only response body; response headers, code, etc will be dropped
189-
return: .body
190+
# get only response body; response headers, code, etc will be dropped
191+
expose: $_response.body
190192
```
191193

192194
### Request with file upload

docs/examples/testcase-examples.md

Lines changed: 93 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,114 @@ Case-wise more example can be found in [https://github.com/chkware/cli](https://
1313

1414
[Testcase specification document reference](/references/testcase-reference)
1515

16-
Testcase is an experimental feature, in _`PRE_ALPHA`_ stage.
16+
### A minimal Testcase with in-file request
1717

18-
### Testcase with in-file request
18+
```yaml
19+
---
20+
version: 'default:testcase:0.7.2'
21+
22+
request:
23+
url: "https://reqres.in/api/users"
24+
method: POST
25+
body[json]: {
26+
'name': My Name,
27+
'job': My Job,
28+
}
29+
30+
spec:
31+
asserts:
32+
- {type: AssertEqual, actual: $_response.code, expected: 201}
33+
- {type: AssertIsMap, actual: $_response.body}
34+
```
35+
36+
The above testcase spec. doc define a request that makes a `POST` call to `https://reqres.in/api/users` URL with a body `{"name": "My Name", "job": "My Job"}`.
37+
38+
After the request server responses with following:
39+
40+
![reqres.in response](../assets/testcase-eximg-01.png)
41+
42+
On the `asserts`, we are asserting that
43+
44+
- The response code is 201, or the resource was created
45+
- The response if a map / dictionary
46+
47+
Assertion [reference with examples](/references/testcase-reference#assertions) can be found here.
48+
49+
### A minimal Testcase with out-file request
50+
51+
A http spec. doc can be written on separate file, that does same as above request. Let's call it `same-request.chk`. The http spec. doc by default exposes `$_response` object.
1952

2053
```yaml
54+
# file: same-request.chk
55+
---
56+
version: 'default:http:0.7.2'
57+
58+
request:
59+
url: "https://reqres.in/api/users"
60+
method: POST
61+
body[json]: {
62+
'name': My Name,
63+
'job': My Job,
64+
}
65+
```
66+
67+
Now we can point out above file to execute before make assertions like below (assuming both file lives on same directory).
68+
69+
```yaml
70+
# file: same-testcase.chk
2171
---
2272
version: 'default:testcase:0.7.2'
2373
74+
spec:
75+
execute:
76+
file: "./same-request.chk"
77+
asserts:
78+
- {type: AssertEqual, actual: $_response.code, expected: 201}
79+
- {type: AssertIsMap, actual: $_response.body}
80+
```
81+
82+
Please notice the `$_response` in the testcase doc. This variable is available after the request gets executed as local variable.
83+
84+
### A Testcase with out-file request passing data
85+
86+
To pass data from a testcase spec. doc to a http spec. doc, we first need to add some variables. These variables can also have some default value. Say in the following case, we defined `name` and `job` variables with default value. So, if no value passed these values will be passed to server as part of request body.
87+
88+
```yaml
89+
# file: same-request.chk
90+
---
91+
version: 'default:http:0.7.2'
92+
2493
variables:
25-
Name: 'Morpheus'
26-
Job: 'leader'
27-
Response: ~
28-
Server: https://reqres.in/api/v1
94+
name: My Name
95+
job: My Job
2996
3097
request:
31-
url: "{$Server}/users"
98+
url: "https://reqres.in/api/users"
3299
method: POST
33100
body[json]: {
34-
'name': $Name,
35-
'job': $Job,
101+
'name': $name,
102+
'job': $job,
36103
}
37-
return: ~
104+
```
105+
106+
Now we can point out which value we want to pass using `with` statement in `execute` block.
107+
108+
```yaml
109+
# file: same-testcase.chk
110+
---
111+
version: 'default:testcase:0.7.2'
38112
39113
spec:
40114
execute:
41-
file: ~
42-
result: $Response
43-
115+
file: "./same-request.chk"
116+
with:
117+
name: Her Name
118+
job: Her Job
44119
asserts:
45-
- {type: AssertEqual, actual: $Response.code, expected: 201}
46-
- {type: AssertIsMap, actual: $Response.body}
120+
- {type: AssertEqual, actual: $_response.code, expected: 201}
121+
- {type: AssertIsMap, actual: $_response.body}
47122
```
48123

49-
Assertion [reference with examples](/references/testcase-reference#assertions) can be found here.
124+
Please notice that if we do not set a `with` then request will be sent with default value.
125+
126+
Assertion [reference with examples](/references/testcase-reference#assertions) can be found here.

docs/home.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,31 @@
22
slug: /
33
title: Home
44
hide_title: true
5-
---
65

7-
![chkware | Test management for api era](./assets/github-readme-01.png)
6+
---
7+
![CHKware | Low-code API quality testing, and automation toolbox](./assets/github-readme-01.png)
88

99
[![PyPI version](https://badge.fury.io/py/chk.svg)](https://badge.fury.io/py/chk)
10-
[![Python 3.8](https://img.shields.io/badge/python-3.10-red.svg)](https://www.python.org/downloads/release/python-3102/)
10+
[![Python 3.11](https://img.shields.io/badge/python-3.11-red.svg)](https://www.python.org/downloads/)
1111
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/chkware.svg?style=social&label=Follow%20%40chkware)](https://twitter.com/chkware)
12-
> Test management for API era.
1312

1413
### Introduction
1514

16-
API tests management is not easy to develop, and maintain. It requires multitude of knowledge of programming libraries, business scenarios, infrastructure details, etc - unless you use ***chkware***.
15+
API quality test, and automation management is not easy to develop, and maintain. It requires multitude of knowledge of programming libraries, business scenarios, infrastructure details, etc - unless you use ***CHKware***.
1716

18-
***chkware*** (pronounced as */check:ware/*) helps you write accurate, robust, and expressive feature tests for your API in less time.
17+
***CHKware*** (pronounced as */tʃek-wer/*, i.e. *check-ware*) is a low-code API quality testing, and automation toolbox. It helps you write accurate, robust, and expressive feature tests for your API in less time than usual.
1918

20-
Read [more value propositions](/introduction) here. Find [changelog](https://github.com/chkware/cli/blob/main/docs/CHANGELOG.md) here.
19+
Read [about the problems](/introduction) *CHKware* addresses. Find [changelog](https://github.com/chkware/cli/blob/main/docs/CHANGELOG.md).
2120

2221
### Setup
2322

24-
With [**Python 3.10**](https://www.python.org/downloads/) and [**Pipx**](https://pypa.github.io/pipx/installation/#install-pipx) preinstalled, run following in your terminal to get ***chkware*** installed.
23+
With [**Python 3.11**](https://www.python.org/downloads/) and [**Pipx**](https://pypa.github.io/pipx/installation/#install-pipx) preinstalled, run following in your terminal to get *CHKware* installed.
2524

2625
```bash
27-
$ pipx install chk
26+
pipx install chk
2827
```
2928

30-
Jump to the [setup guide](/setup) for different ways to install ***chkware***.
29+
Jump to the [setup guide](/setup) for different ways to install ***CHKware***.
3130

3231
### Usage
3332

docs/introduction.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
title: Introduction
33
---
44

5-
![chkware | Test management for api era](./assets/github-hero-01.png)
5+
![CHKware | Low-code API quality testing, and automation toolbox](./assets/github-hero-01.png)
66

7-
**chkware** (pronounced as */check:ware/*) is an API testing tool, a scriptable HTTP client, and a test specification management tool for the API era.
7+
8+
*CHKware* (pronounced as */check:ware/*) is a low-code API testing tool, a script-able HTTP client, and an API test automation tool for the API era.
89

910
It is available as a command-line application. You write test specification files in a [YAML](https://yaml.org/)-based [DSL](https://en.wikipedia.org/wiki/Domain-specific_language). In that specification file you will define some structured configurations to be used for the following purpose:
1011

1112
- Create reusable http request specification. [alpha]
12-
- Create reusable test specifications. [TBD]
13+
- Create reusable test specifications. [alpha]
1314

14-
Afterward, you run those test specification files with **chkware**, and get test results or even reuse them.
15+
Afterward, you run those test specification files with *CHKware*, and get test results or even reuse them.
1516

1617
---
17-
1818
### Motivation
1919

2020
In today's world, API is one of the key fuels that drive business. It is the way web applications consume services from self-hosted or 3rd-party vendors. Recent technology movements are going to a fluid internet direction, where *vendor_A* have one API, *vendor_B* is another API provider, while we are the consumers (e-commerce, fin-tech) of those vendor APIs. We use those APIs to host our contents based on those APIs. Maybe we are *vendor_U* hosting more complex APIs on top of those. So, with the upcoming complexity of integration we need better tooling for API testing. Testing tools for modularize api testing.
@@ -29,13 +29,13 @@ For these reasons, the solutions are less scaling for actual use-cases. With add
2929
2. Added complexity of maintaining supporting software stack, so there are side effects
3030
3. Above all, maintaining test cases based on code is more complex if you don't design your test code architecture well in the early days.
3131

32-
So, clearly enough I think this situation needs to be improved. This is the motivation for **chkware**.
32+
So, clearly enough I think this situation needs to be improved. This is the motivation for *CHKware*.
3333

3434
---
3535

3636
### Audiences
3737

38-
The focused users of **chkware** are everyone involved in an API project, given they have some testing basics.
38+
The focused users of **CHKware** are everyone involved in an API project, given they have some testing basics.
3939

4040
- People with zero programming knowledge need a tool that does not get in their way.
4141
- We need a tool that is relatively easy to write specifications, expressive, and customizable to the very core.
@@ -44,7 +44,7 @@ The focused users of **chkware** are everyone involved in an API project, given
4444
In practical cases, software testers / QAs, developers, PM/POs, are the people who should be able to use it rigorously.
4545

4646
- This project is particularly helpful if you are developing an API oriented project.
47-
- Test websites or web interfaces are not in the project focus for now.
47+
- Writing specification to test websites, or web interfaces are not in the project focus for now.
4848
- Also, seeding data, validating data in DB is out of this project scope for now.
4949

5050
---
@@ -59,9 +59,9 @@ There is no native binary dependency, therefore it is expected on all the platfo
5959

6060
### Stability
6161

62-
`chkware` is a tool collection. Followings are stability by tools:
62+
`CHKware` is a tool collection. Followings are stability by tools:
6363

6464
Command name | Specification document | Stability
6565
---|---|---
66-
`http`| Http | _`Alpha`_
67-
`testcase`| Testcase | _`Pre-Alpha`_
66+
`http`| Http | _alpha_
67+
`testcase`| Testcase | _alpha_

0 commit comments

Comments
 (0)