Code Monkey home page Code Monkey logo

easy-cucumber's Introduction

Easy Cucumber

Build Status Quality Gate Status Sonatype Nexus (Releases)

Easy Cucumber is an easy to use, zero code, cucumber JVM based library witch offers predefined steps to test your API.

Contents

Features

  • Make GET, POST, PUT and DELETE requests to your API;
  • Mock HTTP dependencies with request, response, request headers, response headers and desired http status;
  • Assert HTTP Status;
  • Assert successfully and failed response body;
  • Execute security tests with OWASP ZAP;
  • Populate database tables and assert data;
  • Put, consume and assert messages in queues;
  • All features use gherkin syntax;

Credits

easy-cucumber's People

Contributors

lvcarnevalli avatar osvaldjr avatar wlmfincatti avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

easy-cucumber's Issues

JdbcTemplate bean required

Describe the bug
When I try to use only steps about security context, the execution crashes requiring jdbcTemplate bean

To Reproduce
Steps to reproduce the behavior:

  1. A project with default config
  2. Create a scenario using only security steps
  3. Try to run tests
  4. See error
Field jdbcTemplate in io.github.osvaldjr.usecases.DatabaseTableSelectUseCase required a bean of type 'org.springframework.jdbc.core.JdbcTemplate' that could not be found.
        - Bean method 'easyCucumberJdbcTemplate' in 'DatabaseConfig' not loaded because @ConditionalOnBean (names: easyCucumberDataSource; SearchStrategy: all) did not find any beans
        - Bean method 'jdbcTemplate' not loaded because @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) did not find any beans

Expected behavior
The scenario should be executed with success

Additional context
easy.cucumber version: 0.0.16
Java version: 1.8.0_144, vendor: Oracle Corporation
Apache Maven 3.5.3
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"

Não está sendo criado o mock com queryParams

Fiz as devidas configurações e não está sendo criado o mock com a tag queryParans.

application.yml:

target.url: http://localhost:8080/api/v1
dependencies:
stubby.url: http://localhost:8905

request.json:

{
  "url": "/search/*",
  "method": "GET",
  "body": {
    "id": 123456
  },
  "headers": {
    "content-type": "application/json"
  },
  "queryParams": {"name": "tenis"}
}

Beans context

Configurar os beans do easy cucumber para que eles não compartilhem o contexto com quem está utilizando, os do banco já foram configurados, será necessário configurar os outros.

Validar arquivos de mock antes de efetuar a criação

é necessário validar o formato do arquivo, pois está seguindo o fluxo de criação de mock mesmo com arquivo inválido.

Para reproduzir, basta adicionar um arquivo com um json que não representa o payload no diretório de request e aciona-lo via gherkin.

{code}
Given I have a mock MOCK for dependency DEPENDENCY
{code}

Solution to extend or inject steps implementations

Is your feature request related to a problem? Please describe.
I want to describe my gherkins in other languages.

Describe the solution you'd like
A possible solution to reuse the steps is to extends or inject the classes that implements the logic behind step definitions.

Melhorias nos steps de SQL

  • Criar gherkin genérico de execução de .sql, o step deve abranger o contexto de todos as features.
  • No step de comparação das informações de tabelas, ter suporte a regex e melhorar o log de match.
  • Criar gherkin que valide se a tabela está vazia.
  • Ao comparar as informações do banco, não considerar espaços.

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.