Closed dehru closed 13 years ago
A custom runner is probably the simplest solution in this case. Sorry :/
Searls, I thought I'd post this simple solution in case anyone runs into the same issue.
This is what I ended up adding to my custom runner. Works like a charm...even if a little hardcoded.
<script type="text/javascript">
var appDirectory = "src/"; //this works for jasmine:test
if (document.location.port == 8234) { //key off the port used for bdd
appDirectory = "src/main/webapp/";//this works for jasmine:bdd
}
</script>
then i use document.write to append the appDirectory to the script tag src property.
Cheers!
I really wish I knew what "then i use document.write to append the appDirectory to the script tag src property." meant.
So I finally got my ExtJS 4, Jasmine, Maven learning project going. Its available to the public for what it's worth... http://subversion.assembla.com/svn/freshcode_public/learn/extjs/ (The READ_ME.txt is really important)
Particular caveats include:
Hello, thanks so much for sharing this maven plugin. I am trying to integrate this into an Ext JS 4 project. Ext JS uses dynamic loading ( in development mode ) of it's various components...so it needs to know where those files are on the server relative to the html file that is running it. I configure Ext JS like this.
Ext.Loader.setPath('Ext', 'ext/src');
What I'm finding is that the relative urls are different between running jasmine:bdd and jasmine:test.
Here's my configuration:'
When I run mvn jasmine:bdd the path to ext-debug.js is:
and the file is served out of the src directory here:
but when I run mvn jasmine:test, that url path is different since it runs out of target.
The same file is now located at the relative url ( Notice no main/webapp ):
because it is serving it out of:
This may not be an issue for others. But because Ext JS goes after it's own source files with relative paths, I have to change the configuration of Ext if doing BDD vs running on my CI.
What would you recommend the best way to deal with this issue?
I'm thinking about trying to use a custom spec runner file and trying to configure Ext "on the fly" with the correct path based on whether I'm running in bdd mode or in test mode ( headless ).
Anyway, if you have any suggestions I'd love to hear about it. Otherwise, I'll share any solution that I come up with.
Cheers, Dehru