imap

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: BSD-3-Clause Imports: 18 Imported by: 0

README

Venom - Executor IMAP

Use case: your software send a mail ? Venom can test if mail is received. Body of mail can be reused in further steps.

Input

name: TestSuite with IMAP Steps
testcases:
- name: TestCase IMAP
  steps:
  - type: imap
    imaphost: yourimaphost
    imapport: 993
    imapuser: yourimapuser
    imappassword: "yourimappassword"
    mbox: INBOX
    mboxonsuccess: mailsMatches
    searchfrom: '.*@your-domain.localhost'
    searchsubject: 'Title of mail with *'
    assertions:
    - result.err ShouldNotExist
  • imaphost: imap host
  • imapport: optional, default: 993
  • imapuser: imap username
  • imappassword: imap password
  • searchfrom: optional
  • searchsubject: optional
  • mbox: optional, default is INBOX
  • mboxonsuccess: optional. If not empty, move found mail (matching criteria) to another mbox.

Input must contains searchfrom and/or searchsubject.

Output

  • result.err is there is an arror.
  • result.subject: subject of searched mail
  • result.body: body of searched mail

Default assertion

result.err ShouldNotExist

Documentation

Index

Constants

View Source
const Name = "imap"

Name for test imap

Variables

This section is empty.

Functions

func New

func New() venom.Executor

New returns a new Test Exec

Types

type Executor

type Executor struct {
	IMAPHost      string `json:"imaphost,omitempty" yaml:"imaphost,omitempty"`
	IMAPPort      string `json:"imapport,omitempty" yaml:"imapport,omitempty"`
	IMAPUser      string `json:"imapuser,omitempty" yaml:"imapuser,omitempty"`
	IMAPPassword  string `json:"imappassword,omitempty" yaml:"imappassword,omitempty"`
	MBox          string `json:"mbox,omitempty" yaml:"mbox,omitempty"`
	MBoxOnSuccess string `json:"mboxonsuccess,omitempty" yaml:"mboxonsuccess,omitempty"`
	SearchFrom    string `json:"searchfrom,omitempty" yaml:"searchfrom,omitempty"`
	SearchSubject string `json:"searchsubject,omitempty" yaml:"searchsubject,omitempty"`
}

Executor represents a Test Exec

func (Executor) GetDefaultAssertions

func (Executor) GetDefaultAssertions() *venom.StepAssertions

GetDefaultAssertions return default assertions for type exec

func (Executor) Run

Run execute TestStep of type exec

type Mail

type Mail struct {
	From    string
	Subject string
	UID     uint32
	Body    string
}

Mail contains an analyzed mail

type Result

type Result struct {
	Executor    Executor `json:"executor,omitempty" yaml:"executor,omitempty"`
	Err         string   `json:"error" yaml:"error"`
	Subject     string   `json:"subject,omitempty" yaml:"subject,omitempty"`
	Body        string   `json:"body,omitempty" yaml:"body,omitempty"`
	TimeSeconds float64  `json:"timeSeconds,omitempty" yaml:"timeSeconds,omitempty"`
	TimeHuman   string   `json:"timeHuman,omitempty" yaml:"timeHuman,omitempty"`
}

Result represents a step result

Jump to

Keyboard shortcuts

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