Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration in "proxies" not inerpreted in e2e? #745

Closed
m48u opened this issue Sep 12, 2013 · 2 comments
Closed

configuration in "proxies" not inerpreted in e2e? #745

m48u opened this issue Sep 12, 2013 · 2 comments

Comments

@m48u
Copy link

m48u commented Sep 12, 2013

Hi,
I have setup Karma v0.10.2. with "ng-scenario" and configured the proxies like the following:

proxies: {
            "/my": "http://localhost:8080/home/myApp/",
}
 urlRoot: '/__testacular/',

I know that this config is read after start because I get a warning that says me

WARN [proxy]: proxy "/my" normalized to "/my/"

In my e2e test I do

browser().navigateTo("/my");
expect(browser().window().href()).toBe("http://localhost:8080/home/myApp/");

But this results in the following error:

expected "http://localhost:8080/home/myApp/" but was "http://localhost:9876/my"

What's wrong here?
Thx!

@dignifiedquire
Copy link
Member

The proxy will serve the content from http://localhost:8080/home/myApp/ under the url http://localhost:9876/my but not do a redirect which is what you are testing here.

@vojtajina
Copy link
Contributor

The reason, why you need proxy is so that you are on the same domain (because angular scenario runner will open your app in an iframe and will interact with it) - browser won't let you interact with an iframe that has content from a different domain.

So this is correct behavior. As @dignifiedquire pointed out, you are expecting redirect, which is something that your web server can do (by sending redirect headers), but angular scenario runner won't work then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants