Tag: cucumberjs

我怎样才能看到在黄瓜JS错误的头?

我正在尝试使用一个咕噜触发的Cucumber JS任务与nodeJS的一些BDD,这是工作正常,但我不想看到一个testing,我知道当然会失败,完整的JSexception堆栈。 相反,我宁愿只看到exception的(更有用的)头。 这看起来可能微不足道,但我相信BDD最好的实现是通过这些工具的快速反馈。 作为一个例子,下面是来自一个模块的基本缺失方法的完整堆栈跟踪: TypeError: Object #<Object> has no method 'delete' at World.<anonymous> ($HOME/features/step_definitions/delete-item.steps.js:20:21) at Object.invoke ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/support_code/step_definition.js:84:14) at Object.execute ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/ast/step.js:157:22) at Object.acceptVisitor ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/ast/step.js:149:12) at Object.executeStep ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:178:12) at Object.processStep ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:173:14) at $HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:66:16 at callUserFunctionAndBroadcastAfterEvent ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:90:9) at iterate ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/type/collection.js:14:11) at Object.forEach ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/type/collection.js:23:7) at broadcastToListeners ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:117:19) at onRuntimeListenersComplete ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:113:9) at iterate ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/type/collection.js:14:11) at $HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/type/collection.js:20:11 at hear ($HOME/node_modules/grunt-cucumber/node_modules/cucumber/lib/cucumber/listener.js:8:9) […]

将多个格式化程序传递给cucumberjs的正确方法

我试图通过多个格式化程序到我的cucumberjs CLI亚军,我希望,都打印到控制台,并生成一个JSON文件。 我正在使用cucumberjs v0.8.0 我试过的东西: var format = "json:out.json" //works fine out.json is generated var format = "json:out.json, pretty" // out.json is generated, however pretty console output doesn't exist. var format = ["json:out.json, pretty"] // fails to parse

运行cucumberjs ft。selenium,phantomjs,webdriverio时出错

