cucumber

How do I get the HTML in an element using Capybara?

僤鯓⒐⒋嵵緔 提交于 2019-12-17 18:32:04
问题 I’m writing a cucumber test where I want to get the HTML in an element. For example: within 'table' do # this works find('//tr[2]//td[7]').text.should == "these are the comments" # I want something like this (there is no "html" method) find('//tr[2]//td[7]').html.should == "these are the <b>comments</b>" end Anyone know how to do this? 回答1: You can call HTML DOM innerHTML Property: find('//tr[2]//td[7]')['innerHTML'] Should work for any browser or driver. You can check all available

Cucumber / Capybara — how to get the host and port of the current execution

不想你离开。 提交于 2019-12-17 16:24:19
问题 I need to download a csv file from my app using Open::URI and to do that I need to give it a fully qualified URI. So whats the best way to get the HOST and more importantly PORT in my cucumber script? Note I am using Capybara and Selenium 回答1: You can set port that will be used to spawn an application server Capybara.server_port = 31337 回答2: For capybara < 2.0: Capybara.current_session.driver.rack_server.host Capybara.current_session.driver.rack_server.port Capybara 2.0: Capybara.current

Run cucumber test with cached dependencies and plugins on gradle

时光怂恿深爱的人放手 提交于 2019-12-17 14:55:23
问题 Hi I want to run a few test made with cucumber on a gradle project, I was trying to run this test's on another PC (with limited network access) so I copy/pasted everything that was under ~./gradle/caches and the project files like build, src and build.gradle and placed everything on the same place as the original So once I got everything in place I ran this gradle --no-daemon --offline cucumber And I get a failure > Could not resolve all dependencies for configuration ':classpath'. > Could

Unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)

我的未来我决定 提交于 2019-12-17 08:50:54
问题 While testing scenario by cucumber i'm getting the following error when running rspec tests unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError) Using ruby (1.9.2) selenium-webdriver (2.27.2) and firefox (19.0) Using rspec-rails (2.12.1) , capybara (2.0.2) and several other gems, Also i have added launchy gem but they don't seem to be a problem. And i am using Windows 7 . 回答1: I had the same problem (on Linux). Fixed with: gem

Why is my IE browser getting launched twice with Selenium and Cucumber?

。_饼干妹妹 提交于 2019-12-14 04:14:15
问题 I am writing very basic automation test with Selenium-Cucumber that is launching an IE browser and closing it at the end. The problem is that the browser gets launched twice. The test does not have much it other than few System.out statements. I am kind of new to both selenium -based automation testing and Cucumber and not able to understand why is it getting launched twice. Please guide. BrowserConfig.java public class BrowserConfig { private static final String IE_DRIVER_EXE = "drivers

How to capture images and attach them to Cucumber Reports (Jenkins) using Selenium Hub, Node and Remote Webdriver?

喜欢而已 提交于 2019-12-14 03:12:14
问题 Currently I'm triggering my automation tests in the cloud using a Ubuntu instance. The Ubuntu instance has a Jenkins instance running and also Selenium Hub and Node. It seems the screenshot images dont get saved within the builds\3\cucumber-html-reports\embeddings on a ubuntu system however on a windows system this issue does not exist. I have currently added the below logic to capture and attach images to the Jenkins Cucumber reports however currently the images are not getting attached to

How do I handle an array of promises using Protractor w/ chai-as-promised

ε祈祈猫儿з 提交于 2019-12-14 02:20:52
问题 I am using Protractor with CucumberJS and chai-as-promised (given that CucumberJS does not have a built-in assertions library) to build an automated test suite. Everything works fine for single assertions (using the expect feature of chai-as-promised). I run into trouble, however, when attempting to handle multiple promises within the same test (step). In the following example, verifyUserFirstName returns a promise mapped to a certain row's td.getText(). this.Then(/^I should see my user entry

Replacing text with regexp Ruby Capybara

怎甘沉沦 提交于 2019-12-14 01:53:42
问题 I have a question running already linked to this problem, but this question is for a different approach. I have a string of text on a webpage that produces includes a timestamp (hhmmss) after a transaction is complete. I can't use Time.now as the processing time varies depending on many factors. The text on page is: "Your transaction reference number is: 0 16123 (timestamp is here) A1" I'll be looking within the element to read the text in my test with: expect(find(location)).to have_text

cucumber jvm CucumberException: No features found at []

五迷三道 提交于 2019-12-14 00:20:35
问题 In my cucumber -jvm, Maven, junit Setup I have my testRunner file as package com.lebara.testrunner; import cucumber.junit.Cucumber; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @Cucumber.Options( glue = {"com.lebara.stepdefs","com.lebara.framework.main", "com.lebara.testrunner"}, features = "C:/Users/sarthak.dayanand/Documents/WebRefreshTest/CukeAutomation/LebaraWebAutomationTest1/src/main/resources", format = {"pretty", "html:target/cucumber-html-report", "json-pretty:target

Process finished with exit code -1073741819

别说谁变了你拦得住时间么 提交于 2019-12-13 23:20:03
问题 When I run a feature file in RubyMine it will randomly crash with this error. Sometimes it will run one scenario other times it will run a couple before giving this error but it always does. We thought it had something to do with the version of IE we were using but it seems to occur with all versions. Also this issue doesn't seem to affect everyone and we're unsure as to what causes it because the settings on each environment are the same... Any ideas? 回答1: There shoudn't be any crashes in