load tester beta
This commit is contained in:
+41
-28
@@ -1,39 +1,52 @@
|
||||
import APITester from './APITester';
|
||||
import APIScenario from "./APIScenario";
|
||||
import APIScenario from './APIScenario';
|
||||
import LoadTestManager from './LoadTestManager';
|
||||
|
||||
window.MonacoEnvironment = {
|
||||
getWorkerUrl: function (moduleId, label) {
|
||||
let contextPath = document.querySelector('meta[name="context-path"]').getAttribute('content');
|
||||
if (!contextPath) {
|
||||
contextPath = '/';
|
||||
}
|
||||
if (!contextPath.endsWith('/')) {
|
||||
contextPath += '/';
|
||||
}
|
||||
|
||||
if (label === 'json') {
|
||||
return contextPath + 'plugins/apitestmanager/json.worker.bundle.js';
|
||||
}
|
||||
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||
return contextPath + 'plugins/apitestmanager/css.worker.bundle.js';
|
||||
}
|
||||
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||
return contextPath + 'plugins/apitestmanager/html.worker.bundle.js';
|
||||
}
|
||||
if (label === 'typescript' || label === 'javascript') {
|
||||
return contextPath + 'plugins/apitestmanager/ts.worker.bundle.js';
|
||||
}
|
||||
return contextPath + 'plugins/apitestmanager/editor.worker.bundle.js';
|
||||
getWorkerUrl: function(moduleId, label) {
|
||||
let contextPath = document.querySelector(
|
||||
'meta[name="context-path"]').getAttribute('content');
|
||||
if (!contextPath) {
|
||||
contextPath = '/';
|
||||
}
|
||||
|
||||
if (!contextPath.endsWith('/')) {
|
||||
contextPath += '/';
|
||||
}
|
||||
|
||||
if (label === 'json') {
|
||||
return contextPath + 'plugins/apitestmanager/json.worker.bundle.js';
|
||||
}
|
||||
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||
return contextPath + 'plugins/apitestmanager/css.worker.bundle.js';
|
||||
}
|
||||
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||
return contextPath + 'plugins/apitestmanager/html.worker.bundle.js';
|
||||
}
|
||||
if (label === 'typescript' || label === 'javascript') {
|
||||
return contextPath + 'plugins/apitestmanager/ts.worker.bundle.js';
|
||||
}
|
||||
return contextPath + 'plugins/apitestmanager/editor.worker.bundle.js';
|
||||
}
|
||||
};
|
||||
|
||||
export default class APITestManager {
|
||||
|
||||
constructor(servers, options = {}) {
|
||||
this.apiTester = new APITester(options.contextPath);
|
||||
this.apiTester.init(servers);
|
||||
this.apiScenario = new APIScenario(this.apiTester, options.contextPath);
|
||||
this.apiScenario.init();
|
||||
constructor(options = {}) {
|
||||
if (options.type === undefined) {
|
||||
options.type = 'api';
|
||||
}
|
||||
|
||||
if (options.type === 'api') {
|
||||
this.apiTester = new APITester(options.contextPath);
|
||||
this.apiTester.init(options.servers);
|
||||
this.apiScenario = new APIScenario(this.apiTester, options.contextPath);
|
||||
this.apiScenario.init();
|
||||
} else if (options.type === 'load') {
|
||||
this.loadTesterManager = new LoadTestManager(options.contextPath);
|
||||
this.loadTesterManager.init();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user