我已经在全球安装了phantomjs npm install -g phantomjs 用java -jar selenium-standalone-2.52.0.jar启动selenium 像这样正确configurationcucumber的World对象: var options = { //desiredCapabilities: { browserName: 'internet explorer' }, // WORK //desiredCapabilities: { browserName: 'chrome' }, // WORK desiredCapabilities: { browserName: 'phantomjs' }, // NOT WORK waitforTimeout : 2000, host: '127.0.0.1', port: 4444 }; this.browser = webdriverio.remote(options); 它与Chrome&IE一起工作,但幻灯片失败。 这是我从Selenium控制台得到的错误: 错误 – org.apache.commons.exec.ExecuteException:执行失败(退出值:-559038737。由java.io.IOException引起:无法运行程序“C:\ Program Files(x86)\ nodejs […]

无效的定位器错误

我试图在页面对象样式中重写我的testing,但出现了一些问题。 我使用类选项卡,这是我的代码的一部分: var World = require('../support/world.js'); const isAllAjaxRequests = require('../scripts/util').isAllAjaxRequests; const isElementLocatedAndVisible = require('../scripts/util').isElementLocatedAndVisible; module.exports.Tab = class Tab { constructor(data) { this.name = "Base"; this.locators = { 'nextStepIsLocked': {xpath: '//md-tab-item[@aria-selected="true"]//div[@class="cc-status red"]'}, 'isActiveTab': {xpath: '//md-tab-item[@aria-selected="true"]//span[text()="'+ data + '"]'} } } waitForElement(bySelector) { var driver = World.getDriver(); var self = this; //var bySelector = self.locators[bySelector]; return driver.wait(isAllAjaxRequests(driver), […]

如何在webdriver.io中以32位模式启动IE

我正在使用gulp-wdio npm pakage在selenium独立上运行WebDriver.iotesting 我运行的代码是: gulp.task('e2e', function () { return gulp.src('wdio.conf.js') .pipe(wdio({ wdio: { specs: './test/features/**/*.feature' } })); }); 而我的wdio.conf.js这样定义浏览器: capabilities: [ { browserName: 'internet explorer', version: 'ANY' } ], 如何打字很慢 ,我在互联网上发现运行32位版本的networking驱动程序解决了这个问题,我怎么也找不到如何configurationfunction或其他地方来运行IE32位驱动程序默认情况下…任何帮助将不胜感激@ 🙂

量angular器configuration文件:cucumberOpts标签不单独采取或忽略

我正在使用下面的configuration文件。 /*EC:201611*/ var featsLocation = 'features/'; var stepsLocation = 'steps/'; exports.config = { params:{ authURL:'http://localhost:3333', login:{ email:'', passw:'' } }, resultJsonOutputFile:'', getPageTimeout: 60000, allScriptsTimeout: 500000, framework: 'custom', frameworkPath: require.resolve('protractor-cucumber-framework'), capabilities: { 'browserName': 'phantomjs', 'phantomjs.binary.path': '/srv/build/applications/phantomjs/bin/phantomjs' }, specs: [ featsLocation+'ediRejects.feature' , featsLocation+'shipmentValidation.feature' ], baseUrl: '', cucumberOpts: { tags: ['@Smoke','@Intgr'], require: [ stepsLocation+'ediRejects/ediRejects.spec.js' , stepsLocation+'shipmentValidation/shipmentValidation.spec.js' , stepsLocation+'appointmentsOverdue/appointmentsOverdue.spec.js' […]

在多个浏览器上运行testing(按顺序)

我目前只使用Chrome(驱动程序)进行testing。 我想用Firefox和Safari来testing它。 一个接一个,不能并行。 这是我开始testing的重要任务: gulp.task('test', function() { return gulp.src('*test/features/*').pipe(cucumber({ 'steps': '*test/features/steps/*.js' })); }); 一个简单的function文件: Feature: UI Testing UI Scenario: Check the title of the page When I open the homepage Then I should see "Test – IntApp" in the title 和步骤文件: const chrome = require('selenium-webdriver/chrome'); const webdriver = require('selenium-webdriver'); const assert = require('assert'); module.exports = […]

我怎样才能得到在cucumber.js的AfterStep钩子的步骤结果

如标题所示,如何在cucumber.js的AfterStep钩子中find一个步骤的结果?

和谐旗帜在Webstorm中运行CucumberJStesting?

我只是想知道是否可以在我们现有的代码库中获得一些ES6的好处,尽pipe如此,但是当我从webstorm启动我们的黄瓜jstesting时,却爆发出了ES6语法。 那么有没有其他人得到这个工作? 我曾尝试添加–harmony的CucumberJs的参数,但没有运气:(

Cucumber-js TypeError:e.scrollIntoView不是一个函数

我尝试设置cucumber-js https://github.com/cucumber/cucumber-js时遇到了同样的exception function:示例function 作为Cucumber.js的用户,我希望在Cucumber上有文档,以便我可以专注于构build真棒应用程序 场景:阅读文档#features \ my_featue.feature:8鉴于我在Cucumber.js GitHub存储库#features \ step_definitions \ my_step_definitions.js:4 TypeError:e.scrollIntoView不在n( https:// assets- cdn.github.com/assets/github-30a28ef79b52e130ca6c7a146955fad76599bfdde471ee6896f356fb1ae94a56.js:2:10072 )在Object.r [as scrollToFragmentTarget]( https://assets-cdn.github.com/assets/github-30a28ef79b52e130ca6c7a146955fad76599bfdde471ee6896f356fb1ae94a56.js:2:10169 )在https://assets-cdn.github.com/assets/github-30a28ef79b52e130ca6c7a146955fad76599bfdde471ee6896f356fb1ae94a56.js:2:10882在r( https://assets-cdn.github.com/assets/frameworks-bebe77cf3c6ad6033e7df85a57952b158d1d0fadbe3590af19a960b00413bbec.js:6: 16866 )at https://assets-cdn.github.com/assets/frameworks-bebe77cf3c6ad6033e7df85a57952b158d1d0fadbe3590af19a960b00413bbec.js:6:16231 at s( https://assets-cdn.github.com/assets/frameworks-bebe77cf3c6ad6033e7df85a57952b158d1d0fadbe3590af19a960b0041 (C:\ Users \ mayank.arora \ Documents)中的HTMLDocument.a( https://assets-cdn.github.com/assets/frameworks-bebe77cf3c6ad6033e7df85a57952b158d1d0fadbe3590af19a960b00413bbec.js:6:15916 ) \ tutorials \ 112_NodeJS \ Cucumber \ node_modules \ jsdom \ lib \ jsdom \ events \ EventTarget.js:170:34)在dispatchPhase(C:\ Users […]