Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add basic home site and a home page #86

Merged
merged 8 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ module.exports = {
plugins: ["react"],
rules: {
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
},
};
3 changes: 2 additions & 1 deletion docs/examples/http-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ title: Http examples

- This page should be use as reference for specification files.
- This page is subject to change. It is requested to check this page frequently.

:::

:::note
Case-wise more example can be found in [https://github.com/chkware/cli](https://github.com/chkware/cli/tree/main/tests/resources/storage/sample_config) repository
:::

[Http specification document reference](/references/http-reference)
[Http specification document reference](/docs/references/http-reference)

Following examples are using HTTP _GET_ and _POST_ method. Although all these example are still valid for _POST_, _PUT_, _PATCH_, _DELETE_, _OPTIONS_, _HEAD_ method as well. You can still send a request body with _GET_ or _HEAD_ method for the sake of testing API.

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/testcase-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Case-wise more example can be found in [https://github.com/chkware/cli](https://

:::

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

### A minimal Testcase with in-file request

Expand Down Expand Up @@ -45,7 +45,7 @@ On the `asserts`, we are asserting that
- The response code is 201, or the resource was created
- The response if a map / dictionary

Assertion [reference with examples](/references/testcase-reference#assertions) can be found here.
Assertion [reference with examples](/docs/references/testcase-reference#assertions) can be found here.

### A minimal Testcase with out-file request

Expand Down Expand Up @@ -118,4 +118,4 @@ spec:

Please notice that if we do not set a `with` then request will be sent with default value.

Assertion [reference with examples](/references/testcase-reference#assertions) can be found here.
Assertion [reference with examples](/docs/references/testcase-reference#assertions) can be found here.
2 changes: 1 addition & 1 deletion docs/examples/variable-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Case-wise more example can be found in [https://github.com/chkware/cli](https://

:::

[Variable specification document reference](/references/variable-reference)
[Variable specification document reference](/docs/references/variable-reference)

We can also use variables inside a http and testcase specification file. See examples below.

Expand Down
6 changes: 3 additions & 3 deletions docs/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ API quality test, and automation management is not easy to develop, and maintain

**_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.

Read [about the problems](/introduction) _CHKware_ addresses. Find [changelog](https://github.com/chkware/cli/blob/main/docs/CHANGELOG.md).
Read [about the problems](/docs/introduction) _CHKware_ addresses. Find [changelog](https://github.com/chkware/cli/blob/main/docs/CHANGELOG.md).

### Setup

Expand All @@ -26,11 +26,11 @@ With [**Python 3.11**](https://www.python.org/downloads/) and [**Pipx**](https:/
pipx install chk
```

Jump to the [setup guide](/setup) for different ways to install **_CHKware_**.
Jump to the [setup guide](/docs/setup) for different ways to install **_CHKware_**.

### Usage

[Get started](/quick-start) quickly here.
[Get started](/docs/quick-start) quickly here.

### Ask anything

Expand Down
8 changes: 4 additions & 4 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: Quick Start

:::note

- **Prerequisite**: First, [setup **CHKware**](/setup) to continue
- Find [More `http` examples](/examples/http-examples) here
- **Prerequisite**: First, [setup **CHKware**](/docs/setup) to continue
- Find [More `http` examples](/docs/examples/http-examples) here

:::

Expand Down Expand Up @@ -56,13 +56,13 @@ Let's call an API that returns current bitcoin price in USD, and test it. Please

### Explanation

We call this `bitcoin-usd-testcase.chk` a spec or specification file. The content that you put was a [testcase specification](/references/testcase-reference).
We call this `bitcoin-usd-testcase.chk` a spec or specification file. The content that you put was a [testcase specification](/docs/references/testcase-reference).

Let us look into the content and see what we wrote.

On 1st line we wrote document version with `version:` same as we do on other config files i.e. terraform, ansible, etc. This is not all too important now.

On 2nd line, we wrote a `request:` block, which define how to sent the request to server. More on this block on [http specification](/references/http-reference).
On 2nd line, we wrote a `request:` block, which define how to sent the request to server. More on this block on [http specification](/docs/references/http-reference).

Then we wrote a `asserts:` sub-section under `spec:` block which defines how to check the response those we received.

Expand Down
2 changes: 1 addition & 1 deletion docs/references/assertion-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Assertion reference

:::

Assertions are integral part of [Testcase spec.](/references/testcase-reference) Following are the assertion keys supported in most latest version of Testcase spec.
Assertions are integral part of [Testcase spec.](/docs/references/testcase-reference) Following are the assertion keys supported in most latest version of Testcase spec.

Assertions are used to validate data in testcase specification after http request execution has successfully returned the response.

Expand Down
4 changes: 2 additions & 2 deletions docs/references/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There are two parts to **`CHKware`** tool.

This sub command runs a file written in [http specification file](http-reference) format.

After you execute this command `chk` should make request by given request format, and display the response. You can also customize the response with `expose` key. see [usage](/examples/http-examples#request-with-form) and [documentation](/references/http-reference).
After you execute this command `chk` should make request by given request format, and display the response. You can also customize the response with `expose` key. see [usage](/docs/examples/http-examples#request-with-form) and [documentation](/docs/references/http-reference).

#### Options

Expand All @@ -33,7 +33,7 @@ There are two parts to **`CHKware`** tool.

This sub command runs a file written in [testcase specification file](testcase-reference) format.

After you execute this command `chk` should re-use `http` utility to request as per given structure on the file, execute test assertions, and display the result of the assertions. See [example](/examples/testcase-examples).
After you execute this command `chk` should re-use `http` utility to request as per given structure on the file, execute test assertions, and display the result of the assertions. See [example](/docs/examples/testcase-examples).

#### Options

Expand Down
10 changes: 5 additions & 5 deletions docs/references/http-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The **Http specification format** is how anyone express a Http request. Followin

Http specification document is a _**versioned document**_, meaning there MUST be a `version:` key on the document.

It's also an _**exposable document**_ meaning you can expose local data using `expose:` key in the document. More on this in [variable spec. reference](/references/variable-reference)
It's also an _**exposable document**_ meaning you can expose local data using `expose:` key in the document. More on this in [variable spec. reference](/docs/references/variable-reference)

### All supported nodes in http specification document

Expand Down Expand Up @@ -120,13 +120,13 @@ expose:

### `version` (<small>_`required`_</small>)

`version` is a top-level block that defines a document version. How to write a `version:` block is already defined in [_version reference_](/references/version-reference).
`version` is a top-level block that defines a document version. How to write a `version:` block is already defined in [_version reference_](/docs/references/version-reference).

### `variables`

`variables` is a top-level block that defines local variables. These variables are file scoped. How to write a `variables:` block is already defined in [_variable-reference_](/references/variable-reference).
`variables` is a top-level block that defines local variables. These variables are file scoped. How to write a `variables:` block is already defined in [_variable-reference_](/docs/references/variable-reference).

One special local variable named `_response` get added after the response received successfully. This local variable is accessible under [_exposable block_](/references/variable-reference#exposable).
One special local variable named `_response` get added after the response received successfully. This local variable is accessible under [_exposable block_](/docs/references/variable-reference#exposable).

### `request` (<small>_`required`_</small>)

Expand Down Expand Up @@ -304,4 +304,4 @@ request:

For http specification document local variable called `_response` which holds successful response, is available.

See docs on [expose node](/references/variable-reference#expose-node)
See docs on [expose node](/docs/references/variable-reference#expose-node)
14 changes: 7 additions & 7 deletions docs/references/testcase-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The _Testcase specification_ format is how anyone express one or more test case(

Testcase specification document is a versioned document, meaning there MUST be a `version:` key on the document.

It's also an _**exposable document**_ meaning you can expose local data using `expose:` key in the document. More on this in [variable spec. reference](/references/variable-reference)
It's also an _**exposable document**_ meaning you can expose local data using `expose:` key in the document. More on this in [variable spec. reference](/docs/references/variable-reference)

### Reference as example

Expand Down Expand Up @@ -60,7 +60,7 @@ expose:
- "{$_response}"
```

#### 2. `request` in separate http spec. doc.
#### 2. `request` in separate http spec. doc

```yaml
# file: some-request.chk
Expand Down Expand Up @@ -103,20 +103,20 @@ expose: ~

### `version` (<small>_`required`_</small>)

`version` is a top-level block that defines a document version. How to write a `version:` block, is [already defined here](/references/version-reference).
`version` is a top-level block that defines a document version. How to write a `version:` block, is [already defined here](/docs/references/version-reference).

### `request`

- _`required`_ if no external http spec. doc to be linked
- _`must not`_ if `spec.execute.file` if a http specification doc is linked

`request` is a top-level block that defines a http request. How to write a `request:` block, is [already defined here](/references/http-reference#request-required).
`request` is a top-level block that defines a http request. How to write a `request:` block, is [already defined here](/docs/references/http-reference#request-required).

`request` block, and `spec.execute.file` MUST NOT stay on same file. System will throw an error on that case.

### `variables`

`variables` is a top-level block that defines local variables. These variables are file scoped. How to write a `variables:` block, is [already defined here](/references/variable-reference).
`variables` is a top-level block that defines local variables. These variables are file scoped. How to write a `variables:` block, is [already defined here](/docs/references/variable-reference).

### `spec` (<small>_`required`_</small>)

Expand Down Expand Up @@ -169,12 +169,12 @@ spec:
actual: "{$Response}"
```

[More about assertions](/references/assertion-reference) can be found here.
[More about assertions](/docs/references/assertion-reference) can be found here.

### `expose`

`expose` is a sub-block, that can be used to expose local variable of this file to outer scope.

For testcase specification document local variable called `_assertion_results` which holds after assertion output, and `_response` which holds response after request execute, are available.

See docs on [expose node](/references/variable-reference#expose-node)
See docs on [expose node](/docs/references/variable-reference#expose-node)
4 changes: 2 additions & 2 deletions docs/references/variable-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ expose: ["{$_assertion_results.2.name_run}", "{$_assertion_results.2.is_success}

### Supported specification document

- [Http specification document examples](/examples/http-examples#variable-examples) | [More example](https://github.com/chkware/cli/tree/main/tests/resources/storage/sample_config/pass_cases/variables)
- [Testcase specification document examples](/examples/testcase-examples) | [More example](https://github.com/chkware/cli/tree/main/tests/resources/storage/sample_config/pass_cases/testcases)
- [Http specification document examples](/docs/examples/http-examples#variable-examples) | [More example](https://github.com/chkware/cli/tree/main/tests/resources/storage/sample_config/pass_cases/variables)
- [Testcase specification document examples](/docs/examples/testcase-examples) | [More example](https://github.com/chkware/cli/tree/main/tests/resources/storage/sample_config/pass_cases/testcases)
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ pipx upgrade chk

Otherwise, if _pip_ was used to install then same process given above should work for upgrade as well.

Alternatively, chkware tool can be build and use as a zipapp, [following this instruction](/setup/build-zipapp).
Alternatively, chkware tool can be build and use as a zipapp, [following this instruction](/docs/setup/build-zipapp).
4 changes: 2 additions & 2 deletions docs/setup/setup-ext.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ title: Setup VS Code extension

Get started writing _CHKware_ configurations with VS Code doing following steps:

- Step 1: Install [chkware](/setup), if you haven't done so already.
- Step 1: Install [chkware](/docs/setup), if you haven't done so already.

- Step 2: Install the [_CHKware_ extension](https://marketplace.visualstudio.com/items?itemName=chkware.chkware) for VS Code

- Step 3: New to _CHKware_? Read the _CHKware_ [quick start](/quick-start) guide here.
- Step 3: New to _CHKware_? Read the _CHKware_ [quick start](/docs/quick-start) guide here.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/automate-chucknorris-jokes.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The process we are going to follow:

The above `variables:` sections defines a variable called **`category`** with default value **"food"**. Then we use **`category`** variable's value in the URL with **`{$category}`**. So, if we don't pass any value to this file, then **"food"** will be used as default value. You will see below how you can pass value to this **`category`** variable from command-line.

More docs on [passing query params](/examples/http-examples#request-with-query-string) here
More docs on [passing query params](/docs/examples/http-examples#request-with-query-string) here

Now the `joke_for_category_rq.chk` file should look like:

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/bitcoin-api-parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Bitcoin API parser

:::note

- **Prerequisite**: First, [setup **CHKware**](/setup) to continue
- **Prerequisite**: First, [setup **CHKware**](/docs/setup) to continue
- **Prerequisite**: Then, setup vscode extension for _CHKware_
- Find [more `http` examples](/examples/http-examples), and [more `testcase` examples](/examples/testcase-examples) here.
- Find [more `http` examples](/docs/examples/http-examples), and [more `testcase` examples](/docs/examples/testcase-examples) here.

:::

Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/feature-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ title: Write feature test for API

:::note

- **Prerequisite**: First, [setup **CHKware**](/setup) to continue
- Find [more `testcase` examples](/examples/testcase-examples) here
- **Prerequisite**: First, [setup **CHKware**](/docs/setup) to continue
- Find [more `testcase` examples](/docs/examples/testcase-examples) here

:::

Let's continue to test our [_XKCD.com JSON API http client_](/tutorials/http-client) that we covered earlier. Please do as follows:
Let's continue to test our [_XKCD.com JSON API http client_](/docs//tutorials/http-client) that we covered earlier. Please do as follows:

- Create a file called `xkcd-joke-test.chk` on the same directory where your created `xkcd-joke.chk` early.
- Open `xkcd-joke-test.chk` file, and add following spec.

As you can see, it's possible to combine both `http` request and `testcase` spec on same file. See [Testcase example](/examples/testcase-examples) for other asserts you can write.
As you can see, it's possible to combine both `http` request and `testcase` spec on same file. See [Testcase example](/docs/examples/testcase-examples) for other asserts you can write.

```yaml
---
Expand All @@ -30,7 +30,7 @@ Let's continue to test our [_XKCD.com JSON API http client_](/tutorials/http-cli
- { type: AssertEqual, actual: "{$_response.body.year}", expected: 2009 }
```

Here notice the `verison` string **`version: default:testcase:0.7.2`**, this is important for this specification to be a [testcase specification](/references/testcase-reference).
Here notice the `verison` string **`version: default:testcase:0.7.2`**, this is important for this specification to be a [testcase specification](/docs/references/testcase-reference).

- Open a terminal. Hit enter after writing following command on terminal.

Expand Down Expand Up @@ -93,6 +93,6 @@ Let's continue to test our [_XKCD.com JSON API http client_](/tutorials/http-cli

---

This way you can write API feature test. More [testcase examples](/examples/testcase-examples) here.
This way you can write API feature test. More [testcase examples](/docs/examples/testcase-examples) here.

:wink::tada::confetti_ball:
10 changes: 5 additions & 5 deletions docs/tutorials/http-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ title: Use as HTTP client

:::note

- **Prerequisite**: First, [setup **CHKware**](/setup) to continue
- Find [more `http` examples](/examples/http-examples) here
- **Prerequisite**: First, [setup **CHKware**](/docs/setup) to continue
- Find [more `http` examples](/docs/examples/http-examples) here

:::

Let's call the [_XKCD.com JSON API_](https://xkcd.com/json.html) that returns a joke for given ID. Please do as follows:

- Create a file called `xkcd-joke.chk` in any of your workspace
- Open `xkcd-joke.chk` file, and add following spec. That is all you need to do a minimal HTTP GET request. See [Http example](/examples/http-examples) for other methods and types you can send with the requests.
- Open `xkcd-joke.chk` file, and add following spec. That is all you need to do a minimal HTTP GET request. See [Http example](/docs/examples/http-examples) for other methods and types you can send with the requests.

```yaml
---
Expand All @@ -22,7 +22,7 @@ Let's call the [_XKCD.com JSON API_](https://xkcd.com/json.html) that returns a
method: GET
```

Here notice the `verison` string **`version: default:http:0.7.2`**, this is important for this specification to be a [http specification](/references/http-reference).
Here notice the `verison` string **`version: default:http:0.7.2`**, this is important for this specification to be a [http specification](/docs/references/http-reference).

- Open a terminal. Hit enter after writing following command on terminal.

Expand Down Expand Up @@ -114,6 +114,6 @@ Let's call the [_XKCD.com JSON API_](https://xkcd.com/json.html) that returns a

This way you can use `chk http` as your script-able http client.

Next, let's write a feature test or [testcase](/tutorials/feature-test) for this request.
Next, let's write a feature test or [testcase](/docs//tutorials/feature-test) for this request.

:wink::tada::confetti_ball:
13 changes: 9 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const TwitterSvg =
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "CHKware",
tagline: "Low-code API quality testing, and automation toolbox",
url: "https://docs.chkware.com",
tagline: "Low-code API quality testing, and automation toolbox.",
url: "https://www.chkware.com",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
Expand All @@ -27,9 +27,7 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
breadcrumbs: false,
editUrl: "https://github.com/chkware/chkware.github.io/tree/main",
},
blog: false,
Expand Down Expand Up @@ -151,6 +149,13 @@ const config = {
},
],
],
customFields: {
indexCta: "docs/quick-start",
indexCtaTitle: "⏱️ 30 seconds to start",
shortDetails: "Low-code API quality testing, and automation toolbox.",
longDetails:
"API testing tool, a script-able HTTP client, and an API test automation tool for the API era.",
},
};

module.exports = config;
Loading
Loading