0.2.1 • Published 2 years ago

rest-api-testing-codegen v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Rest Api Testing Codege

Since I operated the browser, only the API is recorded and the code is generated.

Installation

npm install -D rest-api-testing-codegen

Usage

  1. generate test code
npx rest-api-testing-codegen --baseURL=https://google.co.jp --headers=cookie
  1. install @playwright/test for test code
npm i -D @playwright/test
  1. run test code
npx playwright test sample.spec.ts

Options

full nameshot namecommand lineconfig filedescdefaults
baseURLuYYOpens a browser at the specified URL
indentiYYIndent the output code2 spaces
outputoYYFile name of the output codesample.spec.ts
formatfYYFormat of output codeplaywright
headershYYPrints the code only if the specified header is present.
ignoreheadersYYSpecifies headers to exclude from validationreferer,content-type,content-length
skipheadersYYSkips the header output.false
expectNYSpecify the verification format of the response data.
configcYNSpecify the configuration file.rest-api-testing-codegen.config.js
resourceTypeYYSpecifies the resource type to validate. ex) all, document, stylesheet, image, media, font, script, texttrack, xhr, fetch, eventsource, websocket, manifest, otherxhr
skipexpectjsonYYSkips generate expect of json.false

Setting Config

  • rest-api-testing-codegen.config.js
const config = {
    baseURL:"https://google.co.jp/",
    output:"hoge.spec.ts",
    headers:["cookie"]
};
module.exports = config;
0.2.1

2 years ago

0.2.0

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago