cucumber

Cucumber + parallel_tests. HTML results?

£可爱£侵袭症+ 提交于 2019-12-19 06:14:08
问题 I currently try to implement parallel_tests for our Cucumber + Watir-WebDriver acceptance tests. As far it goes great. However, we got used to nice HTML reports from Cucumber with embedded screenshots of failed scenarios. Cucumber creates reports as a single HTML file with all the features. But with parallel_tests, this HTML file is overwritten with the last called Cucumber process and thus incomplete. Is it possible to generate several HTML reports or generate HTML reports per features file?

Take a screenshot with Cucumber

你说的曾经没有我的故事 提交于 2019-12-18 18:38:28
问题 I just learn how to use cucumber. Can you tell me how to complete this code? You can implement step definitions for undefined steps with these snippets: Then /^I take a screenshot$/ do pending # express the regexp above with the code you wish you had end 回答1: Screenshots in general are taken when something unexpected occurs. You may also want to capture a screenshot to report when a test case fails. In this particular case, you should have screenshot capture logic in an @After method that

How to share state between scenarios using cucumber

巧了我就是萌 提交于 2019-12-18 16:59:58
问题 I have a feature "Importing articles from external website". In my first scenario I test importing a list of links from the external website. Feature: Importing articles from external website Scenario: Searching articles on example.com and return the links Given there is an Importer And its URL is "http://example.com" When we search for "demo" Then the Importer should return 25 links And one of the links should be "http://example.com/demo.html" In my steps I have the 25 links in a @result

Cucumber for PHP application

大城市里の小女人 提交于 2019-12-18 12:18:37
问题 Is it possible to use Cucumber outside Rails? I'd like to start using it for testing some of my PHP applications, but I really don't know how to start. Probably the easiest way would be creating a Rails project only to run Cucumber features, but that seems like to me as overkill. What is the simplest way to set up Cucumber for testing a non-Rails application? 回答1: Check out: https://github.com/cucumber/cucumber/wiki/php It is easy to use cucumber with PHP, even managing the database. 回答2:

Cucumber for PHP application

流过昼夜 提交于 2019-12-18 12:18:02
问题 Is it possible to use Cucumber outside Rails? I'd like to start using it for testing some of my PHP applications, but I really don't know how to start. Probably the easiest way would be creating a Rails project only to run Cucumber features, but that seems like to me as overkill. What is the simplest way to set up Cucumber for testing a non-Rails application? 回答1: Check out: https://github.com/cucumber/cucumber/wiki/php It is easy to use cucumber with PHP, even managing the database. 回答2:

How to find Cucumber steps that are not used

孤街醉人 提交于 2019-12-18 11:45:18
问题 I've been working with Cucumber for about a year and have been continually refactoring the features and step definitions along the way. I have tons of steps defined across many files and I can't help but feel like many of them are no longer needed. Is there a way to find which cucumber step definitions are no longer being used? 回答1: The stepdefs formatter can do this, e.g.: cucumber --dry-run -f stepdefs It will print 'NOT MATCHED BY ANY STEPS' for any non-matches. If you have any steps that

When running selenium with capybara/rails, how do I configure the server?

空扰寡人 提交于 2019-12-18 10:55:11
问题 Normally I use the rails dev server at port 3000. Capybara/Cucumber uses Capybara.server_port = 31337 . If I swap from the default driver to selenium, it looks like it tries to connect on port 80. I'm trying to understand: When using selenium, do I need to separately instantiate a test server on the test environment. If the answer to the above question is yes, how can I make it so I can seamlessly swap between web drivers without having to keep changing things? If someone has an example of a

Session variables with Cucumber Stories

风流意气都作罢 提交于 2019-12-18 10:24:12
问题 I am working on some Cucumber stories for a 'sign up' application which has a number of steps. Rather then writing a Huuuuuuuge story to cover all the steps at once, which would be bad , I'd rather work through each action in the controller like a regular user. My problem here is that I am storing the account ID which is created in the first step as a session variable, so when step 2, step 3 etc are visited the existing registration data is loaded. I'm aware of being able to access controller

Is there a way to slow down execution of Watir Webdriver under Cucumber?

坚强是说给别人听的谎言 提交于 2019-12-18 09:45:41
问题 Is there any way we can slow down the execution of Watir WebDriver under Cucumber? I would like to visually track the actions performed by Watir. At the moment, it goes too fast for my eyes. 回答1: While Watir itself does not have an API for slowing down the execution, you could use the underlying Selenium-WebDriver's AbstractEventListener to add pauses before/after certain types of actions. Given you want to see the result of actions, you probably want to pause after changing values and

AfterAll global hook cucumber-jvm

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 08:55:44
问题 I'm using cucumber-jvm in my integration tests and I need to execute some code after all scenarios are finished, just once. After reading carefully some posts like this and reviewed this reported issue, I've accomplished it doing something like this: public class ContextSteps { private static boolean initialized = false; @cucumber.api.java.Before public void setUp() throws Exception { if (!initialized) { // Init context. Run just once before first scenario starts Runtime.getRuntime()