Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Actions Reference

guilhermechapiewski edited this page Sep 13, 2010 · 27 revisions


Pyccuracy Built-In Actions

Pyccuracy comes with a set of actions that allow the user to control the browser in the most usual ways, like clicking a link or checking if a textbox contains a given text.

If you want to create your own actions you can learn more about it at the “Creating custom Actions” page.

Pyccuracy’s actions are divided in categories according to the element they relate to: element, checkbox, image, link, page, radio, select and textbox.

If you are not sure about the action you are looking for, we always advise you to look the Element actions, because that’s where most of the fun is.

Table actions

I see “table_name” table as:

Example

  • And I see “some” table as:
    | Name | Age | Sex |
    | John | 28 | Male |
    | Paul | 30 | Male |

Description

This action asserts that the given table matches the one the user specified.

Syntax

# en-us
(And )I see "table_name" table as:
 
# pt-br
(E )[eE]u vejo a tabela "table_name" como:

Regex

# en-us
^(And )?I see [\"](?P<table_name>.+)[\"] table as:$
 
# pt-br
^(E )?[eE]u vejo a tabela [\"](?P<table_name>.+)[\"] como:$

Element actions

Element actions can be used for any registered element (more about registering elements at “Creating custom Pages” section). The majority of Pyccuracy’s actions are in this category, like clicking elements or verifying that they contain a given style.

Whenever you see element_name, it means the name of the registered element or the attribute “name” or “id” of the given element.

Whenever you see [element_type|element_selector] what this means is that you have to use one of the following:

en-us:

  • button
  • radio button
  • div
  • link
  • checkbox
  • select
  • textbox
  • image
  • paragraph
  • ul
  • li
  • table
  • element (only use this if none of the above apply)

pt-br:

  • botão
  • radio
  • div
  • link
  • checkbox
  • select
  • caixa de texto
  • imagem
  • parágrafo
  • ul
  • li
  • tabela
  • elemento (só utilize este se nenhum dos outro se aplicar)

I do not see “element_name” [element_type|element selector]

Examples

  • And I do not see “some” button
  • And I do not see “other” checkbox

Description

This action asserts that the given element is not visible.

Syntax

# en-us
(And )I do not see "element_name" [element_type|element selector]
 
# pt-br
(E )[eE]u não vejo [oa] [element_type|element selector] "element_name"

Regex

# en-us
^(And )?I do not see [\"](?P<element_name>.+)[\"] (?P<element_type><element selector>)$
 
# pt-br
^(E )?[eE]u não vejo [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"]$

I see “element_name” [element_type|element selector] contains “text”

Example

  • I see “username” textbox contains “polo”

Description

This action asserts that the text for the given element contains the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] contains "text"
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" contém "text"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) contains [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] contém [\"](?P<text>.+)[\"]$

I see “element_name” [element_type|element selector] does not contain “text”

Example

  • I see “username” textbox does not contain “polo”

Description

This action asserts that the text for the given element does not contain the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] does not contain "text"
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" não contém "text"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) does not contain [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] não contém [\"](?P<text>.+)[\"]$

I click “element_name” [element_type|element selector]( and wait)

Examples

  • And I click “some” button
  • And I click “other” checkbox and wait

Description

This action instructs the browser driver to click the given element. If the “and wait” suffix is used, a “Wait for page to load” action is executed after this one.

Syntax

# en-us
(And )I click "element_name" [element_type|element selector]( and wait)
 
# pt-br
(E )[eE]u clico n[oa] [element_type|element selector] "element_name"( e espero)

Regex

# en-us
^(And )?I click [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>)(?P<should_wait> and wait)?$
 
# pt-br
^(E )?[eE]u clico n[oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"](?P<should_wait> e espero)?$

I see “element_name” [element_type|element selector] is disabled

Examples

  • And I see “some” button is disabled
  • And I see “other” textbox is disabled

Description

This action asserts that the given element is disabled.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] is disabled
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" está desabilitad[oa]

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) is disabled$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] está desabilitad[oa]$

I see “element_name” [element_type|element selector] contains “markup” markup

Example

  • I see “username” textbox contains “<p>polo</p>” markup

Description

