I want to do end to end test as described in the documentation Angular.js using a frontend based on angular-seed. The backend is written using django. When I try to use the jstestdriver (and the proxy option) I receive messages from jetty saying that GET requests to this URLs are not allowed.
How can I fix this? Are there other ways to run my tests in such a setup?
Do I understand it correctly that it's just common Jasmine and the test driver is more or less just a server?
Testacular is currently the supported test runner. Here's my testacular-e2e.conf.js
file.
basePath = '../';
files = [
ANGULAR_SCENARIO,
ANGULAR_SCENARIO_ADAPTER,
'test/e2e/**/*.js'
];
autoWatch = false;
browsers = ['Chrome'];
singleRun = true;
proxies = {
'/': 'http://localhost:3000/'
};
junitReporter = {
outputFile: 'test_out/e2e.xml',
suite: 'e2e'
};
The important part is proxies
. It configures testacular to use your server. If I'm not mistaken, Django runs on port 8000 in development. So proxies
would look like this:
proxies = {
'/': 'http://127.0.0.1:8000/'
};
After installing testacular via npm and creating this config file, you can then start your back end server and run your e2e tests like so:
$ testacular start config/testacular-e2e.conf.js
JsTestDriver doesn't seem to be maintained anymore, you can also try to run the test with PhantomJS for example: https://github.com/jcarver989/phantom-jasmine