Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
integration [2024/01/02 22:44] – [Integrate TestOptimal in your java project (Java /IDE Connector)] admin | integration [2024/01/02 22:46] (current) – [Integration with External Tools] admin | ||
---|---|---|---|
Line 6: | Line 6: | ||
* [[#Azure DevOps]] | * [[#Azure DevOps]] | ||
* [[#REST APIs]] | * [[#REST APIs]] | ||
- | * [[# Integrate TestOptimal in your java project (Java /IDE Connector)]] | ||
- | * [[# Integrate TestOptimal in your web project (javascript/ | ||
* [[plugins# | * [[plugins# | ||
Line 59: | Line 57: | ||
---- | ---- | ||
- | |||
- | ==== Integrate TestOptimal in your web project (javascript/ | ||
- | You may integrate your web project with // | ||
- | |||
- | For web/ | ||
- | <script src=" | ||
- | <script src=" | ||
- | |||
- | For //Node.js// project, use following npm command to install // | ||
- | npm install @testoptimal/ | ||
- | |||
- | |||
- | === Connecting to TestOptimal Server === | ||
- | TOSvr = new TOServer(" | ||
- | | ||
- | | ||
- | .then(() => { | ||
- | console.logMsg(" | ||
- | }, (err) => { | ||
- | console.logMsg(err); | ||
- | alert(" | ||
- | }); | ||
- | |||
- | === State Model Sample Scripts === | ||
- | |||
- | |||
- | == Creating State Model == | ||
- | var model = new Model (" | ||
- | var Welcome = model.addStateInitial(" | ||
- | var Q1 = model.addState(" | ||
- | var Q2 = model.addState(" | ||
- | var Q3 = model.addState(" | ||
- | var Q4 = model.addState(" | ||
- | var ThankYou = model.addStateFinal(" | ||
- | |||
- | Welcome.addTrans(" | ||
- | Q1.addTrans(" | ||
- | Q2.addTrans(" | ||
- | Q3.addTrans(" | ||
- | Q4.addTrans(" | ||
- | |||
- | // TOSvr is the connection object created in Making Connection section above. | ||
- | TOSvr.uploadModel(model).then (function(){alert(" | ||
- | |||
- | == Generating Test Cases == | ||
- | TOSvr.genPaths(" | ||
- | function printPaths (sum) { | ||
- | | ||
- | } | ||
- | |||
- | == Opening Graphs == | ||
- | // graph types: model, sequence, msc and coverage | ||
- | // except model graph, all other graphs are available for model execution. | ||
- | var url = TOSvr.getGraphURL(" | ||
- | console.logMsg(" | ||
- | window.open(url, | ||
- | |||
- | == Online MBT == | ||
- | var execReq = { | ||
- | modelName: | ||
- | statDesc: " | ||
- | options: { " | ||
- | }; | ||
- | var agentID = " | ||
- | TOSvr.execModel(execReq).then((data) => { | ||
- | console.logMsg(data); | ||
- | console.logMsg(" | ||
- | TOSvr.regAgent(execReq.modelName, | ||
- | }); | ||
- | |||
- | function getNextCmd() { | ||
- | | ||
- | if (rmtCmd && rmtCmd.cmd) { | ||
- | var result = { | ||
- | result: "I don't know", | ||
- | reqTag: " | ||
- | assertID: | ||
- | } | ||
- | console.logMsg(" | ||
- | console.logMsg(" | ||
- | TOSvr.setResult (agentID, result).then (function(ret) { | ||
- | setTimeout(getNextCmd, | ||
- | }, errHandler); | ||
- | } | ||
- | else modelExecDone(); | ||
- | }, errHandler); | ||
- | } | ||
- | |||
- | function modelExecDone() { | ||
- | | ||
- | }function errHandler (err) { | ||
- | | ||
- | | ||
- | | ||
- | } | ||
- | |||
- | == Retrieve Execution Results == | ||
- | | ||
- | |||
- | === Combinatorial Model Sample Scripts === | ||
- | |||
- | == Create DataSet == | ||
- | var ds = new DataSet(" | ||
- | ds.addField (" | ||
- | ds.addField (" | ||
- | TOSvr.uploadDataSet (ds).then(console.logMsg, | ||
- | |||
- | == Generate Test Cases == | ||
- | | ||
- | |||
- | |||
- | === Demo Web Client === | ||
- | You may try out above sample scripts with the web client bundled in // | ||
- | |||
- | http:// | ||