Code Monkey home page Code Monkey logo

apic-cli's Introduction

apic-cli

The command line utility to run you APIs tests with apic. apic-cli allows you to test your Test Suits created with apic from a command line or with a node js app.

How to use apic-cli

For running tests

In terminal

if you want to use apic from the command line run

npm install apic-cli -g

Once installed you can run apic-cli -h to view all available commands.

Command:

apic run|r <suit> [options] Run apic Test Suit or an entire Test Project

Options

-e, --environment <path> : Specify a URL or Path to an apic environment file.

-r, --reporters <reporters> : Comma separated list of reporters to use (without any space)

-d , --responseData : if specified, response data will be logged in the cli reporter

-h, --help : output usage information

Example: apic run ".\example\ToDo demo.suit.apic" -e ".\example\APIC Todo demo-env.env.apic" -r cli,junit -d

With node js

If you want to use it with a node js application add it to your project by running

npm install apic-cli --save

Next add below code to your script file.

const apicCli = require('../lib');

apicCli.run('.\\example\\ToDo demo.suit.apic', {
    environment: '.\\example\\APIC Todo demo-env.env.apic',
    reporters: 'cli,junit',
    responseData: true
});

Look in the examples folder for a sample node js app to run your Test Suit with apic.

Starting the Web Agent

If you are using the web version of APIC, like every web application making web requests to other domains will be limited by CORS. You can get around thsi by using APIC's Web Agent which runs a local agent on your machine. This agent is used for forwarding all https calls. This allows the Web version of APIC to send the requets to the agent and read response from it via Web Sockets bypassing the CORS limitation.

To Learn more about the APIC Web Agent visit https://docs.apic.app/apic-web-agent-apic-cli

Command:

apic agent [options] Start the APIC Web Agent

Options

-p, --port <port numver> : 'Specify the port to start thge agent. Default:8008'

Once the agent is up and running you can connect to it from the Web application and forward all your requests.

What is "apic"

APIC provides a complete end to end solution for APIs; staring from design to documentation to testing. With a simplistic UI for Designing APIs and a feature rich platform for testing them, APIC provides a common platform for your API architects, developers and testers. APIC also comes with an API simulator so your Front-end team can work in parallel to your Back-end team.

Here are some awesome features of apic

Learn more about apic at www.apic.app

apic-cli's People

Contributors

apic-apps avatar bjdash avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

bonomali lanvater

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.