cucumber

Is there a way to directly generate Step Definitions in Eclipse without Running Cucumber?

蹲街弑〆低调 提交于 2019-12-09 07:57:13
问题 Im doing integration testing with cucumber and Gradle in Eclipse. For now my workflow is Write a feature file Run it to generate step skeletons Copy and implement them This works good for new features and so on, but becomes quite bothersome if you have a large feature and implement new steps in the middle or towards the end. To get the new step skeletons I need to run the whole feature. Even with the dryRun = true option this takes up a long time. I have heard that IntellyJ can generate these

Shared WebDriver becomes null on second scenario using PicoContainer

最后都变了- 提交于 2019-12-09 07:16:15
问题 I have used the accepted solution here and came up with the following code: Referenced Libraries: Feature: Feature: FeatureA Scenario: ScenarioA Given When Then Scenario: ScenarioB Given When Then BaseStep: public class BaseStep { protected WebDriver driver = null; private static boolean isInitialized = false; @Before public void setUp() throws Exception { if (!isInitialized) { driver = SeleniumUtil.getWebDriver(ConfigUtil.readKey("browser")); isInitialized = true; } } @After public void

Test sorting with Cucumber and Capybara

青春壹個敷衍的年華 提交于 2019-12-09 06:54:35
问题 Is there a way to test sorting of a list with Cucumber and Capybara. The sorting is done client-side with javascript. I was thinking something along the lines of: Then I should see "first element" and then I should see "second element" Unfortunately I have no idea how to approach building the steps. Thanks for the help! 回答1: It's a good idea to separate out the stories that you're testing (which you want to get close to plain English) and the actual implementation of the testing (which is

Cucumber/Capybara test no longer run in Rails 3 project

帅比萌擦擦* 提交于 2019-12-09 05:38:54
问题 Do the latest versions of these gems not work with each other any more? It appears that something may have gotten out of whack in my bundle. undefined local variable or method `node' for #<Capybara::Driver::RackTest::Node:0x103e19390> (NameError) ./features/step_definitions/web_steps.rb:35 ./features/step_definitions/web_steps.rb:14:in `with_scope' ./features/step_definitions/web_steps.rb:34:in `/^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/' features/signing_in.feature:11:in `And I follow

Cucumber/Capybara vs Selenium? [closed]

£可爱£侵袭症+ 提交于 2019-12-09 04:38:52
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . The other day I was showing one of the testers at my company some tests I had written in cucumber (2 features, 5 scenarios). Then he asked me question that I could not answer: How is this better than selenium or any other functionality test recording tool? I understand that

List child elements for a Capybara/Poltergeist element

▼魔方 西西 提交于 2019-12-08 21:13:57
问题 I've searched around and I can't find a way to do this. We are running Capybara tests with the Poltergeist driver in cucumber features on an EmberJS/Rails app. I can't use page.driver.debug because I'm running inside a headless vagrant instance, so that troubleshooting is not available to me, but screenshots work, and a Chrome dev tools inspect on the page in question shows the right elements. I have a cucumber scenario that's failing, and it's because the find isn't working. My test looks

Can you review my Perl rewrite of Cucumber?

拜拜、爱过 提交于 2019-12-08 19:54:30
There is a team working on acceptance testing X11 GUI application in our company, and they created a monstrous acceptance testing framework that drives the GUI as well as running scenarios. The framework is written using Perl 5, and scenario files look more like very complex Perl programs (thousands of lines long with procedural-programming style) than acceptance tests. I recently learned Ruby's Cucumber, and generally have been using Ruby for quite a lot of time. But unfortunately I can't just shove Ruby to replace Perl because the people who are writing all of this don't know Ruby and it's

Selenium - Script should wait till browser is closed manually

依然范特西╮ 提交于 2019-12-08 19:47:28
I am using Java for selenium automation I have a scenario where I need to should move to next scenario in cucumber feature file only when I close the chrome browser manually for the current scenario. Please help me to implement this You can also do like this WebDriver driver = new ChromeDriver(); waitForDriverToClose(driver); waitForDriverToClose private static void waitForDriverToClose(WebDriver driver) { try { WebDriverWait wait = new WebDriverWait(driver, 20); wait.until(ExpectedConditions.not(new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { driver

Cucumber - Is it possible to share a table between Scenarios?

隐身守侯 提交于 2019-12-08 19:22:36
Does anyone know its its possible to define a table once in a .feature file & then access it from multiple scenarios? I'm not chaining scenarios but many of them do need to pass tables with the same data to their step definitions - also for this reason examples won't really do what I need here. Thanks! One possible solution is to tag all your scenarious where you need a table: @given_have_table Scenario: test Then I am happy Then bind Before hook to this tag and call step that declares your table from within Before hook definition: Before("@given_have_table") do steps Q%{ Given I have the

Protractor and Cucumber: function timed out using async/await

笑着哭i 提交于 2019-12-08 19:13:53
问题 I'm doing e2e and bdd tests using Angular 5, Protractor and Cucumber. When I run on terminal ng e2e I get the following error: When I open the page # e2e\steps\home.steps.ts:15 Error: function timed out, ensure the promise resolves within 5000 milliseconds In the line 15, I have: When(/^I open the page$/, async () => { await browser.get('http://localhost:49156'); }); Specifically, it is the line: When(/^I open the page$/, async () => { 回答1: Te answer is very simple. By default, Cucumber takes