bdd

Cucumber::Undefined error something to worry about?

时光总嘲笑我的痴心妄想 提交于 2020-01-25 05:25:20
问题 My cucumber feature file is as follows Feature: Create and Manage Videos In order to record a video As a registered user I want to create and manage videos Scenario: sent videos list Given I have sent video titled "Happy Birthday" to "My Friend X" When I go to my outbox list of videos Then I should see "Happy Birthday" video And I should see "My Friend X" I run cucumber using the following command cucumber features I get the following output Using the default profile... Feature: Create and

Cucumber regex step definition

一笑奈何 提交于 2020-01-25 02:46:23
问题 Can someone explain what is the difference between @When("some text (.*)") and @When("^some text ([^\"]*)$") ? The former worked when using a straightforward step, but when using a data table it maps only to the first table item. 回答1: Here is explanation of couple of common regex : .* matches anything (or nothing), literally “any character (except a newline) 0 or more times” .+ matches at least one of anything [0-9] or d matches a series of digits (or nothing) [0-9]+ or d+ matches one or more

When writing a BDD feature, should I put previous user interaction into a Given step, or a When step?

家住魔仙堡 提交于 2020-01-22 20:34:18
问题 I am trying to write requirements for a multi-step business process (via a wizard). I have many scenarios where user interactions with one screen will change whether you are allowed to pick options on another screen. For example (I've obscured the actual business, but the process and form of the steps is nearly identical): Feature: Personal Diagnostic Search Filter In order to select a Technician who offers Personal Diagnostics, when I've asked for a Personal Diagnostic As a Business Customer

Cucumber `press button` failure (Capybara::ElementNotFound)

旧时模样 提交于 2020-01-15 05:41:07
问题 I'm a relative newbie starting up a new Ruby on Rails app. I started by following a combination of instructions at https://github.com/intridea/omniauth, http://www.communityguides.eu/articles/16, http://intridea.com/2011/1/31/easy-rails-admin-login-with-google-apps-and-omniauth?blog=company . At the point everything appeared to work correctly, I started to write my very first cucumber features and steps. I was able to get a couple of steps up and running, but I've been bogged down on a step

How to use Cucumber to test non-Ruby, non-Rack API's

不羁的心 提交于 2020-01-13 19:00:28
问题 I use cucumber for lots of things. I really like it as a BDD environment. So I'd like to use it as an external tool to test an API. I'd like to do things like: Scenario: Hit api /info path and get info back When I visit the API path '/info' Then I should see the following text "Here's info on the API" or something similar. I mainly want to treat the API as a black box and test only inputs and outputs. I don't plan on inspecting anything inside the API. Most of the libraries I've looked at

Lettuce(基于Python的BDD工具)

三世轮回 提交于 2020-01-13 03:44:30
一、Lettuce介绍 BDD 了解lettuce需要先了解BDD,BDD是TDD的一种衍生,通过特定的BDD框架,用自然语言或类自然语言,按照编写用户故事或者用户用例的方式,以功能使用者的视角,描述并编写测试用例。 BDD源于TDD并优于测试驱动开发。 之所以说BDD优于测试驱动开发,并非空穴来风,主要原因如下: 更加以人为本:TDD更多关注于测试接口实现逻辑正确性,而BDD重点关注用户使用功能时的行为和结果是否与符合预期。 更加以人为本:TDD基本上是使用编程语言来描述测试用例,而BDD则是用自然语言来描述测试用例。 更加以人为本:TDD不关注客户价值,而BDD从客户价值开始书写 更加以人为本:TDD的需求文档和测试用例是分别存储的,而BDD的需求文档就是测试用例 更加以人为本:TDD要求所有被覆盖的接口都要进行良好重构,而BDD只要求对暴露给客户使用的接口甚至UI具有可测试性 更加以人为本:TDD更多是团队纪律或者领导推动的,而BDD是客户需求拉动的 Lettuce 学习BDD(行为驱动开发),业界流行的BDD框架是Ruby语言编写的Cumumber,不过对于用Python习惯的朋友可以学习一下Cumumber在Python下的衍生品-Lettuce。 lettuce 除了 官方文档 外,几乎找不到其它资料,为了理解lettuce,我们不妨多去看看cucumber 的资料

How does the “element(selector, label).query(fn)” method work in Angular E2E tests?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-13 03:42:26
问题 When writing E2E tests for Angular Scenario Runner I came across a query() method: element(selector, label).query(fn) The documentation says: Executes the function fn(selectedElements, done), where selectedElements are the elements that match the given jQuery selector and done is a function that is called at the end of the fn function. The label is used for test output. So I wrote an it-case for a set of buttons on my html-page: it('should display all buttons on page load', function () { var

高效测试框架推荐之Ginkgo

*爱你&永不变心* 提交于 2020-01-12 18:16:02
自2015年开始,七牛工效团队一直使用Go语言+ Ginkgo 的组合来编写自动化测试用例,积累了大约5000+的数量。在使用和维护过程中,我们觉得Ginkgo的很多设计理念和功能非常赞,因此特分享给大家。 本篇不是该框架的入门指导。如果您也编写或维护过大量自动化测试用例,希望能获得一些共鸣. BDD(Behavior Driven Development) 要说Ginkgo最大的特点,笔者认为,那就是对BDD风格的支持。比如: Describe("delete app api", func() { It("should delete app permanently", func() {...}) It("should delete app failed if services existed", func() {...}) It's about expressiveness。Ginkgo定义的DSL语法(Describe/Context/It)可以非常方便的帮助大家组织和编排测试用例。在BDD模式中,测试用例的标题书写,要非常注意表达,要能清晰的指明用例测试的业务场景。只有这样才能极大的增强用例的可读性,降低使用和维护的心智负担。 可读性这一点,在自动化测试用例设计原则上,非常重要。因为测试用例不同于一般意义上的程序,它在绝大部分场景下,看起来都像是一段段独立的方法

What are the differences between JBehave and Cucumber?

白昼怎懂夜的黑 提交于 2020-01-11 15:31:47
问题 I have read somewhere that JBehave is actually the Java equivalent of Cucumber, whereas Cucumber is based on Ruby. Can someone describe the differences between them provide links that do? 回答1: JBehave and Cucumber are completely different frameworks, although meant for the same purpose: acceptance tests. They are based around stories (JBehave) or features (Cucumber). A feature is a collection of stories, expressed from the point of view of a specific project stakeholder. In your tests, you

ATDD versus BDD and the proper use of a framework

南楼画角 提交于 2020-01-11 15:26:18
问题 I am just getting into the concept of BDD and have listened to Scott Bellware's talk with the Herding Code guys. I have been playing around with SpecFlow some and like it pretty well. I understand the distinction between ATDD and TDD as described in the blog post Classifying BDD Tools (Unit-Test-Driven vs. Acceptance Test Driven) and a bit of BDD history, but that leads me to a question. As described, isn't using a BDD tool (such as MSpec) just another unit testing framework? It seems to me