cucumber

Is there any way the JSON comparison ignores the whole section misplaced?

那年仲夏 提交于 2019-12-12 00:25:10
问题 I am trying to compare two JSON objects. When a 'key:value' pair order changes, I can use JSON.parse , and during comparison, the test passes like this: doc1 = '{ "KayA": "Value_A", "KeyB": "value_B" }' doc2 = '{ "KeyB": "value_B", "KayA": "Value_A" }' doc1 = JSON.parse(doc1) doc2 = JSON.parse(doc2) expect(doc1).to eq(doc2) # true But when the order of a section, an array, or a block of content changes, my assertion fails if I do the same comparison logic like below: doc1 = '{ "keys": [ {

How to test post request and follow redirects with capybara?

妖精的绣舞 提交于 2019-12-11 20:16:40
问题 I'm trying to test a post request with capybara and cucumber. I can't visit a page and press a link to send the request because it has a confirm dialogue and I haven't made it work with javascript so I'm trying to use the post method and then test if it redirects to the appropriated url but I'm getting: No response yet. Request a page first. (Rack::Test::Error) My code is: page.driver.post url page.driver.status_code.should be 302 follow_redirect! It's working fine until follow_redirect! . I

Set Run Configuration for Cucumber in Webstorm

孤者浪人 提交于 2019-12-11 20:01:11
问题 Trying to run features files from WebStorm IDE When trying to execute the feature files I get following message I'm not able to set "Executable Path" so when I click on the green arrow I get following message "Cannot run program D:\example-protractor-master\node_modules-bin" Attaching the screenshot http://screencast.com/t/oRaPpUUsuEy Can anyone tell me how to set the configuration window for Cucumber? Thanks in advance 回答1: 'Executable path' should be a full path to cucumber-js executable (

Pass cucumber options dynamically in cucumber-junit?

我是研究僧i 提交于 2019-12-11 19:57:40
问题 I understand that @CucumberOptions is used to pass Cucumber options. However, due to the limitation that Java annotations only allow inline constants, it is quite cumbersome to use @CucumberOptions . So, is there a dynamic way to pass Cucumber options when using cucumber-junit? Thank you very much. 回答1: This question is quite old now, but the answer is yes you can. If you are using maven for example just add it like this. mvn test -Dcucumber.options="--tags @your_tag" You can filter yous

Create customize file report name in @CucumberOptions

北城余情 提交于 2019-12-11 18:50:02
问题 I am trying to customize the extent report which is a third party reporting tool added to my cucumber framework where I want to customize the name of the report.html to "Outputfilename".html which I unable to do as the value of "Outputfilename " is coming from my config file. here is my testrunner code @RunWith(Cucumber.class) @CucumberOptions( features = ".//src//test//java//FeatureList",glue = "stepDefinations", plugin = { "com.cucumber.listener.ExtentCucumberFormatter:target/cucumber

Converting existing cypress tests to cucumber style bdd using cypress-cucumber-preprocessor. Second scenario is not picked up

对着背影说爱祢 提交于 2019-12-11 18:44:54
问题 We have an existing application, the tests are written in cypress. We now want to integrate a cucumber style feature which will internally run using cypress. We used cypress-cucumber-preprocessor for the same. I followed the steps given here on the github page. The problem I'm facing now, is while running tests, it shows both the scenarios, but runs only one. Shows a green tick mark next to it, but doesn't start the second one, and the clock keeps on ticking. On clicking the second scenario

Run cucumber file on multiple iOS devices

拜拜、爱过 提交于 2019-12-11 18:38:22
问题 How to run cucumber test on multiple devices at the same time on iOS platform(iPhone, iPad) ? 回答1: On iOS 7 and above, this is not possible because Calabash requires the app to be launched by instruments and there can be only one instruments process alive at one time. On iOS < 7, it is possible to test against multiple devices iff you manually launch the app before testing. There might be some work-arounds to automatically launch the app on the device (there are for the simulator), but they

Creating Cucumber Test on Executable Docker Image

僤鯓⒐⒋嵵緔 提交于 2019-12-11 18:30:16
问题 I am trying to come up with an idea on how to create a Cucumber Test on Docker Executable Image? public class GenerateNumber { public static void main(String[] args) { if (args != null && args.length > 0) { String input = args[0]; if(input.equals("ODD")) { //GENERATE ODD NUMBERS FROM 0 TO 1000 }else { //GENERATE EVEN NUMBERS FROM 0 TO 1000 } } } } Supposed I have this simple class file...I am packaging it into an executable Jar File and use this class as an entry point in my application. The

How can I have ruby logger log for each line of execution?

眉间皱痕 提交于 2019-12-11 18:03:43
问题 I am very new to ruby, just started learning for doing a automation with cucumber and Gherkin. I wanted to capture the each and every action into the logs!!! Is there a way to capture!!! Thanks for your advice in advance!!! Thanks Ashok Natarajan 回答1: The easiest way to log things in cucumber is using simple puts statements. if you don't want it to show up in the reports you could use kernel.puts I have also used pry for real time debugging like this: http://www.alanmacdougall.com/blog/2012

Unable to create test Runner class in Cucumber Framework due to Error in resolving Cucumber Options

旧时模样 提交于 2019-12-11 17:58:24
问题 I am working on creating a Cucumber Framework for Test Automation. Issue I am facing is I am not able to resolve the imports for CucumberOptions in the Test Runner class Initially I tried to use the Suggestion of importing cucumber.api which is now deprecated. Then I went to the official Cucumber site to find the imports but they are not solving the problem as well. Deprecated Import : import cucumber.api.CucumberOptions; Import from Cucumber Official Site : import io.cucumber.junit.Cucumber;