- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在努力让 Travis CI 使用 Sauce Labs 运行 Protractor 测试。隧道工作正常,我的 Express 服务器明显启动并保持在 http://localhost:9000
,但我的 Protractor 测试很快失败,并出现错误 Error: Angular could not be found on the page http://localhost:9000/ : retries looking for angular exceeded
。互联网上的所有建议通常都涉及不使用 Angular 1.0(使用 1.3)、延长超时(这样做)或强制 Protractor 查看 <html>
对于 ng-app 指令(这样做)。我没有主意了。
相关配置:
exports.config = {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
baseUrl: 'http://localhost:9000',
specs: ['e2e/**/*.spec.js'],
framework: 'jasmine',
maxSessions: 1,
allScriptsTimeout: 30000,
rootElement: 'html',
multiCapabilities: [
{'browserName': 'chrome'},
{'browserName': 'firefox'},
{'name': 'diplomacy'},
{'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER ? process.env.TRAVIS_JOB_NUMBER : null},
{'build': process.env.TRAVIS_BUILD_NUMBER ? process.env.TRAVIS_BUILD_NUMBER : null}
],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 360000,
includeStackTrace: true
}
}
'use strict';
describe('Home page', function() {
var page;
beforeEach(function() {
browser.get(browser.baseUrl);
});
it('should pass', function() {
expect(true).toBe(true);
});
});
去here以获得完整的日志。亮点:
Extracting Sauce Connect
Waiting for Sauce Connect readyfile
08 Mar 16:30:00 - Sauce Connect 4.3.6, build 1628 8a5c837
08 Mar 16:30:00 - Using CA certificate bundle /etc/ssl/certs/ca-certificates.crt.
08 Mar 16:30:00 - Starting up; pid 3519
08 Mar 16:30:00 - Command line arguments: sc-4.3.6-linux//bin/sc -i 42.1 -f sauce-connect-ready-21801 -l /home/travis/sauce-connect.log
08 Mar 16:30:00 - Using no proxy for connecting to Sauce Labs REST API.
08 Mar 16:30:00 - Resolving saucelabs.com to 162.222.73.28 took 17 ms.
08 Mar 16:30:01 - Started scproxy on port 37246.
08 Mar 16:30:01 - Please wait for 'you may start your tests' to start your tests.
08 Mar 16:30:01 - Starting secure remote tunnel VM...
08 Mar 16:30:11 - Secure remote tunnel VM provisioned.
08 Mar 16:30:11 - Tunnel ID: 3cc5fd5b59984957831d125617c7d4f6
08 Mar 16:30:11 - Secure remote tunnel VM is now: booting
08 Mar 16:30:14 - Secure remote tunnel VM is now: running
08 Mar 16:30:14 - Remote tunnel host is: maki76159.miso.saucelabs.com
08 Mar 16:30:14 - Using no proxy for connecting to tunnel VM.
08 Mar 16:30:14 - Resolving maki76159.miso.saucelabs.com to 162.222.76.159 took 48 ms.
08 Mar 16:30:14 - Starting Selenium listener...
08 Mar 16:30:14 - Establishing secure TLS connection to tunnel...
08 Mar 16:30:14 - Selenium listener started on port 4445.
08 Mar 16:30:16 - Sauce Connect is up, you may start your tests.
08 Mar 16:30:16 - Connection established.
[这里的单元测试...全部通过!]
[chrome #1] PID: 3621
[chrome #1] Specs: /home/travis/build/spamguy/diplomacy/e2e/main/main.spec.js
[chrome #1]
[chrome #1] Using SauceLabs selenium server at http://ondemand.saucelabs.com:80/wd/hub
[chrome #1] [31mF[0m
[chrome #1]
[chrome #1] Failures:
[chrome #1]
[chrome #1] 1) Home page should pass
[chrome #1] Message:
[chrome #1] [31mError: Angular could not be found on the page http://localhost:9000/ : retries looking for angular exceeded[0m
[chrome #1] Stacktrace:
[chrome #1] Error: Angular could not be found on the page http://localhost:9000/ : retries looking for angular exceeded
[chrome #1] ==== async task ====
[chrome #1] Protractor.get(http://localhost:9000/) - test for angular
[chrome #1] at [object Object].<anonymous> (/home/travis/build/spamguy/diplomacy/e2e/main/main.spec.js:7:13)
[chrome #1] ==== async task ====
[chrome #1] Asynchronous test function: beforeEach()
[chrome #1] Error
[chrome #1] at [object Object].<anonymous> (/home/travis/build/spamguy/diplomacy/e2e/main/main.spec.js:6:3)
[chrome #1] at Object.<anonymous> (/home/travis/build/spamguy/diplomacy/e2e/main/main.spec.js:3:1)
[chrome #1]
[chrome #1] Finished in 11.877 seconds
[chrome #1] [31m1 test, 2 assertions, 1 failure
[0m[chrome #1]
[chrome #1] SauceLabs results available at http://saucelabs.com/jobs/c0eed61d95044f77b200a7b21d2443a3
[launcher] 1 instance(s) of WebDriver still running
[另外两个 WebDriver 实例因类似错误而失败]
最佳答案
FWIW,我最终让一切正常工作。我没有做出“单一修复”,因此我无法轻松地阐明解决方案。以下文件是from my repository with which I set up continuous integration .
exports.config = {
// sauce plz
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
baseUrl: 'http://localhost',
specs: ['e2e/**/*.po.js', 'e2e/**/*.spec.js'],
framework: 'jasmine',
maxSessions: 1,
allScriptsTimeout: 40000,
getPageTimeout: 40000,
rootElement: 'html',
multiCapabilities: [
capabilitiesForBrowser('chrome', '41'),
capabilitiesForBrowser('firefox'),
capabilitiesForBrowser('safari')
],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 360000,
includeStackTrace: true
}
};
function capabilitiesForBrowser(browserName, browserVersion) {
var capabilities = {
'browserName': browserName,
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'dipl.io'
};
if (browserVersion)
capabilities.version = browserVersion;
return capabilities;
}
protractor: {
travis: {
options: {
configFile: 'protractor-travis.conf.js',
args: {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY
}
}
},
local: {
options: {
configFile: 'protractor-local.conf.js'
//,debug: true
}
}
}
language: node_js
node_js:
- '0.12'
services:
- mongodb
env:
global:
- secure: ioYHs4gjuL9iuwxamtKCkERvvSiBlAgxhLZ1Ry4xrZhNWe3e4pett3249hWovDYzG/eEHTA20/NDvZ1JIMYODFzY4gURVHNtUkoYNokLSDguTH1OPXGMmtQzJGersxYQOjRj3gSss7Z0joUrcfPQJsG1Vt0eHR/ewN7Qbm8NBn0=
- secure: NH3WbHM2Ir95csdWAdd7/ISYVvnYFQe7Rv4rCoYu9V6V2M9AzlARYTAvBqoK7PdD/RV0KR41t6OVeUxBVhuzT26NvBVZVyLcvfjK29AoKCDCU7VD7nQa/RQ9KyDr5DAHfyQQ5AQMhsla5qPTaFZb82F83lL44nDzrvYzE8CEaGw=
before_install:
- npm install -g bower
- bower install
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
- npm install -g grunt-cli
script:
- grunt test:protractor-travis
关于angularjs - 集成 Travis/Sauce Labs 时“找不到 Angular”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28929547/
我正在尝试在 Windows 上运行的小于 1GB 的 VM 上设置 YouTrack 和 TeamCity。使用率将非常低(用户和请求)。这是一个 POC 环境,如果它有效,我可能会将它推送到一个超
所以我在尝试使用 FORFILES 解决这个问题时遇到了麻烦。我正在尝试获取不超过 4 天的文件。所以基本上少于 4 天。然而,这似乎不太可能,因为/d -4 获取所有 4 天或更早的项目。 以下是我
如何从下面的 events 表中选择小于 15 分钟前创建的 events? CREATE TABLE events ( created_at timestamp NOT NULL DEFAU
Google Analytics Realtime提供 rt:minutesAgo ,可以过滤查询。 然而,它是一个维度而不是一个度量标准,<=不能在过滤器中使用。 假设我想在最后 n 分钟内获得一些
iOS 核心数据 - 严重的应用程序错误 - 尝试插入 nil 你好, 我的应用程序实际上运行稳定,但在极少数情况下它会崩溃并显示此错误消息... 2019-04-02 20:48:52.437172
我想制作一个 html div 以快速向右移动(例如不到 1 秒)并消失。然后1秒后再次直接出现在这个过程最开始div的位置。此过程将由单击按钮并重复 10 次触发。 我试图在 CSS 中使用过渡属性
我发现使用 TimeTrigger 是 Windows 10 (UWP) 上计划后台任务的方式。但是看起来我们需要给出的最小数字是 15 分钟。只是想知道,即使我们安排它在接下来的 1 分钟内运行,警
我必须在 1 秒内在屏幕上打印 2^20 行整数 printf 不够快,还有其他易于使用的快速输出替代方法吗? 每一行只包含 1 个整数。 我要求它用于竞争性编程问题,我必须将其源代码提交给法官。 最
我是一名优秀的程序员,十分优秀!