Cross-site scripting issues with testacular e2e test and angular

I am creating a webapp using java on the server and angular for the interface. I am trying to configure e2e tests using testacular. Testing does not cause me to have cross-site scripting issues. Since I create my end using java, I have a tomcat server that hosts my web application. If I go to http://localhost:8087/angular in my browser, the page will load. (Port 8087 for my tomcat 7 installation, since I have both tomcat 6 and 7 on my computer).

When I run testacular start 'path/to/config/file , I get this error:

 http://localhost:9876/adapter/lib/angular-scenario.js?1360780804000:25281: Error: Permission denied to access property 'document' 

This is my configuration file:

 basePath = '../../'; files = [ ANGULAR_SCENARIO, ANGULAR_SCENARIO_ADAPTER, 'test/js/tests/e2e/scenarios.js' ]; autoWatch = false; browsers = ['firefox']; singleRun = true; proxies = { '/': 'http://localhost:8087/angular' }; junitReporter = { outputFile: 'test_out/e2e.xml', suite: 'e2e' }; 

And this is my test file:

 describe("E2E Test", function() { it("should load the document and be able to read from it", function() { browser().navigateTo("/"); expect(element("body", "The body element").count()).toBe(1); }); }); 

Is there any way around this? Using: node v0.8.20 testacular 0.5.10

+4
source share
1 answer

First of all, I recommend you upgrade Karma

The configuration you shared should work just as well as in this example here . The fact that this is not the case is because you are using an old version of testacular, OR because of a problem in your application.

I was lucky with older versions of testacular / angular when I served everything from port 80 using Nginx, but first I would update if you were you.

0
source

All Articles