03_model_test.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. function loadModel(client, fnames){
  2. for (const name of fnames) {
  3. console.log("Loading: " + name);
  4. client.execute(
  5. function (fname) {
  6. _loadModel(fname);
  7. }, [name], null
  8. );
  9. client.pause(1000);
  10. client.getTitle(function(title) {
  11. this.assert.ok(title.includes(name), "File: " + name + " is opened");
  12. });
  13. }
  14. }
  15. module.exports = {
  16. beforeEach : function (client) {
  17. client.url('http://localhost:8124/atompm').pause(300);
  18. },
  19. 'Login' : function (client) {
  20. client.execute(
  21. function() {
  22. UserManagement.login('testuser');
  23. }, [], null
  24. );
  25. client.pause(300);
  26. client.getTitle(function(title) {
  27. this.assert.ok(title.includes("AToMPM - [Unnamed]"), "AToMPM is opened");
  28. });
  29. },
  30. 'Load model' : function (client) {
  31. let filename = 'Formalisms/ClassicDEVS/ClassicDEVS.model';
  32. loadModel(client, [filename]);
  33. },
  34. //fails due to issue #28
  35. // 'Load two models' : function (client) {
  36. //
  37. // let filenames = [
  38. // 'Formalisms/ClassicDEVS/ClassicDEVS.model',
  39. // 'Formalisms/Annotation/AnnotationMM.model'
  40. // ];
  41. //
  42. // loadModel(client, filenames);
  43. // },
  44. after : function (client) {
  45. client.end();
  46. },
  47. };