Giter Site home page Giter Site logo

accenture / bdd-for-all Goto Github PK

View Code? Open in Web Editor NEW
50.0 14.0 22.0 22.53 MB

Flexible and easy to use library to enable your behavorial driven development (BDD) teams to easily collaborate while promoting automation, transparency and reporting.

License: Other

Java 73.97% Gherkin 26.03%
tdd api soap test-automation restful microservices bdd ci-cd ddd agile-development

bdd-for-all's Introduction

Quick Links: User Guide | Running | Grammar

Builds Maven Central

Latest builds can be found on Sonatype

Logo

No longer do your business, development and testing teams need to translate each others requirements and reports into something else to do their job. This natural language, behavior-driven development (BDD) library exists to simplify the documenting of requirements and the testing of your API's.

Built on Cucumber and Rest Assured, this library provides a standard grammar (based on Gherkin) that all teams within your organization can use to relay requirements and test your applications.

Example

    Given I am a JSON API consumer
      And I am executing test "RSJ2"
     When I request GET "/json/users"
     Then I should get a status code of 200
      And the response value of "users[0].email" should equal "[email protected]"
      And the response value of "users[0].address.city" should not equal "Boston"

Although there are libraries like Karate and others that provide similar functionality, they are focused mainly on technical users, which means your Product/Solution Owners and SME's are still writing their own docs.

This library was born out of this frustration.

Why BDD For All?

Requirements, always being interpreted from one document format (user story, technical docs, test cases, etc...) to another, create an additional overhead. Even worse, things often get lost or misinterpreted in translation. We don't have time for that in one or two week sprints.

This library provides a lot of help out of the box to fix this...

  • Simplifies and streamlines your Test Driven Development (TDD) flows.
  • Simple integration with build tools (Maven, Gradle, & SBT) as well as your DevOps pipelines (Jenkins, Bamboo, CircleCI, etc...).
  • Test against any API's regardless of language or platform.
  • Standard, well tested step definitions that are easy to read/write for the entire business.
  • Create complex flows with request chaining (e.g. search for and then edit record).
  • Data generation, supporting over 40 locales out of the box
  • Run within your project or as a command line program
  • Option to log all requests as cURLs to import into your favorite tools (postman, soapUI and more)
  • Supports complex Groovy GPath expressions for those cases that require additional complexity
  • Easy to use with any test framework (JUnit, TestNG, etc...) and works as a standalone library.
  • Tests count towards your code coverage, reducing the need for unit tests.
  • Simple intuitive reporting out of the box.
  • Expressions that allow you easily choose what tests to run (e.g. smoke, regression, etc...).

How's it Work?

In most environments, contributors - which include Product Owners, Subject Matter Experts, Architects, Solution Owner/Architects, Tech/Team Leads, and more - create scenarios which are added to feature files. In most cases these are added to existing project repositories (or newly created ones).

The developer then reviews the requirements (or acceptance criteria) and creates functionality to support, while running those scnearios as as tests with every change to confirm that there's been no regressions and that the feature is functionally complete.

The BDD + TDD Workflow

Samples

The test directory has a variety of sample feature files that show how to use all the features of the library.

Using

For the definitive guide, checkout the User Guide.

bdd-for-all's People

Contributors

mikeparcewski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bdd-for-all's Issues

Sonatype Deploy

Need to set project up for Sonatype OSS Hosting support.

Acceptance Criteria

  • Able to deploy final builds and snapshots via maven
  • README's updated with instructions using maven/grade/sbt
  • releases/ folder removed
  • Signing GPG key available in repo, but encrypted? GIt-secret maybe?

Standalone DSL Improvement

Overload run method on Main to allow a util.Map to overwrite what is in the config. Currently have to do file manipulation before each suite. This will allow for concurrent runs on the same jvm.

Complete Tests for SOAP

Need to implement the missing tests for SOAP requests...

