node.js - Webdriver Selenium 测试通过但应该失败
问题描述
我正在使用 Nodejs、Webdriverio、wdio.conf.js 和测试。
当我运行我的测试时:
describe('Admin Interface', function() {
it('should have the correct header title', function *() {
var header = yield browser.getText('h1');
header.should.be.equal('blahblah');
});
});
..它通过了......即使它不应该(标题错误)
[Chrome 48.0 Windows 10 #0-0] Running: Chrome (v48.0) on Windows 10
[Chrome 48.0 Windows 10 #0-0]
[Chrome 48.0 Windows 10 #0-0] Admin Interface
[Chrome 48.0 Windows 10 #0-0] √ should have the window title based on user
settings
[Chrome 48.0 Windows 10 #0-0] √ should have the correct header title
[Chrome 48.0 Windows 10 #0-0] 2 passing (3s)
这是我的 wdio.conf.js
exports.config = {
specs: [
'./test/views/admin/**.test.js',
],
capabilities: [{
browserName: 'Chrome',
browser_version: '48.0',
os: 'Windows',
os_version: '10',
resolution: '1024x768',
'browserstack.local': true,
'browserstack.debug': true
}],
baseUrl: 'http://localhost:5000',
(and some more...)
}
为什么我的测试通过了?什么时候不应该?..就像我可以写任何东西,它仍然会通过..
解决方案
当我删除产量和功能时它工作*
describe('Admin Interface', function() {
it('should have the correct header title', function () {
var header = browser.getText('h1');
header.should.be.equal('blahblah');
});
});
现在测试失败
推荐阅读
- asp.net-mvc - 我可以在服务器端中止大型 FileStreamResult 下载吗?
- c# - 从 C# 中的文本文件一次读取 10 行
- active-directory - 使用 id 命令的问题
- macos - Mac os - brew install unrar 失败
- r - 如何在R中的循环中获得0或“NA”
- php - 无法在 Laravel Framework 5.5.50 上安装 jenssegers/mongodb,MongoDB 服务器版本:3.6.8
- amazon-web-services - 使用选定字段重新索引 ElasticSearch 会导致添加未选定的空字段
- powershell - 将 Powershell 提升为管理员并保留传递的参数
- java - 如何在 Android 9 的屏幕专用区域启动 3rd-party 应用程序?
- html - 隐藏 div 之外的图像