-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_value_test.py
38 lines (34 loc) · 1.35 KB
/
check_value_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from sys import stderr
from je_web_runner import webdriver_wrapper_instance, TestObject, web_element_wrapper
webdriver_wrapper_instance.set_driver("firefox")
firefox_webdriver = webdriver_wrapper_instance.current_webdriver
webdriver_wrapper_instance.to_url("http://www.python.org")
webdriver_wrapper_instance.implicitly_wait(3)
webdriver_wrapper_instance.check_current_webdriver(
{
"title": "Welcome to Python.org"
}
)
try:
webdriver_wrapper_instance.check_current_webdriver(
{
"title": "this should be raise exception"
}
)
except Exception as error:
print(repr(error), file=stderr)
google_input = TestObject("q", "name")
webdriver_wrapper_instance.implicitly_wait(3)
webdriver_wrapper_instance.find_element(google_input)
web_element_wrapper.check_current_web_element(
{
"tag_name": web_element_wrapper.current_web_element.tag_name,
"text": web_element_wrapper.current_web_element.text,
"location_once_scrolled_into_view": web_element_wrapper.current_web_element.location_once_scrolled_into_view,
"size": web_element_wrapper.current_web_element.size,
"location": web_element_wrapper.current_web_element.location,
"parent": web_element_wrapper.current_web_element.parent,
"id": web_element_wrapper.current_web_element.id,
}
)
webdriver_wrapper_instance.quit()