Giter Site home page Giter Site logo

cumcuber's Introduction

cumcuber

to run

Right-click on test/java and select Run 'All tests'

Simple set up is

  • Under resources and a features directory,
    • create a subdirectory for your feature under test
    • create a "feature" file ending in .feature
    • write out a scenario
    • each scenario is either a
      • setup
      • validation
 Scenario: Track my budget
    Given I have 100 in my wallet
    When I buy milk with 10
    Then I should have 90 in my wallet
  • go ahead and realise the Given, When and Then parts of the scenario in a "steps" class in test/java
 
Given("^I have (\\d+) in my wallet$", (Integer money) -> budget = money);

or

@Given("^that the user (.*) is given a task to clear (.*) certification exam$")
public void certificationName(String name, String certication) throws Throwable {
	user.setName(name);
	user.setCertification(certication);
}
  • these steps through the magic of cucmber and regular expressions, become clickable from the scenario (ctrl | left-click)
  • User example shows the bog standard one method per setup or validation
  • Shop example shows the Java8 stuff available if you import cucumber-java8 and implement En
  • The actual cucmber runner is annotated on the minimal "test" class itself and the other minimally required annotation there is to bind the runner to the feature:
@RunWith(Cucumber.class)
@CucumberOptions(features = { "classpath:features/user/user.feature" })

Now with the instructions to create a job to run this test in a throw away container:

` kubectl delete jobs.batch tester docker build . -t petecknight/tester:1.2 kubectl apply -f job.yaml kubectl wait --for=condition=complete --timeout=30s -f job.yaml

job.batch/tester condition met `

cumcuber's People

Contributors

petecknight avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.