This action asserts that the markup for the given element contains the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] contains "markup" markup
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" contém o markup "markup"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) contains [\"](?P<markup>.+)[\"] markup$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] contém o markup [\"](?P<markup>.+)[\"]$

I see “element_name” [element_type|element selector] does not have “style_name” style

Examples

  • And I see “some” textbox does not have “width” style
  • And I see “other” button does not have “visible” style

Description

This action asserts that the given element does not have the given style with any value.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] does not have "style_name" style
 
# pt-br
(E )[eE]u vejo que [ao] [element_type|element selector] "element_name" não contém o estilo "style_name"

Regex

# en-us
^(And )?I see [\"](?P<element_name>.+)[\"] (?P<element_type><element selector>) does not have [\"](?P<style_name>.+)[\"] style$
 
# pt-br
^(E )?[eE]u vejo que [ao] (?P<element_type><element selector>) [\"](?P<element_name>.+)[\"] não contém o estilo [\"](?P<style_name>.+)[\"]$

I see “element_name” [element_type|element selector] does not match “text”

Example

  • I see “username” textbox matches “polo”

Description

This action asserts that the text for the given element does not match exactly the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] does not match "text"
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" não contém exatamente "text"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) does not match [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] não contém exatamente [\"](?P<text>.+)[\"]$

I mouseout “element_name” [element_type|element selector]

Example

  • And I mouseout “some” image

Description

This action instructs the browser driver to remove mouse focus from the specified element.

Syntax

# en-us
(And )I mouseout "element_name" [element_type|element selector]
 
# pt-br
(E )[eE]u retiro o mouse d[oa] [element_type|element selector] "element_name"

Regex

# en-us
^(And )?I mouseout [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>)$
 
# pt-br
^(E )?[eE]u retiro o mouse d[oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"]$

I see “element_name” [element_type|element selector] matches “text”

Example

  • I see “username” textbox matches “polo”

Description

This action asserts that the text for the given element matches exactly the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] matches "text"
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" contém exatamente "text"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) matches [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] contém exatamente [\"](?P<text>.+)[\"]$

I see “element_name” [element_type|element selector]

Examples

  • And I see “some” button
  • And I see “other” checkbox

Description

This action asserts that the given element is visible.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector]
 
# pt-br
(E )[eE]u vejo [oa] [element_type|element selector] "element_name"

Regex

