草庐IT

cucumber-js

全部标签

ruby - 在 rspec(和 cucumber )中测试 rake 任务

我是Ruby的新手,我一直在尝试学习Rake、RSpec和Cucumber。我找到了一些可以帮助我测试Rake任务的代码,但我无法让它正常工作。有人告诉我:http://blog.codahale.com/2007/12/20/rake-vs-rspec-fight/放弃这个:defdescribe_rake_task(task_name,filename,&block)require"rake"describe"Raketask#{task_name}"doattr_reader:taskbefore(:all)do@rake=Rake::Application.newRake.ap

ruby - cucumber / capybara vs Selenium ?

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题?更新问题,以便editingthispost可以用事实和引用来回答它.关闭8年前。Improvethisquestion前几天,我向我公司的一位测试人员展示了我用Cucumber编写的一些测试(2个功能,5个场景)。然后他问了我无法回答的问题:Howisthisbetterthanseleniumoranyotherfunctionalitytestrecordingtool?我知道Cucumber是一种不同的技术,它处于不同的测试级别,但我不明白为什么我要费心编写和维护Cucumber/Capybara测

ruby - 断言 Cucumber 中抛出了一个特定的异常

场景我正在编写一个库(没有RubyonRails),我想为其提供非常详细的Cucumber功能。这尤其包括描述在各种情况下应该抛出的错误/异常。示例编写Cucumber步骤最直观的方式可能是这样的WhenIdosomethingunwantedThenan"ArgumentError"shouldbethrown问题我必须解决两个问题:抛出异常时,第一步不应失败。第一步抛出的异常应该可供第二步访问,以便执行一些断言魔法。不优雅和繁琐的解决方案我能想到的最佳方法是在第一步中缓存异常并将其放入第二步可以访问的实例变量中,如下所示:When/^Idosomethingunwanted$/do

ruby-on-rails - cucumber 和 capybara ,如何打开外部网址或访问外部网址

我用的是cucumber和capybara。在rails3.0.9平台中。我得到这个测试用例失败:日志是:(::)failedsteps(::)Noroutematches"/wiki/Baltimore_Ravens"(ActionController::RoutingError):10:in`synchronize'./features/step_definitions/web_steps.rb:20:in`/^(?:|I)amon(.+)$/'features/annotate.feature:7:in`GivenIamonawebpage'FailingScenarios:cu

ruby - Hook 后的 cucumber "puts"不输出任何内容

在Cucumber中,在我的env.rb文件中,我设置了一个before&afterHook(好吧,其中一些,一些链接到特定标签)但是发现afterHook不当我在其中放入puts时,不会输出任何内容。例如,这个有效:Beforedoputs"beforethescenario"end但这不是:Afterdoputs"afterthescenario"end似乎after钩子(Hook)确实运行了(因为在after钩子(Hook)中有一行我遇到了问题&在尝试调试它时,我发现了这个问题)但它们只是没有输出任何东西。我所有的搜索都没有结果,找不到其他有类似问题的人。谁能告诉我是否做错了什么

ruby-on-rails - 菠菜与 cucumber 在 Rails 中的 BDD

我开始使用BDD。想知道从cucumber或菠菜开始哪个更好。我的印象是菠菜是现成的新菜。看here我应该从哪一个开始。标准是-全面支持。使用灵活第三方工具和API集成。对于新手来说,这可能又是一个无知的问题:capybara在图片中的位置。 最佳答案 在某些情况下,我一直是Cucumber的长期用户,但从第一天起就一直希望它是Spinach。尽管Spinach有缺点,但我正在将我所有的项目切换到Spinach,因为它使用了新的、现成的PORO技术(PlainOldRubyObjects;)。现在我可以随心所欲地扩展我的步骤,因为它

【笔记】internal/modules/cjs/loader.js:985 throw err; ^ Error: Cannot find module ‘node:util‘

[root@localhostusr]#cnpm-vinternal/modules/cjs/loader.js:985throwerr;^Error:Cannotfindmodule‘node:util’Requirestack:/usr/local/node/lib/node_modules/cnpm/bin/cnpmatFunction.Module._resolveFilename(internal/modules/cjs/loader.js:982:15)atFunction.Module._load(internal/modules/cjs/loader.js:864:27)atM

ruby - Capybara 麻烦填写 JS 模态

首先让我确认这不是重复的(因为那里发布的答案没有解决我的问题)。Thispost本质上是我的确切问题:Capybara无法在Stripe模式中找到表单字段来填写它们。这是我的capybara规范:describe'checkout',type::feature,js:truedoit'checksoutcorrectly'dovisit'/'page.shouldhave_content'Amount:$20.00'page.find('#button-two').click_button'PaywithCard'Capybara.within_frame'stripe_checkou

ruby - REST API 测试 cucumber 步骤最佳实践

尝试为RESTAPI测试编写cucumber功能步骤。我不确定哪种方法更好:GivenIloginwithusernameandpasswordWhenIaddone"tv"intomycartAndIcheckmycartThenIshouldseetheitem"tv"isinmycart或GiventheclientauthenticatewithusernameandpasswordWhentheclientsendPOSTto"/cart/add"withbody"{item:body}"Thentheresponsecodeshouldbe"200"Andtherespon

javascript - Rails js.erb 文件找不到方法 "render"

我在JavascriptERB文件中有以下代码:$(document).ready(function(){$("#workout-week").append("show_training_period",:locals=>{:period=>@period})%>);});当我到达View时,出现以下错误:undefinedmethod`render'for#:0x00000005dbfe98>partial存在,局部变量非nil。知道为什么会发生这种情况吗?堆栈跟踪:app/assets/javascripts/slider.js.erb:2:in`evaluate_source't