Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Mrunal Gosar
    @mrunalgosar
    @josefd8 in the newer version of cucumber you are to use TypeRegistryConfigurer interface. Reference: https://docs.cucumber.io/cucumber/configuration/
    @DaniilMoiseevPenza If you update cucumber to 4.x version then you don't need to use cucumber-jvm-parallel plugin as it comes with in built support to run the tests in parallel. TestNG runner supports parallelism at feature as well as scenario levels and JUnit runner at Feature level.
    DaniilMoiseevPenza
    @DaniilMoiseevPenza
    @mrunalgosar Thanks
    DaniilMoiseevPenza
    @DaniilMoiseevPenza
    @mrunalgosar
    is it enouth?
           <plugin>
                <!-- 2.20.1 or higher does not work well with JUnit5, issue https://stackoverflow.com/questions/36970384/surefire-is-not-picking-up-junit-5-tests -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                    <testFailureIgnore>false</testFailureIgnore>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                        -Dcucumber.options="--plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"
                    </argLine>
                    <systemProperties>
                        <property>
                            <name>junit.jupiter.extensions.autodetection.enabled</name>
                            <value>true</value>
                        </property>
                        <property>
                            <name>allure.results.directory</name>
                            <value>${project.build.directory}/allure-results</value>
                        </property>
                    </systemProperties>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>ru.altarix.edc2.listeners.ScreenshotListener</value>
                        </property>
                    </properties>
                    <forkCount>5</forkCount>
                    <reuseForks>true</reuseForks>
                    <includes>
                        <include>**/Parallel*IT.class</include>
                    </includes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
    Sandeep tiwari
    @Sandytrp1_twitter
    Has anyone used XMLGregorianCalendar?
    Mrunal Gosar
    @mrunalgosar
    @DaniilMoiseevPenza did you update the cucumber version to 4.x (latest)? As i don't see your cucumber dependencies
    DaniilMoiseevPenza
    @DaniilMoiseevPenza
    @mrunalgosar <dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>4.2.3</version>
    </dependency>
    <dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>4.2.3</version>
    </dependency>
    <dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>5.4.0</version>
    </dependency>
    Marit van Dijk
    @mlvandijk
    @DaniilMoiseevPenza Not sure which JUnit version you have. it should work fine with JUnit 4.12, not sure about JUnit 5
    DaniilMoiseevPenza
    @DaniilMoiseevPenza
    ок, but i use jUnit5
    Marit van Dijk
    @mlvandijk
    ok, but that is not yet supported (out of the box), see : cucumber/cucumber-jvm#1149
    DaniilMoiseevPenza
    @DaniilMoiseevPenza
    ok, thanks
    Amethyst
    @Chandhruz

    Hi,
    I want to convert cucumber datatable into java object and my datatable has multiple values ,
    Given I send a POST request with payload
    |fromId |toId |
    | QC123,QC456 |QD789 |

    List<String> fromId , returns empty in my getter setter

    can anyone suggest how to parse this data table into java object ( data table has multiple values)
    Hossain
    @hossainelahi7
    Can I use cucumber-jvm 4 with extent-reporter?
    Mrunal Gosar
    @mrunalgosar
    Yep absolutely. Just implement the extent reporting on your own.
    Heenu
    @heenu_gitlab

    Hi,,
    I'm trying to login to facebook, after successful login; am getting one notification popup asking for allowing and block. I'm fine with either case. I am using webstorm IDE framework cucumber.

    I have already tried browser.alertDismiss(), browser.alertAccept() none of them are working. could anyone help me in dealing with these notifications.

    Mrunal Gosar
    @mrunalgosar
    Hi @heenu_gitlab this is cucumber forum. your issue is related to selenium. Please ask in the selenium forum and someone will assist you there.
    SeleniumTestAB
    @SeleniumTestAB
    @mrunalgosar. How does cucumber gather and execute feature files? Because i want to know if there is a way to not kill its thread after finishing each feature file
    Mrunal Gosar
    @mrunalgosar
    @SeleniumTestAB Maybe you can share what is it that you wish to do with that thread and we can provide a better way. But you can achieve this (Not recommended at all) by adding a custom EventPublisher of your own and keep a track on execution of feature file.
    byakoshiki
    @byakoshiki_twitter
    @mrunalgosar there is an issue with Selenide (a wrapper/library) that extends Selenium. Selenide is not hard tied to any specific framework or runner so you should be able to run it on everything based on java. Sadly there is one issue with Selenide and initilization of webdriver. They attach webdriver instance to thread, so the thread that cucumber use per feature file also contains Selenide driver instance. I understand that main goal of feature files is to gather tests for given feature/function of application, but more and more i work at QA, more i see that this approach is not good for Web UI tests (could be good for integration to some extend and propably good for unit tests) because more web applications tend to use some kind of workflow, where one feature is depended on another feature. As such tests should maintain that flow. For that making one huge feature file (depending on app ) will create something that is very hard to maintain (especially in Agile Era, where entire app page can change in one sprint). For example we have some kind of form filling process that has couple of phases. First phase is a small form that is split into 2 sections with small logic. Next phase is filling a very big form that has tabs and within those tabs there are nested sections that can have small or big logic (welcome to react world, angular and such).
    So in order to get to our specific feature we want to test that could in middle of that big form and could have for example 3 test cases on its own, it really would be inefficient to make half of the form filled just so make those 3 scenarios run. (not to mention it makes nasty leftovers that i would another kind of logic to clean them up and not destroy tests).
    I saw that JBehave had a nice idea about it. You could inject a story that is required for another story to execute. You could also make some kind of suite from Suite Runner. I think its worth checkin
    Mrunal Gosar
    @mrunalgosar
    @byakoshiki_twitter @SeleniumTestAB
    Following are your options:
    a) Use an dependency injector framework with singleton object of web driver. which will allow you to share the same browser instance across different features / scenarios.
    b) Create a singleton instance of webdriver and use it across scenarios.
    c) Create a pool of web drivers which would have the pre-setup already filled up and then during execution share those pool in your test.
    And many more other options. Note: It is highly recommended that each scenarios should always be independent of each other. So that your tests can run in parallel.
    byakoshiki
    @byakoshiki_twitter
    @mrunalgosar sadly singleton would need to be applied inside Selenide library which is not an easy task. What i found is that Cucumber + TestNG resolve my problem since Selenide attach itself to TestNG suite thread and that thread executes the feature files in suite in order
    Too bad Serenity has no such option
    Mrunal Gosar
    @mrunalgosar
    @byakoshiki_twitter Glad that you got yourself a solution but as a side note: selenide does an have an option to retrieve the browser which it created as part of test execution and u simply need to reference that object with static variable and use it throughout the session. Or you can use spring DI to ensure that same object gets injected in your test.
    byakoshiki
    @byakoshiki_twitter
    @mrunalgosar i could but that would make use of selenide browser creation pointless
    mlk5060
    @mlk5060
    Hi all. I have multiple .featurefiles that contain multiple scenarios but one in particular is always reported as being undefined however, none of the others are, and they run OK. I'm trying to run my Cucumber tests in a Spring Boot application context, and I'm using IntelliJ to run them. Can any one tell me what I'm doing wrong?
    This is my output, consitently, after running the class tagged with @RunWith(CucumberRunner.class) and @CucumberOptions(features = "src/test/resources", tags = "not @wip", strict = true, glue = { "package.name.of.my.stepdef" }). Any help would be greatly appreciated!
     :: Spring Boot ::        (v2.1.1.RELEASE)
    
    
    Undefined scenarios:
    src/test/resources/features/your-feature-file.feature:7 # tester
    
    5 Scenarios (1 undefined, 4 passed)
    60 Steps (60 passed)
    1m12.642s
    Brian Hartin
    @bjhartin
    Is it possible to use a reporter to emit messages that would appear inline with the steps?
    For example, I'd like to have my test output read as follows:
    Given the system is running
    When a message "Foo" is received
      -- received {msg: "Foo"}                        <-- the output I want, i.e. some inclusion of the messages in/out of the system
    Then a message "Bar" is sent
      -- sent {msg: "Bar"}
    Brian Hartin
    @bjhartin
    I think I have found what I want in https://github.com/email2vimalraj/CucumberExtentReporter
    Vivek Krishna
    @vivekkrishna
    Is it possible to rerun the failed cucumber test case from a particular previous step/ other than the failed step? I have a cucumber test case where I get the data in one step and do different verification steps after that. Now if any of the verifications fail, I want to retry the test from get data step and start verifying all of them again in cucumber. Something like labeling to go back to a particular step and run again. To be more specific, I want to retry test case for three times with time delay from previous when, if the test case fails in any then after that when.
    Mrunal Gosar
    @mrunalgosar
    @bjhartin if you use latest version of ExtentReporter it comes with built-in support for Cucumber. So you don't need to use external library
    @vivekkrishna A simple re-org of your feature files and scenario should do the trick. I have a quick question though, let's say in your first run the scenario failed and you have cleared the state in after hook, then how would you begin from middle of a scenario, for instance in Given step you had opened a browser and logged into your app, but while re-running, that step might not executed as per your requirement and hence you will not login so your 2nd retry might fail isn't it?
    Vivek Krishna
    @vivekkrishna
    Actually I am testing an eventually consistent system, where the contract with downstream teams is we will update the proper data eventually and will send you notification. We might send some notifications in between final notification where everything get updated as well. There is no way to find out which is the final notification though. So, my testing strategy is invoke dev system, poll for notification and verify data store, if fails poll for another notification and verify store again for approximately 45 mins.
    Can you help me with how we can design our feature files for this kind of scenario? I thought I would need a nested step with retry whole nested step if Assert fails, or go back step n and run from there again if Assert fails.
    @mrunalgosar Thanks for the response
    David Tran
    @iso13
    Anyone using https://github.com/damianszczepanik/cucumber-reporting and able to not show the Before and After hooks inside the reports?
    Joel Muskwe
    @joelmuskwe
    Hi in my feature a have the following: Then I should get false
    How do i pass false as boolean in my step definition
    Mrunal Gosar
    @mrunalgosar
    @joelmuskwe your regex should contain {boolean} in step definition as arg placeholder and it will automatically accept boolean as parameter
    Joel Muskwe
    @joelmuskwe
    @mrunalgosar sorry still learning cucumber do you happen to have a small example
    i ended up using a TypeRegister but i felt as if it was over kill

    public class TypeRegistryConfiguration implements TypeRegistryConfigurer {

    @Override
    public Locale locale() {
        return ENGLISH;
    }
    
    @Override
    public void configureTypeRegistry(TypeRegistry typeRegistry) {
        typeRegistry.defineParameterType(new ParameterType<>(
                "boolean",
                "(true|false)", // .*?
                Boolean.class,
                (Transformer<Boolean>) s -> Boolean.parseBoolean(s))
        );
    }

    }

    Mrunal Gosar
    @mrunalgosar
    @vivekkrishna you should split the scenarios into multiple scenarios and when you run add re-run flag
    it will generate a re-run text which you can pass on to the runner again in your second attempt
    Lioxor64
    @lioxor64

    Hello, my name is Liora and I am currently hunting open source projects for company NeuraLegion (www.neuralegion.com)
    We just launched a free annual subscription for open source projects for our AIAST tool NexPloit.

    If you are interested, please, reach us on opensource@neuralegion.com!

    Thank you for your time and consideration! If you have any questions, please do not hesitate to contact us!

    Best!

    freemandor
    @freemandor
    Hey all, i'm looking for intelliJ plugin that will allow me to show enum type constraint on feature file. i'm adding the type using: typeRegistry.defineParameterType(ParameterType.fromEnum(ControllerRoleEnum.class)), but the feature won't recognise the regex of the enum values. please help.