99_ecore_toolbar_test.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. let test_utils = require('./test_utils');
  2. let model_building_utils = require('./model_building_utils');
  3. let user = "./users/testuser/";
  4. let fs = require('fs');
  5. // tests the ecore toolbar
  6. module.exports = {
  7. beforeEach : function (client) {
  8. client.url('http://localhost:8124/atompm').pause(1000);
  9. },
  10. 'Login' : function (client) {
  11. test_utils.login(client);
  12. },
  13. 'Export MM test': function (client) {
  14. model_building_utils.load_model(client, "autotest", "autotest.model");
  15. test_utils.load_toolbar(client, ["Toolbars/Ecore/Export2Ecore.buttons.model"]);
  16. let MMbutton = "#Toolbars\\2f Ecore\\2f Export2Ecore\\2e buttons\\2e model\\2f ExportMM2Ecore";
  17. client.waitForElementPresent(MMbutton, 2000, "Load MM Button");
  18. client.click(MMbutton);
  19. let dialog_btn = "#dialog_btn";
  20. client.waitForElementPresent(dialog_btn, 2000, "Load MM Menu");
  21. client.click(dialog_btn);
  22. let ecore_path = "exported_to_ecore/autotestMetamodel.ecore";
  23. client.verify.ok(fs.existsSync(ecore_path), "Check file existance: '" + ecore_path + "'");
  24. },
  25. 'Export M test': function (client) {
  26. model_building_utils.load_model(client, "autotest", "autotest_instance.model");
  27. test_utils.load_toolbar(client, ["Toolbars/Ecore/Export2Ecore.buttons.model"]);
  28. let Mbutton = "#Toolbars\\2f Ecore\\2f Export2Ecore\\2e buttons\\2e model\\2f ExportM2Ecore";
  29. client.waitForElementPresent(Mbutton, 2000, "Load M Button");
  30. client.click(Mbutton);
  31. let dialog_btn = "#dialog_btn";
  32. client.waitForElementPresent(dialog_btn, 2000, "Load M Menu");
  33. client.click(dialog_btn);
  34. let ecore_path = "exported_to_ecore/autotest_instanceModel.xmi";
  35. client.verify.ok(fs.existsSync(ecore_path), "Check file existance: '" + ecore_path + "'");
  36. },
  37. after : function (client) {
  38. client.end();
  39. },
  40. };