github rangav/thunder-client-support v2.14.0

latest releases: v2.15.0, v2.14.1
6 months ago

New Features

  • Inline Scripting support #1026
  • Col & Request level env variables using scripting #823
  • CLI - Single report for test run with multiple collections #1221
  • chai expect, assert, and atob, btoa global variables added in scripting.
  • Update CLI to version v1.8.0

Bug Fixes

  • Cannot view/edit long environment variable values #1378
  • CLI - Pipeline job success if no collection is running #1376

Inline Scripting

  • We are introducing an inline scripting feature. Now you can use scripting for advanced use cases right inside Thunder Client views.
inline-scripting

Collection and Request Variables

  • Now you can use collection and request variables with request scope from the scripting
collection-variables

Global Variables

  • We added new global variables useful in scripting
  • Chai expect and assert functions are now global variables
  • atob and btoa are global variables useful for base64 encoding and decoding

OLD way to use chai library

const chai = require("chai");
var expect = chai.expect;
var assert = chai.assert;

 tc.test("Chai - Response code expect to be 200", function () {
        expect(tc.response.status).to.equal(200);
 })

NEW way of using global variables

 tc.test("Chai - Response code expect to be 200", function () {
        expect(tc.response.status).to.equal(200);
 })

New API for Cookies in v2.14.1

  • We are adding a new API to manage cookies from scripting

Get Cookies

// get all cookies in store
var list = await tc.getCookies();

// get all cookies for current url
var listDomain = await tc.getCookies("url");
var listDomain = await tc.getCookies(tc.request.url);

Clear Cookies

// clear all cookies in store
await tc.clearCookies();

// clear all cookies for current domain
await tc.clearCookies("url");
await tc.clearCookies(tc.request.url);

// clear single cookie by name of cookie
await tc.clearCookies(tc.request.url, "cookieName");

Set Cookie

// set cookie for current url
await tc.setCookie("https://www.thunderclient.com", "cookieName", "cookieValue");
await tc.setCookie(tc.request.url, "cookieName", "cookieValue");

Planning to Deprecate/Retire Features

Attach Env to Collection

  • How many users are using this feature? Now we have collection and request level variables using scripting, is the Attach Env to collection still useful?
  • Please let us know your feedback here
Screenshot 2023-10-19 at 19 37 38

External Script Files

  • Now we introduced Inline Scripting, do you still need external script files feature?
  • Please let us know your feedback here

Don't miss a new thunder-client-support release

NewReleases is sending notifications on new releases.