n1k0/casperjs — Issue #28: casperLibPath is not relative to the casper.js file
Author: naltatis
Created: 2011-12-14 11:03:56+00:00
State: open

When I put `casper.js` from a subfolder it can't find its modules.

run.js

```
phantom.injectJs('lib/casper/casper.js');
```

running the test

```
/Users/username/my-tests$ phantomjs run.js
```

output

```
2011-12-14T11:49:14 [WARNING] Can't open '/Users/username/my-tests/lib/casper.js'
2011-12-14T11:49:14 [WARNING] Can't open '/Users/username/my-tests/lib/clientutils.js'
...
```

I would expect casper.js to look in `/Users/username/my-tests/lib/casperjs/lib/` for its files.

Is there a way to make the module path relative to the main casper.js file instead of relative to the working directory? I didn't find anything usefull in the phantomjs documentation.

If not, perhaps provide an optional global variable to set the path before injecting casper.js.

\- naltatis