BDD

  • 12
    Jun

    Getter dependency for Cucumber scenarios with Picocontainer

    Step 1: Create Maven project with following POM.xml =================================================== UTF-8 UTF-8 1.8 1.8 4.2.6 3.141.59 6.5.1 io.cucumber cucumber-picocontainer 4.3.1 test org.testng testng ${testng.version} test io.cucumber cucumber-java ${cucumber.version} test io.cucumber...

    Read More
  • 12
    Jun

    Dependency injection with Guice

    Step 1: ======= public interface Discountable { double getDiscount(); } Step 2: Implement above interface =================================== public class EarlyBirdDiscount implements Discountable { @Override public double getDiscount() { return .25;...

    Read More
  • 08
    Jun

    pom.xml for picocontainer and cucumber jvm

    1.8 3.7.0 3.0.2 3.12.0 chrome abc org.apache.maven.plugins maven-compiler-plugin ${maven.compiler.version} ${java.version} ${java.version} io.cucumber cucumber-java ${cucumber.version} io.cucumber cucumber-java8 ${cucumber.version} io.cucumber cucumber-picocontainer ${cucumber.version} io.cucumber cucumber-testng ${cucumber.version} junit junit org.seleniumhq.selenium selenium-java ${selenium.version}

    Read More
  • 07
    Jun

    Implementing dependency injection with Picocontainer

    Implementing Dependency Injection with Picocontainer Step 1: Maven Dependency for Picocontainer: ============================================ 3.0.2 io.cucumber cucumber-picocontainer ${cucumber.version} Step 2: Create a class which needs to be injected via Picocontainer: ====================================================================...

    Read More
  • 07
    Jun

    Cucumber documentations

    #1. https://cucumber.io/docs/cucumber/state/ #2. Sharing selenium Webdriver instance using PicoContainer in Cucumber Sharing selenium Webdriver instance using PicoContainer in Cucumber #3. Types of IoC: ================== http://picocontainer.com/inversion-of-control.html #4. Implementing Digital Zoom...

    Read More
  • 20
    May

    Read property files and set TestContext

    Following code snippet performs following actions: 1. Read all property files in given folder and add them as K,V pair in testContext Step 1: Create a TestContext class which...

    Read More
  • 25
    Apr

    @CucumberOptions parameters

    source: @CucumberOption annotation definition JUnit Runner with @CucumberOptions Different @CucumberOptions options we can pass as parameter to this cucumber annotation. #1. Plugin – Specifies different formatting options for the...

    Read More
  • 25
    Apr

    Cucumber – How to execute all feature file which contains a user defined tags from command prompt

    Attached is sample maven project for cucumber to demonstrate executing maven project from command prompt: SampleProjectCucumber Step 1: import maven project to eclipse Step 2: perform Maven update to...

    Read More
  • 19
    Oct

    Standalone extent report for a TestNG testcase (Extent Reports < 3.0 ver)

    import java.io.File; import org.testng.Assert; import org.testng.ITestResult; import org.testng.SkipException; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; import com.relevantcodes.extentreports.LogStatus; import libraries.*; public class ExtentReportsClass { ExtentReports...

    Read More
  • 16
    Aug

    Invoke a task every 1 minute

    In order to invoke a task / function periodically (say every one minute) we can use following code snippet. Step 1: Create a class which calls “function” to be...

    Read More
  • 1
  • 2