How to run an e2e test script for a Django application with Angular.js interface?

I want to run an end-to-end test as described in the Angular.js documentation using an angular -seed based interface. The backend is written using django. When I try to use jstestdriver (and the proxy option), I get messages from the marina saying that GET requests for these URLs are not allowed.

How can i fix this? Are there other ways to run my tests in such a setup?

Do I understand correctly that this is just an ordinary Jasmine and a test driver - is it more or less just a server?

+4
source share
2 answers

JsTestDriver is no longer supported, you can also try to run the test with PhantomJS, for example: https://github.com/jcarver989/phantom-jasmine p>

0
source

Karma is currently a supported test runner. Here is 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 of proxies . It configures testacular to use your server. If I'm not mistaken, Django works on port 8000 in development. So proxies will look like this:

 proxies = { '/': 'http://127.0.0.1:8000/' }; 

After installing testacular through npm and creating this configuration file, you can start your server and run your e2e tests as follows:

 $ testacular start config/testacular-e2e.conf.js 
+5
source

Source: https://habr.com/ru/post/1434830/


All Articles