Raixa commands
Methods
assertAbsent(selectorOrItem)
Assert that an element is absent
Parameters:
Name | Type | Description |
---|---|---|
selectorOrItem |
string | Item | the item to check |
assertAbsentWithContents(selector, contents)
Assert that an element is absent (find by its contents). Contents must be
an exact match for text inside the element (not inside its children).
Parameters:
Name | Type | Description |
---|---|---|
selector |
string | of the item |
contents |
string | of the item |
assertDoesNotHaveClass(selectorOrItem, className)
Assert that an element does not have a certain class
Parameters:
Name | Type | Description |
---|---|---|
selectorOrItem |
string | Item | the item to check |
className |
string | the class name to expect will be absent |
assertEqual(a, b, message)
Assert that two items are shallow equal
Parameters:
Name | Type | Description |
---|---|---|
a |
the first item to compare | |
b |
the second item to compare | |
message |
error message to display if the items are not shallow equal |
assertExists(selectorOrItem)
Assert that an element exists
Parameters:
Name | Type | Description |
---|---|---|
selectorOrItem |
string | Item | the item to check |
assertExistsWithContents(selector, contents, messageopt)
Assert that an element exists (find by its contents). Contents must be
an exact match for text inside the element (not inside its children).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selector |
string | css selector of the item | ||
contents |
string | contents of the item | ||
message |
string |
<optional> |
generated message
|
the error message to display if the item cannot be found |
assertFalse(item, message)
Assert that an item is false (falsy also acceptable)
Parameters:
Name | Type | Description |
---|---|---|
item |
the item to test | |
message |
error message to display if the item is falsy |
assertHasClass(selectorOrItem, className)
Assert that an element has a certain class
Parameters:
Name | Type | Description |
---|---|---|
selectorOrItem |
string | Item | the item to check |
className |
the class name to expect in the list |
assertNumElements(selector, numItems)
Assert that an element appears a certain number of times
Parameters:
Name | Type | Description |
---|---|---|
selector |
string | the selector for the item to check for |
numItems |
number | expected number of items to find |
assertTrue(item, message)
Assert that an item is true (truthy also acceptable)
Parameters:
Name | Type | Description |
---|---|---|
item |
the item to test | |
message |
error message to display if the item is not truthy |
click(selectorOrItem)
Click an element
Parameters:
Name | Type | Description |
---|---|---|
selectorOrItem |
string | Item | the item to click |
clickByContents(selector, contents)
Click an element (find it by its contents). Contents must be
an exact match for text inside the element (not inside its children).
Parameters:
Name | Type | Description |
---|---|---|
selector |
string | the item to click |
contents |
string | contents for the item to click |
render(element)
Render an element
Parameters:
Name | Type | Description |
---|---|---|
element |
JSX | jsx to render |
rerender(element)
Re-render to update props
Parameters:
Name | Type | Description |
---|---|---|
element |
JSX | jsx to render |
typeInto(selectorOrItem, text)
Type into a text field
Parameters:
Name | Type | Description |
---|---|---|
selectorOrItem |
string | Item | the item to interact with |
text |
string | the text to type |
uniquify(text) → {string}
Add a unique tag to a name
Parameters:
Name | Type | Description |
---|---|---|
text |
string | the text to make unique |
Returns:
unique text
- Type
- string
(async) waitFor(ms)
Wait for a set amount of time
Parameters:
Name | Type | Description |
---|---|---|
ms |
number | number of ms to wait |
(async) waitForElementAbsent(selectorOrItem, timeoutSecopt)
Wait until an element is absent
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selectorOrItem |
string | Item | the item to check | ||
timeoutSec |
number |
<optional> |
10
|
number of seconds to wait before timing out |
(async) waitForElementPresent(selectorOrItem, timeoutSecopt)
Wait until an element is present
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selectorOrItem |
string | Item | the item to check | ||
timeoutSec |
number |
<optional> |
10
|
number of seconds to wait before timing out |
(async) waitForElementWithContentsAbsent(selector, contents, timeoutSecopt)
Wait until an element is absent (find by contents). Contents must be
an exact match for text inside the element (not inside its children).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selector |
string | the css selector of the item | ||
contents |
string | text contents to search for | ||
timeoutSec |
number |
<optional> |
10
|
number of seconds to wait before timing out |
(async) waitForElementWithContentsPresent(selector, contents, timeoutSecopt)
Wait until an element is present (find by contents). Contents must be
an exact match for text inside the element (not inside its children).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selector |
string | the css selector of the item | ||
contents |
string | text contents to search for | ||
timeoutSec |
number |
<optional> |
10
|
number of seconds to wait before timing out |