smtp

package
v1.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 5

README

Venom - Executor SMTP

Step for sending SMTP

Use case: you software have to check mails for doing something with them? Venom can send mail then execute some tests on your software.

Input

name: TestSuite with SMTP Steps
testcases:
- name: TestCase SMTP
  steps:
  - type: smtp
    withtls: true
    host: localhost
    port: "465"
    user: yourSMTPUsername
    password: yourSMTPPassword
    to: destinationa@yourdomain.com,destinationb@yourdomain.com
    from: venom@localhost
    subject: title of mail
    body: body of mail
    assertions:
    - result.err ShouldNotExist

Output

Nothing, except result.err is there is an error.

Default assertion

result.err ShouldNotExist

Documentation

Index

Constants

View Source
const Name = "smtp"

Name for test smtp

Variables

This section is empty.

Functions

func New

func New() venom.Executor

New returns a new Test Exec

Types

type Executor

type Executor struct {
	WithTLS  bool   `json:"withtls,omitempty" yaml:"withtls,omitempty"`
	Host     string `json:"host,omitempty" yaml:"host,omitempty"`
	Port     string `json:"port,omitempty" yaml:"port,omitempty"`
	User     string `json:"user,omitempty" yaml:"user,omitempty"`
	Password string `json:"password,omitempty" yaml:"password,omitempty"`
	To       string `json:"to,omitempty" yaml:"to,omitempty"`
	From     string `json:"from,omitempty" yaml:"from,omitempty"`
	Subject  string `json:"subject,omitempty" yaml:"subject,omitempty"`
	Body     string `json:"body,omitempty" yaml:"body,omitempty"`
}

Executor represents a Test Exec

func (Executor) GetDefaultAssertions

func (Executor) GetDefaultAssertions() *venom.StepAssertions

GetDefaultAssertions return default assertions for type exec

func (Executor) Run

func (Executor) Run(ctx context.Context, step venom.TestStep) (interface{}, error)

Run execute TestStep of type exec

func (Executor) ZeroValueResult added in v0.17.0

func (Executor) ZeroValueResult() interface{}

ZeroValueResult return an empty implementation of this executor result

type Result

type Result struct {
	Err         string  `json:"error,omitempty" yaml:"error"`
	TimeSeconds float64 `json:"timeSeconds,omitempty" yaml:"timeSeconds,omitempty"`
}

Result represents a step result

Jump to

Keyboard shortcuts

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