Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7ce4b17c7a
|
@ -485,23 +485,27 @@ class JMXGenerator {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
addScenarioVariables(threadGroup, scenario) {
|
addEnvironments(environments, target) {
|
||||||
let scenarioVariableKeys = new Set();
|
let keys = new Set();
|
||||||
scenario.variables.forEach(item => {
|
target.forEach(item => {
|
||||||
scenarioVariableKeys.add(item.name);
|
keys.add(item.name);
|
||||||
});
|
});
|
||||||
let environment = scenario.environment;
|
let envArray = environments;
|
||||||
if (environment) {
|
if (!(envArray instanceof Array)) {
|
||||||
let envVariables = environment.variables;
|
envArray = JSON.parse(environments);
|
||||||
if (!(envVariables instanceof Array)) {
|
envArray.forEach(item => {
|
||||||
envVariables = JSON.parse(environment.variables);
|
if (item.name && !keys.has(item.name)) {
|
||||||
envVariables.forEach(item => {
|
target.push(new KeyValue(item.name, item.value));
|
||||||
if (item.name && !scenarioVariableKeys.has(item.name)) {
|
|
||||||
scenario.variables.push(new KeyValue(item.name, item.value));
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addScenarioVariables(threadGroup, scenario) {
|
||||||
|
let environment = scenario.environment;
|
||||||
|
if (environment) {
|
||||||
|
this.addEnvironments(environment.variables, scenario.variables)
|
||||||
|
}
|
||||||
let args = this.filterKV(scenario.variables);
|
let args = this.filterKV(scenario.variables);
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
let name = scenario.name + " Variables"
|
let name = scenario.name + " Variables"
|
||||||
|
@ -510,21 +514,9 @@ class JMXGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
addScenarioHeaders(threadGroup, scenario) {
|
addScenarioHeaders(threadGroup, scenario) {
|
||||||
let scenarioHeaderKeys = new Set();
|
|
||||||
scenario.headers.forEach(item => {
|
|
||||||
scenarioHeaderKeys.add(item.name);
|
|
||||||
});
|
|
||||||
let environment = scenario.environment;
|
let environment = scenario.environment;
|
||||||
if (environment) {
|
if (environment) {
|
||||||
let envHeaders = environment.headers;
|
this.addEnvironments(environment.headers, scenario.headers)
|
||||||
if (!(envHeaders instanceof Array)) {
|
|
||||||
envHeaders = JSON.parse(environment.headers);
|
|
||||||
envHeaders.forEach(item => {
|
|
||||||
if (item.name && !scenarioHeaderKeys.has(item.name)) {
|
|
||||||
scenario.headers.push(new KeyValue(item.name, item.value));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
let headers = this.filterKV(scenario.headers);
|
let headers = this.filterKV(scenario.headers);
|
||||||
if (headers.length > 0) {
|
if (headers.length > 0) {
|
||||||
|
|
|
@ -72,9 +72,13 @@
|
||||||
reset() {
|
reset() {
|
||||||
let source = this.condition.components;
|
let source = this.condition.components;
|
||||||
this.config.components.forEach((component, index) => {
|
this.config.components.forEach((component, index) => {
|
||||||
|
if (component.operator.value !== undefined) {
|
||||||
let operator = source[index].operator.value;
|
let operator = source[index].operator.value;
|
||||||
component.operator.value = operator === undefined ? component.operator.options[0].value : operator;
|
component.operator.value = operator === undefined ? component.operator.options[0].value : operator;
|
||||||
|
}
|
||||||
|
if (component.value !== undefined) {
|
||||||
component.value = source[index].value;
|
component.value = source[index].value;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
|
|
|
@ -215,8 +215,8 @@ export const MODULE = {
|
||||||
name: 'MsTableSearchInput',
|
name: 'MsTableSearchInput',
|
||||||
label: "test_track.case.module",
|
label: "test_track.case.module",
|
||||||
operator: {
|
operator: {
|
||||||
value: OPERATORS.LIKE.value, // 如果未设置value初始值,则value初始值为options[0]
|
value: OPERATORS.LIKE.value,
|
||||||
options: [OPERATORS.LIKE, OPERATORS.NOT_LIKE] // 运算符候选项
|
options: [OPERATORS.LIKE, OPERATORS.NOT_LIKE]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue