fix:修复一键运行报错

This commit is contained in:
wenyann 2020-09-22 18:05:05 +08:00
parent 6e2069e011
commit 4d374fcc4f
3 changed files with 16 additions and 11 deletions

View File

@ -198,10 +198,6 @@ public class MailService {
users = emails.toArray(new String[emails.size()]);
if (type.equals("reviewer")) {
helper.setText(html1, true);
} else if (type.equals("reviewer")) {
helper.setText(html2, true);
} else {
helper.setText(html3, true);
}
helper.setTo(users);

View File

@ -22,7 +22,7 @@
<script>
import MsDialogFooter from '../../common/components/MsDialogFooter'
import {Test} from "./model/ScenarioModel"
import {Scenario, Test} from "./model/ScenarioModel"
import MsApiScenarioConfig from "./components/ApiScenarioConfig";
import MsApiReportStatus from "../report/ApiReportStatus";
import MsApiReportDialog from "./ApiReportDialog";

View File

@ -1116,8 +1116,11 @@ class JMXGenerator {
addScenarioVariables(threadGroup, scenario) {
if (scenario.environment) {
let commonConfig = scenario.environment.config.commonConfig;
this.addEnvironments(commonConfig.variables, scenario.variables)
let config = scenario.environment.config;
if (!(scenario.environment.config instanceof Object)) {
config = JSON.parse(scenario.environment.config);
}
this.addEnvironments(config.commonConfig.variables, scenario.variables)
}
let args = this.filterKV(scenario.variables);
if (args.length > 0) {
@ -1165,8 +1168,11 @@ class JMXGenerator {
databaseConfigMap.set(config.id, config.name);
});
if (scenario.environment) {
let envDatabaseConfigs = scenario.environment.config.databaseConfigs;
envDatabaseConfigs.forEach(config => {
let config = scenario.environment.config;
if (!(scenario.environment.config instanceof Object)) {
config = JSON.parse(scenario.environment.config);
}
config.databaseConfigs.forEach(config => {
if (!names.has(config.name)) {
let name = config.name + "JDBCDataSource";
threadGroup.put(new JDBCDataSource(name, config));
@ -1179,8 +1185,11 @@ class JMXGenerator {
addScenarioHeaders(threadGroup, scenario) {
if (scenario.environment) {
let httpConfig = scenario.environment.config.httpConfig;
this.addEnvironments(httpConfig.headers, scenario.headers)
let config = scenario.environment.config;
if (!(scenario.environment.config instanceof Object)) {
config = JSON.parse(scenario.environment.config);
}
this.addEnvironments(config.httpConfig.headers, scenario.headers)
}
let headers = this.filterKV(scenario.headers);
if (headers.length > 0) {