【发布时间】:2015-07-31 10:19:22
【问题描述】:
在进行 e2e 测试一两天后,我有了想要通过 Bamboo 运行的东西。我可以在我自己的本地服务器上运行所有 e2e 测试,但是 Bamboo 失败并显示以下响应,并且当 Chrome 浏览器窗口弹出时,它显示“403 禁止”:
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.100.107:54926/wd/hub
Spec started
Web App
Sign In Page
— should redirect to sign in page if not authenticated[39m
- Failed: Angular could not be found on the page https://localhost/ : retries looking for angular exceeded
- Failed: Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
这是一个示例测试:
'use strict';
describe('Web App', function() {
beforeEach(function() {
browser.get('https://localhost/');
});
describe('Sign In Page', function() {
it('should redirect to sign in page if not authenticated', function() {
expect(browser.getLocationAbsUrl()).toMatch('/sign_in');
});
});
});
这是我认为与我的 protractor-conf.js 文件相关的内容:
exports.config = {
allScriptsTimeout: 300000,
baseUrl: 'https://localhost/',
framework: 'jasmine2',
specs: [
'e2e/sign-in.scenarios.js'
],
capabilities: {
'browserName': 'chrome'
},
onPrepare: function() {
browser.driver.manage().window().maximize();
var SpecReporter = require('jasmine-spec-reporter');
jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: true}));
},
getPageTimeout: 10000,
jasmineNodeOpts: {
showColors: true,
print: function() {},
defaultTimeoutInterval: 300000
}
};
最后,我们在“grunt test”之前运行了一个“npm install”,所以我希望除了 Chrome 之外所有版本都相同?
我负责 Bamboo 的同事能够在 Bamboo 创建的临时目录中重新创建运行。为了弄清楚发生了什么,我将“ng-app”从 head 标签移到了 body 标签,我弄乱了 protractor-conf.js 文件中的 baseUrl,我的同事现在正在使用我的 nginx配置文件(与他的不同)。
我的想法已经不多了,欢迎提出任何建议!
朱莉
【问题讨论】:
-
把 https 改成 http 有什么不同吗?
-
很遗憾没有 alecxe,我也试过了。
标签: angularjs protractor bamboo