How to get name of scenario in cucumber java?

From version 1.6, in addition to, getStatus() and getSourceTagNames(), there is another method, getName() that returns the scenario’s description. For example, for a scenario as follows: Scenario: verify number of topics shown in the UI scenario.getName() returns “verify number of topics shown in the UI” I initialize scenario in @Before as follows: @Before public void … Read more

Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: java.base doesn’t “opens java.util” to unnamed module

I did not have an Cucumber feature installed so the problem in my setup was not related to it. what did help me is updating the maven plugin settings in my pom file as below. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.3.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> </plugin>

Is it possible to take a screenshot of the whole page with Selenium/Capybara?

In case anyone washed up this shore looking for how to do this with Poltergeist you just need to pass the full argument: page.save_screenshot(‘screen.png’, full: true) # If providing a custom file name. page.save_screenshot(full: true) # Capybara sets a name based on timestamp. page.save_and_open_screenshot(‘screen.png’, full: true) # Same as save_screenshot. page.save_and_open_screenshot(full: true) # Same as … Read more

How to verify number of records using capybara

This should do the trick for your Cucumber step definition: page.has_css?(“div.records li”, :count => 2) There’s also page.has_xpath? (but I don’t understand xpath) If you’re using Rspec you can phrase it the Rspec way with: page.should have_css(“div.records li”, :count => 2) I had to solve a very similar problem just yesterday; here’s the full step … Read more

what is the difference between io.cucumber and info.cukes

Refer to the release notes for more details. – https://github.com/cucumber/cucumber-jvm/blob/master/CHANGELOG.md. There has been substantial changes in cucumber 2. Refer to this for more – https://cucumber.io/blog/2017/08/29/announcing-cucumber-jvm-2-0-0 io.cucumber and info.cukes are Maven group ids. info.cukes was for Cucumber version till 1.2.5. The latest version are in io.cucumber starting from 2.0.0. There is also a new version 3 … Read more

Execute Cucumber step before/after a specific feature

It is if you are using junit to run your tests. We use the annotations to create a unit test class and a separate steps class. The standard @Before stuff goes in the steps class, but the @BeforeClass annotation can be used in the main unit test class: @RunWith(Cucumber.class) @Cucumber.Options(format = {“json”, “<the report file”}, … Read more

How do you POST to a URL in Capybara?

More recently I found this great blog post. Which is great for the cases like Tony and where you really want to post something in your cuke: For my case this became: def send_log(file, project) proj = Project.find(:first, :conditions => “name=”#{project}””) f = File.new(File.join(::Rails.root.to_s, file)) page.driver.post(“projects/” + proj.id.to_s + “/log?upload_path=” + f.to_path) page.driver.status_code.should eql 200 … Read more

techhipbettruvabetnorabahisbahis forumueduseduseduseduedueduedueduedusedu