cucumber

NoClassDefFoundError: gherkin/IGherkinDIalectProvider

前提是你 提交于 2020-01-16 09:04:25
问题 I created a simple cucumber test that returns a sequence number. The project builds successfully. I am using the Intellij IDE. When I try to run the cucumber test, I get this error: Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/IGherkinDialectProvider at cucumber.api.cli.Main.run(Main.java:30) at cucumber.api.cli.Main.main(Main.java:18) .... This is a gradle build and I have these dependencies listed below: testCompile('io.cucumber:cucumber-java8:3.0.2') testCompile('io

Protractor TRY/Catch issues

若如初见. 提交于 2020-01-16 03:56:18
问题 I was using Protractor and Cucumber and noticed that there were instances where I wanted to capture a NoSuchElementError: No element found using locator: By.cssSelector("someCssLocatorHere") . However, using the traditional try/catch block wouldn't work unless I called both the callback and errBack of the .then() function and throw the error so that I can catch it later like following: try{ somePromise.then(function(){ //callback function if promise gets resolved successfully }, function(e){

Is it possible to pass Java-Enum as argument from cucumber feature file (in a more text friendly way)?

邮差的信 提交于 2020-01-15 15:29:26
问题 Building up on this question, the example provided seems to lock the text in the feature file too much to Java programming style (notice that the text is written in all uppercase, and is only one word. Is it possible to pass enums when the feature file has more "human readable" text? E.g.: Simple Example Feature: Setup Enum and Print value In order to manage my Enum As a System Admin I want to get the Enum Scenario Outline: Verify Enum Print When I supply a more human readable text to be

Is it possible to pass Java-Enum as argument from cucumber feature file (in a more text friendly way)?

两盒软妹~` 提交于 2020-01-15 15:27:26
问题 Building up on this question, the example provided seems to lock the text in the feature file too much to Java programming style (notice that the text is written in all uppercase, and is only one word. Is it possible to pass enums when the feature file has more "human readable" text? E.g.: Simple Example Feature: Setup Enum and Print value In order to manage my Enum As a System Admin I want to get the Enum Scenario Outline: Verify Enum Print When I supply a more human readable text to be

SpringBootTest enable/disable webEnvironment based on input

不羁的心 提交于 2020-01-15 09:37:31
问题 I am using Cucumber with SpringBootTest. The following class is used to configure SpringBootTest @ContextConfiguration(classes = Application.class, loader = SpringBootContextLoader.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public abstract class StepDefinition { @LocalServerPort private int port; @Autowired private TestRestTemplate restTemplate; } All step definitions extends this class public class MyStepdefs extends StepDefinition { ...} I need to run

Skip certain steps in a scenario in Cucumber

岁酱吖の 提交于 2020-01-15 08:23:21
问题 I have a cuke scenario, Scenario: Hello World Then do action one Then do action two Then do action three Then do action four Then do action five But depending on the environment variable, I want to skip action three and action four . I know I can go in the step and do a if-else check, but it's not very elegant. Is there any better solution? Thanks :) 回答1: You can't do this in Gherkin, nor should you want to! Gherkin is not for programming, nor is it for stating 'how' things are done, instead

debugger (Intellij IDEA) failing when hits breakpoint (cucumber, ruby, rspec, capybara)

旧城冷巷雨未停 提交于 2020-01-15 07:56:05
问题 While trying to debug a cucumber scenario in IntelliJ(11.1.5), it is failing with the following error when it hits the first breakpoint. It runs successfully, if I remove all the breakpoints. gem list capybara (2.0.2, 1.1.4) cucumber (1.2.3, 1.2.1) rspec (2.13.0) ruby-debug-base (0.10.3.4 java) ruby-debug-ide (0.4.17.beta9) Testing started at 1:12 PM ... Fast Debugger (ruby-debug-ide 0.4.17.beta9, ruby-debug-base 0.10.3.4) listens on 127.0.0.1:60409 Using the default profile... file:/Users

Cucumber `press button` failure (Capybara::ElementNotFound)

旧时模样 提交于 2020-01-15 05:41:07
问题 I'm a relative newbie starting up a new Ruby on Rails app. I started by following a combination of instructions at https://github.com/intridea/omniauth, http://www.communityguides.eu/articles/16, http://intridea.com/2011/1/31/easy-rails-admin-login-with-google-apps-and-omniauth?blog=company . At the point everything appeared to work correctly, I started to write my very first cucumber features and steps. I was able to get a couple of steps up and running, but I've been bogged down on a step

How do I attach a file when the input.file has a dynamic id?

左心房为你撑大大i 提交于 2020-01-15 04:28:43
问题 I have run into a snag with dynamic ids. The attach_file command needs the id name of the input type="file". The problem is that the id is dynamic (id="document_22") #indicating the 22nd document uploaded to this section. Is there a way to get the id of an element? something like... attach_file(find(:xpath, ".//input[@name='file_upload']").get('@id'), 'C:\\Users\\testbox\\Documents\\testdoc.xls') 回答1: attach_file internally just passes filename to Capybara::Node::Element#set method. So you

Is it possbile to have a null value on Example table on Cucumber Scenario Outline? [duplicate]

半世苍凉 提交于 2020-01-14 22:45:44
问题 This question already has an answer here : Cucumber Scenario Outline: Passing empty string “ ” as value in Examples table (1 answer) Closed 2 years ago . Here is my example table on my scenario outline, some does not have value, is this possible? Examples: |ID | UserName | Password | Contact1 | Number | |ID1 | username1 | password1 | Phone | 111 222 4444 | |ID2 | username2 | password2 | | | |ID3 | username3 | password3 | Email | a@a.com | |ID4 | username4 | password4 | | | 回答1: The empty