0.0.1 • Published 4 years ago

@restqa/restqadata v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

RestQData

One the key challenge of test automation are the data, RestQData is a simple library to support your test automation by connecting to a specific data sheets and serve it to you as a JSON object


Features

  • Serve data from Google Sheet
  • Serve data from Confluence
  • Serve data from local csv file
  • NodeJs version
  • Server version

Usage

The Libary way

Setup

Install the library into your project:

npm i -S @restqa/restqdata

Example

const RestQData = require('@restqa/restqdata')

let options = {
  channel: 'google-sheet',
  config: {
    id: 'your-google-sheet-id',
    apikey: 'your-service-account-api-key'
  }
}

const data = RestQData(options)
data.get('users', 3) // get the sheet named "users" and get the row number 3
  .then(response => {
    console.log(response)
    /*
    output:
      {
        firstname: "john",
        lastname: "doe",
        column: "value",
        ...
      }
    */
  })
  .catch(err => {
    console.log(err)
  })

Options

  • channel (required) should be on the the following value : google-sheet, confluence, csv
Google sheets
Confluence
  • config.url (required) The url of your confluence server
  • config.space_key (required) The space identifier where the dataset page is located
  • config.auth.username (required) The authentication username
  • config.auth.password (required) The authentication password
  • config.prefix_title (optional) The prefix of your resource page , default: Dataset (example: to get the resource "user", the script will search for a page called "Dataset users")

The Server way

@todo


License

You can check out the full license here

This project is licensed under the terms of the MIT license.