-
Notifications
You must be signed in to change notification settings - Fork 1
Asserts
Mikhail Trifonov edited this page Jun 5, 2019
·
6 revisions
All matchers try to assert condition for timeout in seconds, by default timeout is 30.
arguments:
-
text
string
keyword arguments:
-
timeout
int, floattimeout in secods -
delay
int, floatsleep between tries
from hamcrest import assert_that
from pagium.matchers import has_text
assert_that(page, has_text('some text', timeout=10, delay=0.5))
from hamcrest import assert_that
from pagium.matchers import has_text
assert_that(page.some_element, has_text('some text'))
keyword arguments:
-
timeout
int, floattimeout in secods -
delay
int, floatsleep between tries
from hamcrest import assert_that
from pagium.matchers import element_exists
assert_that(page.some_element, element_exists())
arguments:
-
url_path
string
keyword arguments:
-
timeout
int, floattimeout in secods -
delay
int, floatsleep between tries
from hamcrest import assert_that
from pagium.matchers import url_path_equal
assert_that(wd_or_page, url_path_equal('/some/url/path'))
arguments:
-
url_path_part
string
keyword arguments:
-
timeout
int, floattimeout in secods -
delay
int, floatsleep between tries
from hamcrest import assert_that
from pagium.matchers import url_path_contains
assert_that(wd_or_page, url_path_contains('/path'))
arguments:
-
regexp
string
keyword arguments:
-
timeout
int, floattimeout in secods -
delay
int, floatsleep between tries
from hamcrest import assert_that
from pagium.matchers import match_regexp
assert_that(page, match_regexp('[a-z]+'))
from hamcrest import assert_that
from pagium.matchers import match_regexp
assert_that(page.some_element, match_regexp('[a-z]+'))