-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from calloc134/docs/20230907-docs
Docs/20230907 docs
- Loading branch information
Showing
35 changed files
with
79,931 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Sample workflow for building and deploying a Docusaurus site to GitHub Pages | ||
name: Deploy Docusaurus with GitHub Pages dependencies preinstalled | ||
|
||
on: | ||
# masterブランチへのpushに対応する | ||
push: | ||
branches: ["master"] | ||
# プルリクエストでのCIに対応する | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
# 手動での実行に対応する | ||
workflow_dispatch: | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
|
||
# 実行ステップ | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: pnpm/action-setup@v2.2.4 | ||
with: | ||
version: 8.6.3 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "pnpm" | ||
cache-dependency-path: "docs/pnpm-lock.yaml" | ||
|
||
# 依存関係のインストール | ||
- name: install dependencies | ||
run: pnpm install --frozen-lockfile | ||
working-directory: docs | ||
|
||
- name: Build | ||
run: | | ||
pnpm run build | ||
working-directory: docs | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: docs/build | ||
|
||
# Deployment job | ||
deploy: | ||
# masterブランチのときのみ実行する | ||
if : github.ref == 'refs/heads/master' | ||
# 必要な権限を付与する | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
/target | ||
memo.txt | ||
swagger* | ||
out* | ||
println* | ||
result* | ||
src/仕様.txt | ||
メモ.txt | ||
result* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Installation | ||
|
||
You can install Raxtest using `cargo`: | ||
|
||
```sh | ||
cargo install --git https://github.com/calloc134/raxtest.git | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Overview | ||
|
||
Raxtest is an asynchronous api testing tool for RESTful APIs. | ||
It is designed to be simple but powerful. | ||
|
||
- Support for init steps such as login | ||
- Asynchronous api testing | ||
- JSON Data import and export | ||
- Generate test cases from openapi documents | ||
|
||
## Acnowledgements | ||
|
||
Raxtest relies on the following open source projects: | ||
|
||
- [Rust](https://www.rust-lang.org/) | ||
- [tokio](https://github.com/tokio-rs/tokio) | ||
- [reqwest](https://github.com/seanmonstar/reqwest) | ||
- [serde](https://github.com/serde-rs/serde) | ||
- [anyhow](https://github.com/dtolnay/anyhow) | ||
|
||
Also, the following open source projects are used in openapi2raxtest: | ||
|
||
- [Go](https://golang.org/) | ||
- [kin-openapi](https://github.com/getkin/kin-openapi) | ||
- [go-yaml](https://gopkg.in/yaml.v2) | ||
|
||
|
||
Thanks to the authors of these projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Quick Start | ||
|
||
## Create a config file | ||
Here is a complete example of a raxtest config file. | ||
|
||
### config file (yaml) | ||
```yaml | ||
base_url: http://localhost | ||
data: json://data.json | ||
init: | ||
- name: ApiAuthLogin(POST) | ||
path: /api/auth/login | ||
method: POST | ||
ref_data: ApiAuthLogin(POST) | ||
option: | ||
query: false | ||
body: true | ||
|
||
categories: | ||
no_loginStep: | ||
- name: ApiUserMe(GET) | ||
path: /api/user/me | ||
method: GET | ||
ref_data: no_login/ApiUserMe(GET) | ||
option: | ||
query: false | ||
body: false | ||
|
||
loginStep: | ||
login: ApiAuthLogin(POST) | ||
- name: ApiUserMe(PUT) | ||
path: /api/user/me | ||
method: PUT | ||
ref_data: ApiAuthLogin(POST)/ApiUserMe(PUT) | ||
option: | ||
query: false | ||
body: true | ||
- name: ApiUserMe(DELETE) | ||
path: /api/user/me | ||
method: DELETE | ||
ref_data: ApiAuthLogin(POST)/ApiUserMe(DELETE) | ||
option: | ||
query: false | ||
body: false | ||
- name: ApiProfileScreenName_GET | ||
path: /api/profile/@{screenName} | ||
method: GET | ||
ref_data: ApiAuthLogin(POST)/ApiUserMe(DELETE) | ||
option: | ||
query: true | ||
body: false | ||
``` | ||
|
||
### data file (json) | ||
|
||
```json | ||
{ | ||
"ApiAuthLogin(POST)": [ | ||
{ | ||
"body": { | ||
"handle": "johndoe2", | ||
"password": "Password123@" | ||
}, | ||
"expect_status": 0 | ||
} | ||
], | ||
"ApiAuthLogin(POST)/ApiUserMe(GET)": [ | ||
{ | ||
"expect_status": 200 | ||
} | ||
], | ||
"ApiAuthLogin(POST)/ApiUserMe(PUT)": [ | ||
{ | ||
"body": { | ||
"bio": "john doe bio", | ||
}, | ||
"expect_status": 200 | ||
}, | ||
{ | ||
"body": { | ||
"screen_name": "jondoe@@2" | ||
}, | ||
"expect_status": 200 | ||
}, | ||
{ | ||
"body": { | ||
"hidden_comment": "john doe hidden comment" | ||
}, | ||
"expect_status": 400 | ||
}, | ||
(...) | ||
], | ||
} | ||
``` | ||
|
||
## Run raxtest | ||
```sh | ||
raxtest -i (config file path) -d (data file path) | ||
``` | ||
|
||
## Output | ||
```json | ||
{ | ||
"base_url": "http://localhost", | ||
"results": [ | ||
{ | ||
"name": "no_login/ApiUserMe(DELETE)[0]", | ||
"category": "no_login", | ||
"status": "success", | ||
"duration": 0.0126284, | ||
"message": "success (status: 401 Unauthorized, expect status: 401)" | ||
}, | ||
{ | ||
"name": "no_login/ApiUserMe(GET)[0]", | ||
"category": "no_login", | ||
"status": "success", | ||
"duration": 0.0099064, | ||
"message": "success (status: 401 Unauthorized, expect status: 401)" | ||
}, | ||
{ | ||
"name": "no_login/ApiUserMe(PUT)[0]", | ||
"category": "no_login", | ||
"status": "success", | ||
"duration": 0.007595, | ||
"message": "success (status: 401 Unauthorized, expect status: 401)" | ||
}, | ||
... | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "Tutorial", | ||
"position": 4, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "Raxtest Tutorial for beginners" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Congratulations! | ||
|
||
You have just learned the **basics of Docusaurus** and made some changes to the **initial template**. | ||
|
||
Docusaurus has **much more to offer**! | ||
|
||
Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610) | ||
|
||
## What's next? | ||
|
||
- Read the [official documentation](https://docusaurus.io/) | ||
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config) | ||
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration) | ||
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout) | ||
- Add a [search bar](https://docusaurus.io/docs/search) | ||
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase) | ||
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support) |
Oops, something went wrong.