# en-us
^(And )?I see [\"](?P<element_name>.+)[\"] (?P<element_type><element selector>)$
 
# pt-br
^(E )?[eE]u vejo [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"]$

I see “element_name” [element_type|element selector] has “style_name” style

Examples

  • And I see “some” textbox has “width” style
  • And I see “other” button has “visible” style

Description

This action asserts that the given element has the given style with any value.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] has "style_name" style
 
# pt-br
(E )[eE]u vejo que [ao] [element_type|element selector] "element_name" contém o estilo "style_name"

Regex

# en-us
^(And )?I see [\"](?P<element_name>.+)[\"] (?P<element_type><element selector>) has [\"](?P<style_name>.+)[\"] style$
 
# pt-br
^(E )?[eE]u vejo que [ao] (?P<element_type><element selector>) [\"](?P<element_name>.+)[\"] contém o estilo [\"](?P<style_name>.+)[\"]$

I see “element_name” [element_type|element selector] matches “markup” markup

Example

  • I see “username” textbox matches “<p>polo</p>” markup

Description

This action asserts that the markup for the given element matches exactly the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] matches "markup" markup
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" contém exatamente o markup "markup"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) matches [\"](?P<markup>.+)[\"] markup$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] contém exatamente o markup [\"](?P<markup>.+)[\"]$

I mouseover “element_name” [element_type|element selector]

Example

  • And I mouseover “some” image

Description

This action instructs the browser driver to mouse over the specified element.

Syntax

# en-us
(And )I mouseover "element_name" [element_type|element selector]
 
# pt-br
(E )[eE]u passo o mouse n[oa] [element_type|element selector] "element_name"

Regex

# en-us
^(And )?I mouseover [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>)$
 
# pt-br
^(E )?[eE]u passo o mouse n[oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"]$

I see “element_name” [element_type|element selector] does not contain “markup” markup

Example

  • I see “username” textbox does not contain “<p>polo</p>” markup

Description

This action asserts that the markup for the given element does not contain the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] does not contain "markup" markup
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" não contém o markup "markup"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) does not contain [\"](?P<markup>.+)[\"] markup$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] não contém o markup [\"](?P<markup>.+)[\"]$

I see “element_name” [element_type|element selector] does not match “markup” markup

Example

  • I see “username” textbox does not match “<p>polo</p>” markup

Description

This action asserts that the markup for the given element does not match exactly the specified one.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] does not match "markup" markup
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" não contém exatamente o markup "markup"

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) does not match [\"](?P<markup>.+)[\"] markup$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] não contém exatamente o markup [\"](?P<markup>.+)[\"]$

I wait for “element_name” [element_type|element selector] to disappear( for X seconds)

Examples

  • And I wait for “some” button element to disappear
  • And I wait for “other” textbox element to disappear for 5 seconds

Description

Waits until a given element disappears (or is not visible already) or times out.

This action is really useful when you have some processing done (maybe AJAX) before an element is dynamically removed or hidden.

Syntax

# en-us
(And )I wait for "element_name" [element_type|element selector] to disappear( for X seconds)
 
# pt-br
(E )[eE]u espero [oa] [element_type|element selector] "element_name" desaparecer( por X segundos)

Regex

# en-us
^(And )?I wait for [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) to disappear( for (?P<timeout>\d+) seconds)?$
 
# pt-br
^(E )?[eE]u espero [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] desaparecer( por (?P<timeout>\d+) segundos)?$

I see “element_name” [element_type|element selector] is enabled

Examples

  • And I see “some” button is enabled
  • And I see “other” textbox is enabled

Description

This action asserts that the given element is enabled.

Syntax

# en-us
(And )I see "element_name" [element_type|element selector] is enabled
 
# pt-br
(E )[eE]u vejo que [oa] [element_type|element selector] "element_name" está habilitad[oa]

Regex

# en-us
^(And )?I see [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) is enabled$
 
# pt-br
^(E )?[eE]u vejo que [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] está habilitad[oa]$

I wait for “element_name” [element_type|element selector] to be present( for X seconds)

Examples

  • And I wait for “some” button element to be present
  • And I wait for “other” textbox element to be present for 5 seconds

Description

Waits until a given element appears or times out.

This action is really useful when you have some processing done (maybe AJAX) before an element is dynamically created.

Syntax

# en-us
(And )I wait for "element_name" [element_type|element selector] to be present( for X seconds)
 
# pt-br
(E )[eE]u espero [oa] [element_type|element selector] "element_name" aparecer( por X segundos)

Regex

# en-us
^(And )?I wait for [\"](?P<element_name>[^"]+)[\"] (?P<element_type><element selector>) to be present( for (?P<timeout>\d+) seconds)?$
 
# pt-br
^(E )?[eE]u espero [oa] (?P<element_type><element selector>) [\"](?P<element_name>[^"]+)[\"] aparecer( por (?P<timeout>\d+) segundos)?$

I drag the “from_element_name” [from_element_type|element selector] to the “to_element_name” [to_element_type|element selector]

Example

  • I drag the “from” div to the “target” div

Description

This action instructs the browser driver to drag the “from” element to the “target” element.

Syntax

# en-us
(And )I drag the "from_element_name" [from_element_type|element selector] to the "to_element_name" [to_element_type|element selector]
 
# pt-br
(E )[eE]u arrasto [oa] [from_element_type|element selector] "from_element_name" para [oa] [to_element_type|element selector] "to_element_name"

Regex

# en-us
^(And )?I drag the [\"](?P<from_element_name>.+)[\"] (?P<from_element_type><element selector>) to the [\"](?P<to_element_name>.+)[\"] (?P<to_element_type><element selector>)?$
 
# pt-br
^(E )?[eE]u arrasto [oa] (?P<from_element_type><element selector>) [\"](?P<from_element_name>.+)[\"] para [oa] (?P<to_element_type><element selector>) [\"](?P<to_element_name>[^"]+)[\"]?$

Checkbox actions

I see the “checkbox_key” checkbox is not checked

Example

  • And I see the “book” checkbox is not checked

Description

This action asserts that the given checkbox is not checked.

Syntax

# en-us
(And )I see the "checkbox_key" checkbox is not checked
 
# pt-br
(E )[eE]u vejo que a checkbox "checkbox_key" está desmarcada

Regex

# en-us
^(And )?I see the [\"](?P<checkbox_key>.+)[\"] checkbox is not checked$
 
# pt-br
^(E )?[eE]u vejo que a checkbox [\"](?P<checkbox_key>.+)[\"] está desmarcada$

I uncheck the “checkbox_key” checkbox

Example

  • And I uncheck the “book” checkbox

Description

This action unchecks the given checkbox.

Syntax

# en-us
(And )I uncheck the "checkbox_key" checkbox
 
# pt-br
(E )[eE]u desmarco a checkbox "checkbox_key"

Regex

# en-us
^(And )?I uncheck the [\"](?P<checkbox_key>.+)[\"] checkbox$
 
# pt-br
^(E )?[eE]u desmarco a checkbox [\"](?P<checkbox_key>.+)[\"]$

I see the “checkbox_key” checkbox is checked

Example

  • And I see the “book” checkbox is checked

Description

This action asserts that the given checkbox is checked.

Syntax

# en-us
(And )I see the "checkbox_key" checkbox is checked
 
# pt-br
(E )[eE]u vejo que a checkbox "checkbox_key" está marcada

Regex

# en-us
^(And )?I see the [\"](?P<checkbox_key>.+)[\"] checkbox is checked$
 
# pt-br
^(E )?[eE]u vejo que a checkbox [\"](?P<checkbox_key>.+)[\"] está marcada$

I check the “checkbox_key” checkbox

Example

  • And I check the “book” checkbox

Description

This action checks the given checkbox.

Syntax

# en-us
(And )I check the "checkbox_key" checkbox
 
# pt-br
(E )[eE]u marco a checkbox "checkbox_key"

Regex

# en-us
^(And )?I check the [\"](?P<checkbox_key>.+)[\"] checkbox$
 
# pt-br
^(E )?[eE]u marco a checkbox [\"](?P<checkbox_key>.+)[\"]$

Select actions

I see “select_name” select has selected text of “text”

Example

  • And I see “sports” select has selected text of “soccer”

Description

This action asserts that the currently selected option in the specified select has the specified text.

Syntax

# en-us
(And )I see "select_name" select has selected text of "text"
 
# pt-br
(E )[eE]u vejo que o texto selecionado da select "select_name" é "text"

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select has selected text of [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que o texto selecionado da select [\"](?P<select_name>.+)[\"] é [\"](?P<text>.+)[\"]$

I see “select_name” select does not contain an option with text “text”

Example

  • And I see “sports” select does not contain an option with text “soccer”

Description

This action asserts that the specified select does not contain any options with the specified text.

Syntax

# en-us
(And )I see "select_name" select does not contain an option with text "text"
 
# pt-br
(E )[eE]u vejo que a select "select_name" não contém uma opção com texto "text"

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select does not contain an option with text [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que a select [\"](?P<select_name>.+)[\"] não contém uma opção com texto [\"](?P<text>.+)[\"]$

I see “select_name” select contains an option with text “text”

Example

  • And I see “sports” select contains an option with text “soccer”

Description

This action asserts that the specified select contains at least one option with the specified text.

Syntax

# en-us
(And )I see "select_name" select contains an option with text "text"
 
# pt-br
(E )[eE]u vejo que a select "select_name" contém uma opção com texto "text"

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select contains an option with text [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que a select [\"](?P<select_name>.+)[\"] contém uma opção com texto [\"](?P<text>.+)[\"]$

I select the option with text of “text” in “select_name” select

Example

  • And I select the option with text of “soccer” in “sports” select

Description

This action instructs the browser driver to select the option in the specified select with the specified text.

Syntax

# en-us
(And )I select the option with text of "text" in "select_name" select
 
# pt-br
(E )[eE]u seleciono o item com texto "text" na select "select_name"

Regex

# en-us
^(And )?I select the option with text of [\"](?P<text>.+)[\"] in [\"](?P<select_name>.+)[\"] select$
 
# pt-br
^(E )?[eE]u seleciono o item com texto [\"](?P<text>.+)[\"] na select [\"](?P<select_name>.+)[\"]$

I see “select_name” select does not have selected index of X

Example

  • And I see “sports” select does not have selected index of 1

Description

This action asserts that the currently selected option in the specified select does not have the specified index.

Syntax

# en-us
(And )I see "select_name" select does not have selected index of X
 
# pt-br
(E )[eE]u vejo que o índice selecionado da select "select_name" não é X

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select does not have selected index of (?P<index>\d+)$
 
# pt-br
^(E )?[eE]u vejo que o índice selecionado da select [\"](?P<select_name>.+)[\"] não é (?P<index>\d+)$

I see “select_name” select has selected value of “option_value”

Example

  • And I see “sports” select has selected value of “1”

Description

This action asserts that the currently selected option in the specified select has the specified value.

Syntax

# en-us
(And )I see "select_name" select has selected value of "option_value"
 
# pt-br
(E )[eE]u vejo que o valor selecionado da select "select_name" é "option_value"

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select has selected value of [\"](?P<option_value>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que o valor selecionado da select [\"](?P<select_name>.+)[\"] é [\"](?P<option_value>.+)[\"]$

I select the option with value of “option_value” in “select_name” select

Example

  • And I select the option with value of “1” in “sports” select

Description

This action instructs the browser driver to select the option in the specified select that matches the specified value.

Syntax

# en-us
(And )I select the option with value of "option_value" in "select_name" select
 
# pt-br
(E )[eE]u seleciono o item com valor "option_value" na select "select_name"

Regex

# en-us
^(And )?I select the option with value of [\"](?P<option_value>.+)[\"] in [\"](?P<select_name>.+)[\"] select$
 
# pt-br
^(E )?[eE]u seleciono o item com valor [\"](?P<option_value>.+)[\"] na select [\"](?P<select_name>.+)[\"]$

I see “select_name” select does not have selected text of “text”

Example

  • And I see “sports” select does not have selected text of “soccer”

Description

This action asserts that the currently selected option in the specified select does not have the specified text.

Syntax

# en-us
(And )I see "select_name" select does not have selected text of "text"
 
# pt-br
(E )[eE]u vejo que o texto selecionado da select "select_name" não é "text"

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select does not have selected text of [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que o texto selecionado da select [\"](?P<select_name>.+)[\"] não é [\"](?P<text>.+)[\"]$

I select the option with index of X in “select_name” select

Example

  • And I select the option with index of 1 in “sports” select

Description

This action instructs the browser driver to select the option in the specified select with the specified index.

Syntax

# en-us
(And )I select the option with index of X in "select_name" select
 
# pt-br
(E )[eE]u seleciono o item com índice X na select "select_name"

Regex

# en-us
^(And )?I select the option with index of (?P<index>\d+) in [\"](?P<select_name>.+)[\"] select$
 
# pt-br
^(E )?[eE]u seleciono o item com índice (?P<index>\d+) na select [\"](?P<select_name>.+)[\"]$

I see “select_name” select has selected index of X

Example

  • And I see “sports” select has selected index of 1

Description

This action asserts that the currently selected option in the specified select has the specified index.

Syntax

# en-us
(And )I see "select_name" select has selected index of X
 
# pt-br
(E )[eE]u vejo que o índice selecionado da select "select_name" é X

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select has selected index of (?P<index>\d+)$
 
# pt-br
^(E )?[eE]u vejo que o índice selecionado da select [\"](?P<select_name>.+)[\"] é (?P<index>\d+)$

I see “select_name” select does not have selected value of “value”

Example

  • And I see “sports” select does not have selected value of “1”

Description

This action asserts that the currently selected option in the specified select does not have the specified value.

Syntax

# en-us
(And )I see "select_name" select does not have selected value of "value"
 
# pt-br
(E )[eE]u vejo que o valor selecionado da select "select_name" não é "value"

Regex

# en-us
^(And )?I see [\"](?P<select_name>.+)[\"] select does not have selected value of [\"](?P<value>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que o valor selecionado da select [\"](?P<select_name>.+)[\"] não é [\"](?P<value>.+)[\"]$

Radio actions

I see the “radio_key” radio is checked

Example

  • And I see the “credit card” radio is checked

Description

This action asserts that the given radio button is checked.

Syntax

# en-us
(And )I see the "radio_key" radio is checked
 
# pt-br
(E )[eE]u vejo que a radio "radio_key" está marcada

Regex

# en-us
^(And )?I see the [\"](?P<radio_key>.+)[\"] radio is checked$
 
# pt-br
^(E )?[eE]u vejo que a radio [\"](?P<radio_key>.+)[\"] está marcada$

I see the “radio_key” radio is not checked

Example

  • And I see the “credit card” radio is not checked

Description

This action asserts that the given radio button is not checked.

Syntax

# en-us
(And )I see the "radio_key" radio is not checked
 
# pt-br
(E )[eE]u vejo que a radio "radio_key" está desmarcada

Regex

# en-us
^(And )?I see the [\"](?P<radio_key>.+)[\"] radio is not checked$
 
# pt-br
^(E )?[eE]u vejo que a radio [\"](?P<radio_key>.+)[\"] está desmarcada$

I check the “radio_key” radio

Example

  • And I check the “credit card” radio

Description

This action marks the given radio button.

Syntax

# en-us
(And )I check the "radio_key" radio
 
# pt-br
(E )[eE]u marco a radio "radio_key"

Regex

# en-us
^(And )?I check the [\"](?P<radio_key>.+)[\"] radio$
 
# pt-br
^(E )?[eE]u marco a radio [\"](?P<radio_key>.+)[\"]$

Image actions

I see “image_name” image has src of “src”

Example

  • And I see “logo” image has src of “images/logo.png”

Description

This action asserts that an image has the given src attribute.

Syntax

# en-us
(And )I see "image_name" image has src of "src"
 
# pt-br
(E )[eE]u vejo que a imagem "image_name" tem src de "src"

Regex

# en-us
^(And )?I see [\"](?P<image_name>.+)[\"] image has src of [\"](?P<src>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que a imagem [\"](?P<image_name>.+)[\"] tem src de [\"](?P<src>.+)[\"]$

I see “image_name” image does not have src of “src”

Example

  • And I see “logo” image does not have src of “images/logo.png”

Description

This action asserts that an image does not have the given src attribute.

Syntax

# en-us
(And )I see "image_name" image does not have src of "src"
 
# pt-br
(E )[eE]u vejo que a imagem "image_name" não tem src de "src"

Regex

# en-us
^(And )?I see [\"](?P<image_name>.+)[\"] image does not have src of [\"](?P<src>.+)[\"]$
 
# pt-br
^(E )?[eE]u vejo que a imagem [\"](?P<image_name>.+)[\"] não tem src de [\"](?P<src>.+)[\"]$

Textbox actions

I slowly fill “textbox_name” textbox with “text”

Example

  • And I slowly fill “details” textbox with “text”

Description

This action types the given text in the given textbox. The difference between “slowly” typing and the regular typing is that this action raises javascript “key” events (keyUp, keyDown, etc).

Syntax

# en-us
(And )I slowly fill "textbox_name" textbox with "text"
 
# pt-br
(E )[eE]u preencho lentamente a caixa de texto "textbox_name" com "text"

Regex

# en-us
^(And )?I slowly fill [\"](?P<textbox_name>.+)[\"] textbox with [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u preencho lentamente a caixa de texto [\"](?P<textbox_name>.+)[\"] com [\"](?P<text>.+)[\"]$

I see “textbox_name” textbox is empty

Example

  • And I see “username” textbox is empty

Description

This action asserts that the given textbox is empty.

Syntax

# en-us
(And )I see "textbox_name" textbox is empty
 
# pt-br
(E )[eE]u vejo que a caixa de texto "textbox_name" está vazia

Regex

# en-us
^(And )?I see [\"](?P<textbox_name>.+)[\"] textbox is empty$
 
# pt-br
^(E )?[eE]u vejo que a caixa de texto [\"](?P<textbox_name>.+)[\"] está vazia$

I clean “textbox_name” textbox

Example

  • And I clean “details” textbox

Description

This action cleans the given textbox (empties any text inside of it).

Syntax

# en-us
(And )I clean "textbox_name" textbox
 
# pt-br
(E )[eE]u limpo a caixa de texto "textbox_name"

Regex

# en-us
^(And )?I clean [\"](?P<textbox_name>.+)[\"] textbox$
 
# pt-br
^(E )?[eE]u limpo a caixa de texto [\"](?P<textbox_name>.+)[\"]$

I fill “textbox_name” textbox with “text”

Example

  • And I fill “details” textbox with “text”

Description

This action types the given text in the given textbox.

Syntax

# en-us
(And )I fill "textbox_name" textbox with "text"
 
# pt-br
(E )[eE]u preencho a caixa de texto "textbox_name" com "text"

Regex

# en-us
^(And )?I fill [\"](?P<textbox_name>.+)[\"] textbox with [\"](?P<text>.+)[\"]$
 
# pt-br
^(E )?[eE]u preencho a caixa de texto [\"](?P<textbox_name>.+)[\"] com [\"](?P<text>.+)[\"]$

I see “textbox_name” textbox is not empty

Example

  • And I see “username” textbox is not empty

Description

This action asserts that the given textbox is not empty.

Syntax

# en-us
(And )I see "textbox_name" textbox is not empty
 
# pt-br
(E )[eE]u vejo que a caixa de texto "textbox_name" não está vazia

Regex

# en-us
^(And )?I see [\"](?P<textbox_name>.+)[\"] textbox is not empty$
 
# pt-br
^(E )?[eE]u vejo que a caixa de texto [\"](?P<textbox_name>.+)[\"] não está vazia$

Link actions

I see “link_name” link has “href” href

Example

  • And I see “logout” link has “/app/logout” href

Description

This action asserts that a link has the given href attribute.

Syntax

# en-us
(And )I see "link_name" link has "href" href
 
# pt-br
(E )[eE]u vejo que o link "link_name" tem href "href"

Regex

# en-us
^(And )?I see [\"](?P<link_name>.+)[\"] link has [\"](?P<href>.+)[\"] href$
 
# pt-br
^(E )?[eE]u vejo que o link [\"](?P<link_name>.+)[\"] tem href [\"](?P<href>.+)[\"]$

Page actions

Page actions are actions that have a specific impact in the browser, like navigating to a different page.

This is a very important category of actions, since almost any single test relies on navigating to a given page.

I go to [page|“url”]

Examples

  • And I go to My Custom Page
  • And I go to “http://www.google.com”

Description

This action tells Pyccuracy that the current browser driver (Creating a custom Browser Driver) should navigate to the URL that’s registered in the specified page. Other than that, it also changes that current page in Pyccuracy’s context to the specified one. This means that Pyccuracy will start using the registered elements and url in the specified page.

For more information on creating custom pages check the Creating custom Pages page.

If you specify an url directly, Pyccuracy sets the current page to None and you can’t use registered elements. That might make sense for some scenarios, but is the least preferred way of using this action.

This action also issues automatically a wait for page to load action after navigating. This is important to make sure that the following actions work with a properly loaded page.

Syntax

# en-us
(And )I go to [page|"url"]
 
# pt-br
(E )[eE]u navego para [page|"url"]

Regex

# en-us
^(And )?I go to (?P<url>[\"](([\w:/._-]|\=|\?|\&|\"|\;|\%)+)[\"]|([\w\s_.-]+))$
 
# pt-br
^(E )?[eE]u navego para (?P<url>[\"](([\w:/._-]|\=|\?|\&|\"|\;|\%)+)[\"]|([\w\s_.-]+))$

I see that current page does not contain “expected_markup”

Example

  • And I see that current page does not contain “<p>expected markup</p>”

Description

This action asserts that the currently loaded page’s mark-up does not contain the given mark-up.

Syntax

# en-us
(And )I see that current page does not contain "expected_markup"
 
# pt-br
(E )[eE]u vejo que a página atual não contém "expected_markup"

Regex

# en-us
^(And )?I see that current page does not contain [\"\'](?P<expected_markup>.+)[\'\"]$
 
# pt-br
^(E )?[eE]u vejo que a página atual não contém [\"\'](?P<expected_markup>.+)[\'\"]$

I am in the [page|“url”]

Example

  • And I am in My Custom Page

Description

This action tells Pyccuracy that it should change the current page (as far as registered elements and url go) to a given page.

The same rule for direct urls of Go to Page applies to this action.

Other than that, this action does not do anything. The main purpose of this action is responding to some client event or redirect that might have changed the current page without our direct action (like submitting a form that redirects us to a different page).

Syntax

# en-us
(And )I am in the [page|"url"]
 
# pt-br
(E )[eE]u estou n[oa] [page|"url"]

Regex

# en-us
^(And )?I am in the (?P<url>[\"](([\w:/._-]|\=|\?|\&|\"|\;|\%)+)[\"]|([\w\s_.-]+))$
 
# pt-br
^(E )?[eE]u estou n[oa] (?P<url>[\"](([\w:/._-]|\=|\?|\&|\"|\;|\%)+)[\"]|([\w\s_.-]+))$

I wait for the page to load( for X seconds)

Examples

  • And I wait for the page to load
  • And I wait for the page to load for 5 seconds

Description

This action instructs the browser driver to wait for a given number of seconds for the page to load. If it times out, the test fails.

Syntax

# en-us
(And )I wait for the page to load( for X seconds)
 
# pt-br
(E )[eE]u espero a página ser carregada( por X segundos)

Regex

# en-us
^(And )?I wait for the page to load( for (?P<timeout>\d+) seconds)?$
 
# pt-br
^(E )?[eE]u espero a página ser carregada( por (?P<timeout>\d+) segundos)?$

I see “title” title

Example

  • And I see “whatever” title

Description

This action asserts that the currently loaded page’s title (Browser title) is the specified one.

Syntax

# en-us
(And )I see "title" title
 
# pt-br
(E )[eE]u vejo o título "title"

Regex

# en-us
^(And )?I see [\"](?P<title>.+)[\"] title$
 
# pt-br
^(E )?[eE]u vejo o título [\"](?P<title>.+)[\"]$

I go to page (for|of|with) parameters

Examples

  • And I go to Profile Page of user “name”
  • And I go to Config Page for user “name”
  • And I go to Search Page with query “apple”, order “desc”, page “10”

Description

This action does the same thing as the “I go to [page]” but allows you to have variable URLs and pass parameters to be included in them. You can pass as many parameters as you want using commas.

For instance, the examples above will access pages with the following URLs (respectively):

  • url = “/<user>”
  • url = “/config/<user>”
  • url = “/search.php?q=<query>&order=<order>&p=<page>”

Parameters will be automatically included in the URL when you call these pages. For more information on creating custom pages check the Creating custom Pages page.

Syntax

# en-us
(And )I go to page (for|of|with) parameters
 
# pt-br
(E )[eE]u navego para page (com|da|de|do|para) parameters

Regex

# en-us
^(And )?I go to (?P<url>([\w\s_.-]+)) (for|of|with){1} (?P<parameters>.+)$
 
# pt-br
^(E )?[eE]u navego para (?P<url>([\w\s_.-]+)) (com|da|de|do|para){1} (?P<parameters>.+)$

I wait for [X|X.X] second[s]

Examples

  • And I wait for 5 seconds
  • And I wait for 1 second
  • And I wait for 3.5 seconds

Description

This action is just a proxy to Python’s time.sleep function. It just hangs for a given number of seconds.

Syntax

# en-us
(And )I wait for [X|X.X] second[s]
 
# pt-br
(E )[eE]u espero por [X|X.X] segundo[s]

Regex

# en-us
^(And )?I wait for (?P<timeout>\d+([.]\d+)?) second[s]?$
 
# pt-br
^(E )?[eE]u espero por (?P<timeout>\d+([.]\d+)?) segundo[s]?$

I see that current page contains “expected_markup”

Example

  • And I see that current page contains “<p>expected markup</p>”

Description

This action asserts that the currently loaded page’s mark-up contains the given mark-up.

Syntax

# en-us
(And )I see that current page contains "expected_markup"
 
# pt-br
(E )[eE]u vejo que a página atual contém "expected_markup"

Regex

# en-us
^(And )?I see that current page contains [\"\'](?P<expected_markup>.+)[\'\"]$
 
# pt-br
^(E )?[eE]u vejo que a página atual contém [\"\'](?P<expected_markup>.+)[\'\"]$
Clone this wiki locally