Undefined scenarios:
features/ResponseStepsJson.feature:61 # Test long matching (RSJ6)
features/ResponseStepsXML.feature:3 # Request chaining & simple cache test (RSS0)
features/ResponseStepsXML.feature:5 # Test simple evaluation to true/false (RSS1)
features/ResponseStepsXML.feature:7 # Test string matching (RSS2)
features/ResponseStepsXML.feature:9 # Test integer matching (RSS3)
features/ResponseStepsXML.feature:11 # Test float matching (RSS4)
features/ResponseStepsXML.feature:13 # Test boolean matching (RSS5)
features/ResponseStepsXML.feature:15 # Test long matching (RSS6)
features/ResponseStepsXML.feature:17 # Path occurs X number of times (RSS7)
features/ResponseStepsXML.feature:19 # Path occurs more than X times (RSS8)
features/ResponseStepsXML.feature:21 # Path occurs less than X times (RSS9)
features/ResponseStepsXML.feature:23 # Path occurances are equal to or more than X times (RSS10)
features/ResponseStepsXML.feature:25 # Path occurances are less than or equal to X times (RSS11)
features/ResponseStepsXML.feature:27 # Path with value occurs X number of times (RSS12)
features/ResponseStepsXML.feature:29 # Path with value occurs more than X times (RSS13)
features/ResponseStepsXML.feature:31 # Path with value occurs less than X times (RSS14)
features/ResponseStepsXML.feature:33 # Path with value occurances are equal to or more than X times (RSS15)
features/ResponseStepsXML.feature:35 # Path with value occurances are less than or equal to X times (RSS16)
features/ResponseStepsXML.feature:37 # Path with numeric value occurs X number of times (RSS17)
features/ResponseStepsXML.feature:39 # Path with numeric value occurs more than X times (RSS18)
features/ResponseStepsXML.feature:41 # Path with numeric value occurs less than X times (RSS19)
features/ResponseStepsXML.feature:43 # Path with numeric value occurances are equal to or more than X times (RSS20)
features/ResponseStepsXML.feature:45 # Path with numeric value occurances are less than or equal to X times (RSS21)
features/ResponseStepsXML.feature:47 # Path has duplicates in collection (RSS22)
features/ResponseStepsXML.feature:49 # Path has duplicates in collection (RSS23)
features/ResponseStepsXML.feature:51 # Should contain the elements (RSS24)
features/ResponseStepsXML.feature:53 # Should contain the elements (RSS25)
features/ResponseStepsXML.feature:55 # Elements match (RSS26)
features/ResponseStepsXML.feature:57 # Elements don't match (RSS27)
features/ResponseStepsXML.feature:59 # List of elements match (RSS28)
features/ResponseStepsXML.feature:61 # List of elements do not match (RSS28)

Support Multiple Languages

Is your feature request related to a problem? Please describe.
No, feature request

Describe the solution you'd like
It would be great to have a subfolder per language, so we can support multiple languages

Describe alternatives you've considered
Todo

Additional context
Todo

In the grammar Readme it is missing and/or wrong the example of body value from disk

Hi,

It the GRAMMAR.md it is missing and/or wrong the example of body value from disk

It is

I set the (JSON|XML) body from {values}
Set's the body as well as the content type based on the content provided using a file from disk

I believe that it should be

I set the JSON body from file

An example would be

And I set the JSON body from file "src/test/resources/data/input.json"

Generated values don't work when setting JSON as table

Describe the bug
When using a table to set the JSON body, faker values are not transformed.

To Reproduce

  @Smoke @Json @GPath @ResponseMatch
  Scenario: Test setting up JSON as table with generation (FT3)
    Given I am a JSON API consumer
      And I am executing test "BSJ2"
     When I request GET "/mirror"
      And I set the JSON body from values
      | users[0].id        | 1                                    |
      | users[0].name      | {{faker::name.firstName,en-US::n}}   |
      | users[0].favorites | 1,2,3                                |
      | users[0].active    | true                                 |
      | users[1].id        | 2                                    |
      | users[1].name      | Bob                                  |
      | users[1].favorites | 4,7,9                                |
      | users[1].active    | false                                |
     Then I should get a status code of 200
      And the response value of "users[0].name" should equal "{{cache::n}}"

In the above, users[0].name is still {{faker::name.firstName,en-US::n}}

Expected behavior
users[0].name should be replaced by a value generated from faker object

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.