web

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2017 License: BSD-3-Clause Imports: 9 Imported by: 5

README

Venom - Executor Web

Navigate in a web application

Use case: You have a web application and you want to check some behaviours ? Venom allows you to navigate into it and execute actions.

Input

name: TestSuite Web
testcases:
- name: TestCase Google search
  context:
    type: web
    width: 1920
    height: 1080
    driver: phantomjs
  steps:
  - action:
      navigate:
        url: https://www.google.fr
    assertions:
    - result.title ShouldEqual Google
    - result.url ShouldEqual https://www.google.fr
  - action:
      find: input[name="q"]
    assertions:
     - result.find ShouldEqual 1
  - action:
      fill:
      - find: input[name="q"]
        text: "venom runabove"
  - action:
      click:
        find: input[value="Recherche Google"]
        wait: 1
    screenshot: googlesearch.jpg

Output

  • result.url
  • result.timeseconds
  • result.timehuman
  • result.title
  • result.find

Documentation

Index

Constants

View Source
const Name = "web"

Name of executor

Variables

This section is empty.

Functions

func New

func New() venom.Executor

New returns a new Executor

Types

type Action

type Action struct {
	Click    *Click    `yaml:"click,omitempty"`
	Fill     []Fill    `yaml:"fill,omitempty"`
	Find     string    `yaml:"find,omitempty"`
	Navigate *Navigate `yaml:"navigate,omitempty"`
}

Action represents what can be done with web executor

type Click added in v0.0.4

type Click struct {
	Find string `yaml:"find,omitempty"`
	Wait int64  `yaml:"wait"`
}

type Executor

type Executor struct {
	Action     Action `json:"action,omitempty" yaml:"action"`
	Screenshot string `json:"screenshot,omitempty" yaml:"screenshot"`
}

Executor struct

func (Executor) Run

func (Executor) Run(testCaseContext venom.TestCaseContext, l *log.Entry, step venom.TestStep) (venom.ExecutorResult, error)

Run execute TestStep

type Fill

type Fill struct {
	Find string `yaml:"find,omitempty"`
	Text string `yaml:"text,omitempty"`
}

Fill represents informations needed to fill input/textarea

type Navigate struct {
	Url   string `yaml:"url,omitempty"`
	Reset bool   `yaml:"reset,omitempty"`
}

type Result

type Result struct {
	Executor    Executor `json:"executor,omitempty" yaml:"executor,omitempty"`
	Find        int      `json:"find,omitempty" yaml:"find,omitempty"`
	HTML        string   `json:"html,omitempty" yaml:"html,omitempty"`
	TimeSeconds float64  `json:"timeseconds,omitempty" yaml:"timeseconds,omitempty"`
	TimeHuman   string   `json:"timehuman,omitempty" yaml:"timehuman,omitempty"`
	Title       string   `json:"title,omitempty" yaml:"title,omitempty"`
	URL         string   `json:"url,omitempty" yaml:"url,omitempty"`
}

Result represents a step result

Jump to

Keyboard shortcuts

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