New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rest-api-testing-codegen

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-api-testing-codegen

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

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

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;

Keywords

FAQs

Package last updated on 20 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc