Skip to main content

Quickstart

Pre requisite

In order to run you will to have :

  • NodeJs installed
  • Npm or Yarn installed

Install with npm

To install RestQA globally run the command:

npm install @restqa/restqa -g

Initialize your first project

In order to initialize your first project run the command:

restqa init -y

The -y option will create the project using the default values.

restqa init

And Voila! Your first test has been setup using the RestQA demo environment.

A typical RestQA project will have the following source file structure:

- .restqa.yml            # RestQA configuration file
- test/
  - integrations/
    - welcome.feature    # Sample test scenario

You can look at your folder and you will see the RestQA configuration file .restqa.yml.

version: 0.0.1
metadata:
  code: APP
  name: app
  description: Configuration generated by restqa init
environments:
  - name: local
    default: true
    plugins:
      - name: restqapi
        config:
          url: https://api.restqa.io
    outputs:
      - type: html
        enabled: true
      - type: file
        enabled: true
        config:
          path: restqa-result.json

And your first sample test scenario was created on the file: ./tests/integration/welcome-restqa.feature

Feature: Welcome to the RestQA community

Scenario: Get the list of useful RestQA resources
Given I have the api gateway hosted on "https://restqa.io"
  And I have the path "/welcome.json"
  And I have the method "GET"
When I run the API
Then I should receive a response with the status 200
  And the response body should be equal to:
  """
{
  "documentation": {
    "description": "Access to the official documentation",
    "href": "https://docs.restqa.io"
  },
  "examples": {
    "description": "A series of RestQA implementation examples",
    "href": "https://github.com/restqa/restqa-example"
  },
  "message": "Thank you for installing RestQa, Let's continue our Test Automation together",
  "promotion": {
    "github": {
      "action": "Give us a a star",
      "href": "https://github.com/restqa/restqa"
    },
    "linkedin": {
      "action": "Follow us",
      "href": "https://linkedin.com/company/restqa"
    },
    "medium": {
      "action": "Follow us",
      "href": "https://medium.com/restqa"
    },
    "twitter": {
      "action": "Follow us",
      "href": "https://twitter.com/restqa"
    },
    "youtube": {
      "action": "Subscribe to the channel",
      "href": "https://www.youtube.com/channel/UCdT6QenNLmnxNT-aT8nYq_Q"
    }
  },
  "sources": {
    "description": "RestQa is Open Source, feel free to contribute",
    "href": "https://github.com/restqa"
  },
  "support": {
    "description": "Please ask and answer questions here.",
    "href": "https://discord.gg/q8pKfsyq67"
  }
}
  """

Run the Sample test scenario.

From now you can run the test scenario using the command

restqa run

And Voila your first test scenario has been executed and passed!

You can see the result into the ./report folder.

Access to the RestQA Dashboard

If you are looking for a user friendly interface, take a look at the restqa dashboard, by using the command:

restqa dashboard

Example:

screenshot dashboard

More information on this feature