From f066d9c5ca7d3ba27fcd744a84d5eb5bf73fc615 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 26 Sep 2022 15:56:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=89=8D=E7=AB=AF=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86Mock=E8=A1=A5=E5=85=A8JMeter=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E5=87=BD=E6=95=B0=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/common/js/constants.js | 32 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/frontend/src/common/js/constants.js b/frontend/src/common/js/constants.js index ff02e8f538..0822499b6b 100644 --- a/frontend/src/common/js/constants.js +++ b/frontend/src/common/js/constants.js @@ -145,39 +145,53 @@ export const MOCKJS_FUNC = [ export const JMETER_FUNC = [ {type: "Information", name: "${__threadNum}", description: "get thread number"}, + {type: "Information", name: "${__threadGroupName}", description: "get thread group name"}, {type: "Information", name: "${__samplerName}", description: "get the sampler name (label)"}, {type: "Information", name: "${__machineIP}", description: "get the local machine IP address"}, {type: "Information", name: "${__machineName}", description: "get the local machine name"}, {type: "Information", name: "${__time}", description: "return current time in various formats"}, + {type: "Information", name: "${__timeShift}", description: "return a date in various formats with the specified amount of seconds/minutes/hours/days added"}, {type: "Information", name: "${__log}", description: "log (or display) a message (and return the value)"}, {type: "Information", name: "${__logn}", description: "log (or display) a message (empty return value)"}, {type: "Input", name: "${__StringFromFile}", description: "read a line from a file"}, {type: "Input", name: "${__FileToString}", description: "read an entire file"}, - {type: "Input", name: "${__CSVRead}", description: "read from CSV definitioned file"}, + {type: "Input", name: "${__CSVRead}", description: "read from CSV delimited file"}, {type: "Input", name: "${__XPath}", description: "Use an XPath expression to read from a file"}, + {type: "Input", name: "${__StringToFile}", description: "write a string to a file"}, {type: "Calculation", name: "${__counter}", description: "generate an incrementing number"}, + {type: "Formatting", name: "${__dateTimeConvert}", description: "Convert a date or time from source to target format"}, + {type: "Calculation", name: "${__digest}", description: "Generate a digest (SHA-1, SHA-256, MD5...)"}, {type: "Calculation", name: "${__intSum}", description: "add int numbers"}, {type: "Calculation", name: "${__longSum}", description: "add long numbers"}, {type: "Calculation", name: "${__Random}", description: "generate a random number"}, + {type: "Calculation", name: "${__RandomDate}", description: "generate random date within a specific date range"}, + {type: "Calculation", name: "${__RandomFromMultipleVars}", description: "extracts an element from the values of a set of variables separated by |"}, {type: "Calculation", name: "${__RandomString}", description: "generate a random string"}, {type: "Calculation", name: "${__UUID}", description: "generate a random type 4 UUID"}, + {type: "Scripting", name: "${__groovy}", description: "run an Apache Groovy script"}, {type: "Scripting", name: "${__BeanShell}", description: "run a BeanShell script"}, - {type: "Scripting", name: "${__javaScript}", description: "process JavaScript (Mozilla Rhino)"}, - {type: "Scripting", name: "${__jexl}", description: "evaluate a Commons Jexl expression"}, - {type: "Scripting", name: "${__jexl2}", description: "evaluate a Commons Jexl expression"}, + {type: "Scripting", name: "${__javaScript}", description: "process JavaScript (Nashorn)"}, + {type: "Scripting", name: "${__jexl2}", description: "evaluate a Commons Jexl2 expression"}, + {type: "Scripting", name: "${__jexl3}", description: "evaluate a Commons Jexl3 expression"}, + {type: "Properties", name: "${__isPropDefined}", description: "Test if a property exists"}, {type: "Properties", name: "${__property}", description: "read a property"}, {type: "Properties", name: "${__P}", description: "read a property (shorthand method)"}, {type: "Properties", name: "${__setProperty}", description: "set a JMeter property"}, {type: "Variables", name: "${__split}", description: "Split a string into variables"}, - {type: "Variables", name: "${__V}", description: "evaluate a variable name"}, {type: "Variables", name: "${__eval}", description: "evaluate a variable expression"}, {type: "Variables", name: "${__evalVar}", description: "evaluate an expression stored in a variable"}, - {type: "String", name: "${__regexFunction}", description: "parse previous response using a regular expression"}, - {type: "String", name: "${__escapeOroRegexpChars}", description: "quote meta chars used by ORO regular expression"}, + {type: "Properties", name: "${__isVarDefined}", description: "Test if a variable exists"}, + {type: "Variables", name: "${__V}", description: "evaluate a variable name"}, {type: "String", name: "${__char}", description: "generate Unicode char values from a list of numbers"}, - {type: "String", name: "${__unescape}", description: "Process strings containing Java escapes (e.g. & )"}, - {type: "String", name: "${__unescapeHtml}", description: "Decode HTML-encoded strings"}, + {type: "String", name: "${__changeCase}", description: "Change case following different modes"}, {type: "String", name: "${__escapeHtml}", description: "Encode strings using HTML encoding"}, + {type: "String", name: "${__escapeOroRegexpChars}", description: "quote meta chars used by ORO regular expression"}, + {type: "String", name: "${__escapeXml}", description: "Encode strings using XMl encoding"}, + {type: "String", name: "${__regexFunction}", description: "parse previous response using a regular expression"}, + {type: "String", name: "${__unescape}", description: "Process strings containing Java escapes (e.g. \n & \t)"}, + {type: "String", name: "${__unescapeHtml}", description: "Decode HTML-encoded strings"}, + {type: "String", name: "${__urldecode}", description: "Decode a application/x-www-form-urlencoded string"}, + {type: "String", name: "${__urlencode}", description: "Encode a string to a application/x-www-form-urlencoded string"}, {type: "String", name: "${__TestPlanName}", description: "Return name of current test plan"}, ]