galenframework / galen

Layout and functional testing framework for websites
http://galenframework.com
1.41k stars 163 forks source link

Improve build: Use NPM/bower for JS modules #241

Open hypery2k opened 9 years ago

hypery2k commented 9 years ago

I think as we can now use NPM/grunt within the maven build, we should utilize more NPM/Bower for managaging our frontend dependencies, e.g. for the tablesorter plugin. This would make it easier to update libraries

elgalu commented 9 years ago

Hi! I was expecting to be able to list galenframework as a dependency in my NodeJS package.json testing suite so I can point to a particular https://www.npmjs.com/package/galenframework version, e.g.:

var galen = require('galenframework');

// And then use it without cluttering the global scope
galen.test("Home page", function() {
  var driver = galen.createDriver("http://galenframework.com",
                            "1024x768");
  galen.checkLayout(driver, "homePage.spec", ["all", "desktop"]);
});

// Or cluttering the global scope to write less:
test("Home page", function() {
  var driver = createDriver("http://galenframework.com",
                            "1024x768");
  checkLayout(driver, "homePage.spec", ["all", "desktop"]);
});
ishubin commented 9 years ago

The JavaScript tests in Galen are a bit tricky. The way they work is that Galen is started as a Java application and it executes JavaScript tests via embedded Mozilla Rhino JavaScript executor. So I don't think that it will work like that through npm. By the way I have nothing to do with the galenframework package in npm. That is just some user uploaded galenframework and I really don't know what for.

hypery2k commented 9 years ago

just to mention: I've created an NPM module to install Galen: https://github.com/hypery2k/galenframework-cli

erquhart commented 9 years ago

This is awesome - I would say that more of this sort of things needs to happen for Galen to pick up steam with front enders (who could easily make the majority of the framework's users). The existing efforts should be documented in the repo and on the website, such as Martin's npm module and the grunt/gulp plugins that were created and linked in a separate issue. Making Galen available through these front end tools is a really big deal.

elgalu commented 9 years ago

Thanks @hypery2k, do you think your npm module will be able to solve

JavaScript tests via embedded Mozilla Rhino JavaScript executor

Or the scope of the project is just to install galen?

hypery2k commented 9 years ago

currently just to install galen. But we can later add a NPM module for that

hypery2k commented 8 years ago

you can use the galen-gulp plugin https://www.npmjs.com/package/gulp-galen