0

I am trying to test a link to go to a twitter page. Is this possible?

index.html

<a class="navbar-brand" href="https://twitter.com/foo">@foo</a>

karma-e2e.conf.js

proxies : {
  '/': 'http://localhost:8000/',
  '/twitter/': 'https://twitter.com/'
},

scenarios.js

it('should redirect to twitter page when link is clicked', function() {
  element('.navbar a').click();
  expect(browser().location().url()).toBe('/twitter/foo');
});

Error

Uncaught SecurityError: Blocked a frame with origin "http://localhost:9877" from accessing a cross-origin frame.
at /foobar/node_modules/karma-ng-scenario/lib/adapter.js:43
collinglass
  • 800
  • 4
  • 11
  • 31

1 Answers1

0

This is what I've set on it to work for e2e tester:

 config.set({
            browsers: ['chrome_without_security'],
            customLaunchers: {
                chrome_without_security: {
                    base: 'Chrome',
                    flags: ['--disable-web-security']
                }
            }
        });
zaysha
  • 1