bdd

How do you run cucumber with Scala 2.11 and sbt 0.13?

送分小仙女□ 提交于 2019-12-05 04:58:40
Does anyone have an example of a cucumber project with sbt 0.13 and Scala 2.11? Do I need both the cucumber-scala_2.11 and the sbt-cucumber-plugin" % "0.8.0" (is that plugin up to date)? Where does the plugin go now? Where do the .feature files go? Where do the cucumber tests go? How do I run the tests from sbt? (optional) How can I run the tests from IntellJ (15)? Ok, I figured out a solution with the following caveat: I'm not using sbt. Idea We will write cucumber features and steps first. Then we will write a "Runner" class, that will be run by JUnit runner (which will be oblivious to the

BDD, what's a feature?

前提是你 提交于 2019-12-05 04:05:46
I'm just starting with BDD and I'm trying to build a small app, so I can see it working in a real environment, but I'm having trouble deciding what should be a feature. I'm building a tiny shop. I decided that "Compare products" will be a feature and "User can checkout as guest" will be one, but to get to that, I first need to list products. My question is, should "There should be a list of products" be a feature? Thanks! It should probably be a feature, but try wording it from a user's point of view. What does this list of product offer him? User should be able to get an overview of offered

Handling Exceptions in Python Behave Testing framework

依然范特西╮ 提交于 2019-12-05 03:45:40
I've been thinking about switching from nose to behave for testing (mocha/chai etc have spoiled me). So far so good, but I can't seem to figure out any way of testing for exceptions besides: @then("It throws a KeyError exception") def step_impl(context): try: konfigure.load_env_mapping("baz", context.configs) except KeyError, e: assert (e.message == "No baz configuration found") With nose I can annotate a test with @raises(KeyError) I can't find anything like this in behave (not in the source, not in the examples, not here). It sure would be grand to be able to specify exceptions that might be

Using BDD in API automation testing is a good aproach?

不羁的心 提交于 2019-12-05 02:06:23
问题 I'm writing a framework for RESTful API test automation, I already decided to go with REST Assured, I'm not 100% sure about add a layer to allow define tests using a domain specific language like Gherkin, therefore adding a BDD framework like Cucumber. What is your opinion? Is a good approach to use BDD in API automation testing? 回答1: I am currently using BDD for RestAPI Testing. Here is pros and cons for BDD RestAPI Automation framework. Technology We used: Cucumber,Java,Rest-Assured and

Imperative and declarative steps in Rspec

泄露秘密 提交于 2019-12-05 01:39:26
问题 I wonder what imperative vs declarative steps in Rspec is all about. Here is an example code from the Rspec book: Scenario: transfer money (declarative) Given I have $100 in checking And I have $20 in savings When I transfer $15 from checking to savings Then I should have $85 in checking And I should have $35 in savings Scenario: transfer money (imperative) Given I have $100 in checking And I have $20 in savings When I go to the transfer form And I select "Checking" from "Source Account" And

Using Specflow scenarios for both intergration tests and unit tests

别等时光非礼了梦想. 提交于 2019-12-05 00:39:10
问题 I've just come across BBD and specflow and it looks very interesting. When writing user stories they are typically on a high-level and the actor users the GUI. So when writing scenarios they will typically be GUI test or integration test from a high level of the system. But what about unit test further down in the solution? E.g. service endpoints, business objects, etc. Should I write new scenarios for those or is there a way to reuse the same scenarios for low level testing (unit tests) or

Trying to understand Jasmine's toHaveBeenCalled() matcher

自闭症网瘾萝莉.ら 提交于 2019-12-04 23:55:58
I am new to jasmine here is my src file in which i create Auth class function Auth() { } Auth.prototype.isEmpty = function(str) { return (!str || 0 === str.length); } Auth.prototype.Login = function (username , password) { if (this.isEmpty(username) || this.isEmpty(password)) { return "Username or Password cann't be blank "; } else { return "Logged In !"; } } now i want to test jasmine's toHaveBeenCalled() matcher . Here is what i write it("should be able to Login", function () { spyOn(authobj); expect(authobj.Login('abc', 'abc')).toHaveBeenCalled(); }); but it says that undefined() method

How to integrate Spring into Cucumber

时光毁灭记忆、已成空白 提交于 2019-12-04 20:17:18
问题 I am currently trying to integrate Spring into my Cucumber tests. I have a custom SpringFactory as outlined in: http://www.zsoltfabok.com/blog/2012/01/cucumber-jvm-di/ but the code is not being called. What is the best way to 'hook up' the factory with my tests? [Clarification from comment on deleted answer: the main issue is that my test has Cucumber as the main runner, i.e. @RunWith(Cucumber.class) so cannot use the SpringJUnit4ClassRunner here. This is described in the link above but there

BDD - should each scenario be self contained?

旧巷老猫 提交于 2019-12-04 16:49:07
I have a BDD feature containing multiple scenarios. Should each scenario be completely self contained and runnable individually? Should be , yes. It is generally good practise in all forms of TDD (BDD included) to make sure that each "test" can run independently, and isn't coupled with or have a dependency on another test having been run first. This will help avoid creating a brittle test suite (i.e. one that is prone to breaking). That's not to say that you cannot chain readability together. For a very cheap/quick example: Feature: Users can register and log in Scenario: Should be able to

Cucumber can't find steps when running a single feature

天大地大妈咪最大 提交于 2019-12-04 15:42:56
I've just installed cucumber into a new rails project (first time setting it up from scratch) and it works wonderfully when running all tests ( bundle exec cucumber ) but can't find any of my steps when I run a single feature file. How might I start to debug this? rails (3.2.13) cucumber-rails (1.3.1) cucumber (>= 1.2.0) # file listing features/ ├── campaigns │ ├── donating_campaigns.feature │ └── viewing_campaigns.feature ├── step_definitions │ └── campaign_steps.rb └── support └── env.rb It will only find files at the same level or lower in the features directory tree. So if you try to run