0

我正在尝试测试一个链接以转到 Twitter 页面。这可能吗?

索引.html

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

业力-e2e.conf.js

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

场景.js

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

错误

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
4

1 回答 1

0

这是我为 e2e 测试人员设置的内容:

 config.set({
            browsers: ['chrome_without_security'],
            customLaunchers: {
                chrome_without_security: {
                    base: 'Chrome',
                    flags: ['--disable-web-security']
                }
            }
        });
于 2014-03-24T14:17:50.443 回答