Loading Shared-modules

1 view
Skip to first unread message

Florian Aspart

unread,
Aug 5, 2010, 11:24:28 AM8/5/10
to MozMill Developers
Hi!
I'm a new Mozmill user and I'm trying to load a share module without
success. It seems that Mozmill does not find the shared-module :
everytime I launch this code, I got an error saying that windowHelper
is undefined. Does somebody know where this error does come from?
Could it be that my file containing the shared-modules, testwindow-
helpers.js, is not at the right place? I put it into a subfolder,
"shared-modules", from the folder containing my test.js file.
Any help would be welcome, I really don't know where the problem comes
from...

const RELATIVE_ROOT = './shared-modules';
const MODULE_REQUIRES = ['window-helpers'];

var setupModule = function(module) {
var windowHelper=collector.getModule('window-helpers');
windowHelper.installInto(module);
}

Florian Aspart

unread,
Aug 5, 2010, 12:42:54 PM8/5/10
to MozMill Developers
I finally found the problem.
It was simply the "test-window-helpers.js" file, I found on the
internet, that was not recognize as a module. There were some
variables declarations before the name declaration of the module and
it seems that mozmill do not look through the entire file to find a
module name.

Henrik Skupin

unread,
Aug 5, 2010, 5:21:27 PM8/5/10
to mozmi...@googlegroups.com
Florian Aspart wrote on 8/5/10 6:42 PM:

> I finally found the problem.
> It was simply the "test-window-helpers.js" file, I found on the
> internet, that was not recognize as a module. There were some
> variables declarations before the name declaration of the module and
> it seems that mozmill do not look through the entire file to find a
> module name.

Great to see that you were able to solve the problem on your own.

Welcome to our list and test automation with Mozmill!

--
Henrik Skupin
QA Execution Engineer
Mozilla Corporation

Nitin maliye

unread,
Aug 16, 2010, 7:24:13 AM8/16/10
to MozMill Developers
Hi!

Well i am also using shared modules i found the same problem initially
so i put all my script files in the shared module itself.
using - const RELATIVE_ROOT = '.';

But now i have created a library and i need to keep it under
mozilla:resources folder.
That library file is using shared modules inside so as relative path
not matching i need to change it to access shared modules.
can you please describe the steps u used to access the shared modules.

Is there any way to use ABSOLUTE path?

Thanks,
Nitin Maliye

Florian Aspart

unread,
Aug 16, 2010, 11:51:22 AM8/16/10
to MozMill Developers
Actually at the end it wasn't a problem of path in my case but it was
my module that was not recognized.
I just used the relative path ./Shared_modules and it worked.
I don't know if there is a way to give the path in a relative way.
Have you tried something like "resource:// ..." like when importing
libraries?
Components.utils.import('resource://modules/name/myfile.js');

Nitin maliye

unread,
Aug 17, 2010, 1:08:40 AM8/17/10
to mozmi...@googlegroups.com
Thanks for reply.
Yes i am accessing shared modules using import.
To import file it has to be in resource folder somewhere so i kept it there.
To access function need to modify these modules ... i am done with this.
But only concern is whenever i change these files i need to restart the browser again .. :(



--
You received this message because you are subscribed to the Google Groups "MozMill Developers" group.
To post to this group, send email to mozmi...@googlegroups.com.
To unsubscribe from this group, send email to mozmill-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozmill-dev?hl=en.


Clint Talbert

unread,
Aug 17, 2010, 7:03:21 PM8/17/10
to mozmi...@googlegroups.com
If you change something on a resource:// path (or any path that is created via chrome manifests) you are going to have to restart the browser to pick up those changes.  That's the way that Gecko (the platform underlying Firefox) is built.

We are looking into a commonJS style module loading for the future of Mozmill, but it's still too early yet to know how that's going to work vis a vis changing files and needing to restart the browser.

Clint
Reply all
Reply to author
Forward
0 new messages