cucumber

Cucumber steps not automatically loaded when running features

泄露秘密 提交于 2019-12-10 12:37:04
问题 I have recently updated the Cucumber gems ('cucumber' and 'cucumber-rails') on my machine and have run into a couple of issues. The one i am currently fighting is that none of the defined steps for my features are being automatically loaded by Cucumber. This results in my command line telling me i "can implement step definitions for undefined steps with these snippets" for every single step i use in my features. I have run: cucumber --verbose ...and can see the following: Code: * vendor

Cucumber high-level step definition - syntax error, unexpected tIDENTIFIER, expecting keyword_end

╄→гoц情女王★ 提交于 2019-12-10 12:26:44
问题 I've followed Reuse Cucumber steps. I'm a noob when it comes to Ruby and Cucumber. I'm using calabash-android 0.9.0 and cucumber 2.4.0 My calabash_steps.rb: require 'calabash-android/calabash_steps' Then /^I add the 1st bestsellers product to bag$/ do steps %Q { # App restarts and Onboarding screen shows again Given I see the text "next" Then I press the "next" button } end Full stacktrace: ❯ bundle exec calabash-android run app/build/outputs/apk/app-staging-debug.apk -t @bag /Users/eric

Selenium - Script should wait till browser is closed manually

半城伤御伤魂 提交于 2019-12-10 11:46:33
问题 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 回答1: 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

Alternate way to run Cucumber without JUnit?

亡梦爱人 提交于 2019-12-10 11:38:22
问题 Is there any alternate way to run the cucumber without Junit. Is that any possible way to run cucumber as a Java application.. like if I create a main() method and control all step definitions over there? Any help will be awesome 回答1: The answer is out of date. The cucumber docs have this to say, "Running Cucumber There are several ways to run scenarios with Cucumber-JVM: JUnit Runner CLI Runner Android Runner Third party runners " 回答2: Cucumber JVM can be invoked from command line. So the

setUp and tearDown for Scenrio outline (cucumber-jvm)

大兔子大兔子 提交于 2019-12-10 11:36:29
问题 i'm using scenario outline in my code and wanted to execute some code before the start of scenario outline and some code after the scenario outline execution has completed. I know there are @Before and @After annotations in cucumber but these gets executed before and after every scneario. So if I have a scenario outline and 3 rows of example data then @Before and @After will be executed each of then i.e. total 3 times each. But I want to execute it only once, @Before scenario outline and

Element must be user-editable in order to clear it (Behat)

左心房为你撑大大i 提交于 2019-12-10 11:27:55
问题 I am automating a website using the Behat framework, working in PHPStorm, have the latest chromedriver and selenium jar up and running: I cant seem to interact with standard Date fields across the site e.g: input type="date" ng-show="options.editEnabled" Feature file: Then I select a start date of "01012014" public function startDate ($date) { $this->getElement('startDate')->setValue($date); } Returns an error of invalid element state: Element must be user-editable in order to clear it. I

How to implement 'if' in Gherkin

僤鯓⒐⒋嵵緔 提交于 2019-12-10 11:26:22
问题 I am trying to convert Selenium test to Gherkin. Is there way to implement if statements in Gherkin? Example : assume the code is written in the below format. I am just writing description as below. Please understand the part after double slash is the actual Selenium code: // launch the application // login to application // navigate to page String str; if(str== "XYZ") { // verify title } //verify text field 1 //verify test field 2 //verify select box For this I am trying to write code in

How to get gradle and cucumber working together?

扶醉桌前 提交于 2019-12-10 11:15:23
问题 Getting gradle to work with cucumber cleanly is something of a challenge. I want to get gradle build to compile and run the tests, but so far I've had no success. build.gradle plugins { id "com.github.samueltbrown.cucumber" version "0.9" } apply plugin: 'java' apply plugin: 'idea' def JAVA_WEBSOCKET_VERSION = '1.2.1' def CUCUMBER_VERSION = '1.2.4' jar { manifest { attributes 'Implementation-Title': 'Java-WebSocket', 'Implementation-Version': JAVA_WEBSOCKET_VERSION } } repositories { jcenter()

database cleaner transaction with cucumber rails

試著忘記壹切 提交于 2019-12-10 10:58:05
问题 I am writing a scenario for signup form. @abc @selenium Scenario:Non registered user signs up Given I am on the sign-up page When I fill in the following: |first_name|Anidhya| |last_name|Ahuja| |email|anidhya@gmail.com| |password|123456| And I press "submit" Then I should see "Registration complete" I want to use database cleaner to roll back the test database after this scenario so that I can use this scenario again and again. For that inside my env.rb file I wrote: begin require 'database

Handling exceptions on cucumber scenarios

空扰寡人 提交于 2019-12-10 10:57:24
问题 I'm suffering from selenium's awkward behavior for alert boxes described here. Until this is resolved I need to rescue from Selenium::WebDriver::Error::UnhandledAlertError . This is easily done when I've created the step where the exception originates: I plop in a rescue block and it works fine. But what if the step is an existing one that I want to rescue from, in this case, checking a checkbox? I can't do anything at this level--can I?--so I thought adding a tag to the scenario and an