cucumber

newbie can't define a method in ruby for cucumber test pass

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 22:15:31
问题 I am trying to learn cucumber, here's an example code from a book: class Output def messages @messages ||= [] end def puts(message) messages << message end end def output @output ||= Output.new end Given /^I am not yet playing$/ do end When /^I start a new game$/ do game = Codebreaker::Game.new(output) game.start end Then /^I should see "([^"]*)"$/ do |message| output.messages.should include(message) end When I run this spec, I get this error: Scenario: start game # features/codebreaker

wait_until block is giving time out error

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 21:27:33
问题 This is the code which is failing for me. link(:continue, :text => 'Continue Shopping') def verify_cart wait_until(60) do continue_element.visible? end end To make it work I have tried solutions here: Inconsistently getting error (Watir::Wait::TimeoutError) and Timeout::Error in Rails application using Watir but none worked for me. I have also tried by increasing the time. Then I tried by increasing the at implicit wait from 3 seconds to 20 seconds and instead of using wait_until block I

Using Background title as Background in cucumber

♀尐吖头ヾ 提交于 2019-12-13 20:29:36
问题 Let's say I use Background feature which has the below steps: Background: My pre-requisites Given Step one When Step Two Then Step Three .... Then Step Fifteen So basically my Background has 15 common steps that is required for a set of scenario to run. My question is : Is it possible to use the Background title My pre-requisites in other feature files, instead of writing down all the 15 steps as Background? Or is there any other way to handle this more gracefully. 回答1: You can create a

In Cucumber 'Feature file '-> 'Examples' , how to set path for CSV file

不打扰是莪最后的温柔 提交于 2019-12-13 18:57:17
问题 My sample feature file rather than giving data from Examples I want it to pass from csv how to achieve that can anyone help me out. Feature file: Feature: Rocky Search Status Scenario Outline: Rocky Search Status with Filters Given Open firefox and start application for Rocky Search Status When User enters "<price_right>" and "<Carat_left>" and "<Color_right_param>" and "<Cut_right_param>" and "<Clarity_right_param>" Then Message displayed Rocky Search Status Successful Then Application

Karate - How to loop Soap request with values received from a response array

风格不统一 提交于 2019-12-13 18:03:13
问题 I am making a Soap request, and I am receiving the response that's returned as an array: - [print] [ "M4205N", "M4206U" ] For each item in the array, I want to make another Soap request. I've read how you can do this with tables and call a feature file, and I've read how to loop through an array, and call a js function. I cannot figure out how to loop through the array, and pass each value to another soap request xml (one at a time). I want to do something like this: Given soapURL And method

how to stop selenium chromedriver from logging to the screen

雨燕双飞 提交于 2019-12-13 16:16:25
问题 How do I stop selenium chromedriver from logging errors to the screen? I am running some cucumber tests and Im using capybara & the selenium chromedriver to drive the tests. In the last few weeks ive noticed that the Chromedriver has started logging its error messages to the screen. My tests still run fine but the errors are clogging up the output. This is the output below: Started ChromeDriver port=9515 version=23.0.1240.0 log=C:\Gitrepos\Base Tests\chromedriver.log [8244:5080:1115/151428

Maven + Cucumber-jvm - How to run different subset of the features depending on environment

偶尔善良 提交于 2019-12-13 12:29:00
问题 I am strugging to achieve this: I want to configure a maven project so that it runs different subsets of the cucumber features depending on the selected profile (dev | pro) For instance, I have a couple of feature files to test web navigation, using tags to specify the environment: PRO @pro Feature: Nav Pro Scenario: navigate to home Given access / Then it should be at the home page DEV @dev Feature: Nav Dev Scenario: navigate to login and log user correctly Given access /login When the user

How to validate SOAP service XML file with given XML using Karate

北城余情 提交于 2019-12-13 08:59:22
问题 I'm learning Karate API for executing our SOAP-based web services. For that, I have created two XML files in which, one is, request information and another one is response data. And then I have created one more file is called webservice.feature file. When I execute this feature file I'm getting the following information in the Console but I don't understand and also I don't know how to validate that. Please give your suggestions. webservice.feature File: Feature: Get Membership Details

Cucumber + Protractor - timed out error while executing the steps

旧巷老猫 提交于 2019-12-13 08:41:54
问题 I am using cucumber and protractor to write behavioural driven tests.My scenarios and all the steps will pass but at the end it will show timed out error. The homepage will get loaded for the first step and later it will not perform any steps described in the steps definition file. Once the page is loaded it should click on the tabs. I have mentioned these steps in step definition file.But these steps are not executed and it will show all the steps passed in the console. I followed this link

Protractor-cucumberjs: browser.get() does not work

喜欢而已 提交于 2019-12-13 07:17:50
问题 When i run cucumberjs with protractor, i get error message, anyone can help me raise reason: c:\Users\Dave.Le\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108 var template = new Error(this.message); ^ NoSuchElementError: Unable to locate element: {"method":"id","selector":"log"} For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.47.1', revision: '411b314', time: '2015-07