n26godog

package module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 12 Imported by: 0

README

Cucumber N26 API for Golang

GitHub Releases Build Status codecov Go Report Card GoDevDoc Donate

n26godog provides cucumber/godog steps for testing N26 API.

Prerequisites

  • Go >= 1.17

Install

go get github.com/nhatthm/n26godog

Usage

For example:

package mypackage

import (
    "testing"

    "github.com/cucumber/godog"
    "github.com/nhatthm/n26godog"
)

func TestIntegration(t *testing.T) {
    server := n26godog.New(t)
    suite := godog.TestSuite{
        Name:                 "Integration",
        TestSuiteInitializer: nil,
        ScenarioInitializer: func(ctx *godog.ScenarioContext) {
            server.RegisterContext(ctx)
        },
        Options: &godog.Options{
            Strict:    true,
            Output:    out,
            Randomize: rand.Int63(),
        },
    }

    // Initiate your client and run it with the suite.
    status := suite.Run()
}

Steps

Authentication
  • ^n26 receives a login request with username "([^"]+)", password "([^"]+)" and device id "([^"]+)" but the credentials is wrong
  • ^n26 receives a login request with username "([^"]+)", password "([^"]+)" and device id "([^"]+)" but no one confirms login
  • ^n26 receives a success login request with username "([^"]+)", password "([^"]+)" and device id "([^"]+)"
  • ^n26 receives a refresh token request but the token is invalid
  • ^n26 receives a success refresh token request
Transactions
  • ^n26 receives a request to find all transactions in between "([^"]+)" and "([^"]+)"(?: with page size ([0-9]+))? and responses:$
  • ^n26 receives a request to find all transactions in between "([^"]+)" and "([^"]+)"(?: with page size ([0-9]+))? and responses with result from file:$

Examples

See https://github.com/nhatthm/n26godog/tree/master/features

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

Paypal donation

paypal

       or scan this

Documentation

Overview

Package n26godog provides functionalities to test with n26api using cucumber/godog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*testkit.Server
	// contains filtered or unexported fields
}

Server is a wrapper around *testkit.Server to provide support for cucumber/godog.

func New

func New(t testkit.TestingT) *Server

New initiates a new Server.

func (*Server) RegisterContext deprecated

func (s *Server) RegisterContext(sc *godog.ScenarioContext)

RegisterContext registers Server to a scenario.

Deprecated: use Server.RegisterSteps instead.

func (*Server) RegisterSteps added in v0.6.0

func (s *Server) RegisterSteps(sc *godog.ScenarioContext)

RegisterSteps registers Server to a scenario.

Directories

Path Synopsis
features
bootstrap
Package bootstrap provides feature tests.
Package bootstrap provides feature tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL