Socket
Socket
Sign inDemoInstall

insomnia-plugin-load-test-timing

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

54

load-test-timing.js

@@ -1,6 +0,1 @@

const {
remote: { BrowserWindow, getCurrentWindow },
} = require("electron");
const ProgressBar = require("electron-progressbar");
const css = `

@@ -41,26 +36,5 @@ header { padding-bottom: 20px; text-align: center; }

const createProgressBar = (maxValue) =>
new ProgressBar({
text: "Preparing data...",
detail: "Please Wait...",
indeterminate: false,
maxValue,
remoteWindow: BrowserWindow,
browserWindow: {
parent: getCurrentWindow(),
modal: false,
closable: true,
indeterminate: false,
},
});
const createResultWindow = () =>
new BrowserWindow({
autoHideMenuBar: true,
show: false,
});
const action = async (context, data) => {
const { requests } = data;
let progress = null;
const progressModal = document.createElement('div');
let abortRequests = false;

@@ -121,3 +95,3 @@ let numIterations, delayBetweenRequests, runInParallel;

<header>
<b># Iterations:</b> [${numIterations}] <b>Delay between requests:</b> [${delayBetweenRequests}s] <b>Run:</b>
<b># Iterations:</b> [${numIterations}] <b>Delay between requests:</b> [${delayBetweenRequests}ms] <b>Run:</b>
[${runInParallel ? "in Parallel" : "Serially"}]

@@ -137,3 +111,2 @@ </header>`;

responses.forEach((response, i) => {
progress.value += 1;
const result = results[j || i];

@@ -154,6 +127,12 @@ if (response.statusCode.toString().startsWith("2")) {

const execute = () => {
progress = createProgressBar(requests.length * numIterations);
progress.on("aborted", function () {
console.info(`aborted...`);
abortRequests = true;
progressModal.style.padding = '20px';
progressModal.innerHTML = `
<h4><font color=red><strong>If you close this, requests will be aborted</strong></font></h4>
<p>Please wait until all requests finishes. Due to the limitations of the Insomnia Plugins we can not show you a progress bar
but you can always open the DevTools and see the console.</p>`;
context.app.dialog("Processing", progressModal, {
onHide: () => {
console.info(`aborted...`);
abortRequests = true;
}
});

@@ -226,6 +205,7 @@ return new Promise((resolve, reject) => {

const html = startHtml + header + startTableHtml + rows.join("") + endHtml;
const content = "data:text/html;charset=UTF-8," + encodeURIComponent(html);
const resultWindow = createResultWindow();
resultWindow.loadURL(content);
resultWindow.show();
progressModal.innerHTML = html;
context.app.dialog("Results Table", progressModal, {
tall: true,
});
} catch (err) {

@@ -232,0 +212,0 @@ if (!abortRequests) {

{
"name": "insomnia-plugin-load-test-timing",
"version": "1.0.5",
"version": "1.0.6",
"main": "load-test-timing.js",

@@ -9,5 +9,2 @@ "insomnia": {

},
"dependencies": {
"electron-progressbar": "2.0.0"
},
"description": "This plugin adds an option to each folder's drop-down menu that allows you to run all the requests in the folder and gather timing information.",

@@ -14,0 +11,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc