0.3.1 • Published 7 years ago

runscope-api-wrapper v0.3.1

Weekly downloads
3
License
UNLICENSED
Repository
github
Last release
7 years ago

runscope-api-wrapper

Currently this is a wrapper based on their api, not sdk for runscope.

Getting Test Results in a bucket

The goal is to provide a way to look up all your tests within a bucket and determine the status of the last two results. There are lots of methods to help but the most advantagous one is doing the following:

Example 1: by using the bucket id supplied it returns the results of all tests that have a schedule.

const apiMonitor = new ApiMonitorService();
apiMonitor.getMostRecentResultsOfAllTestsInBucket(token, bucketId)
  .then(results => {
    // do something with the results array
  });
  

Example 2: Grabs the first bucket that matches by the bucket name supplied, then it calls the method from Example 1.

const apiMonitor = new ApiMonitorService();
apiMonitor.getTimeFrameOfTestsInBucketByName(token, bucketName)
  .then(results => {
     // do something with the results array
  });
  

Triggers

You can now do triggers! The basic flow is as follows:

  1. Get your tests in the bucket via ApiMonitorService
  2. From the collection supply the TestInfo to ApiMonitorService's trigger method of your choice:

    const apiMonitor = new ApiMonitorService(); apiMonitor.getBuckets(token).then(bucketCollection => { // I have buckets! apiMonitor.getBucketTestsLists(token, bucketCollection0.id).then(testInformationCollection => { //Now we have tests too! //env can also be grabbed too! In this case we make it null and tell it to use the default environment const env = null apiMonitor.triggerByTestInformation(token, testInformationCollection0, env).then(runCollection => { // do something with the results array });
    }); });

For more examples please check out the tests withing the source code over at https://github.com/MaterialDev/runscope-api-wrapper.

0.3.1

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.8

8 years ago