-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_validation.py
68 lines (45 loc) · 2.07 KB
/
test_validation.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from pages.dynamicControl import DynamcControls
from pages.formAuth import FormAuthentication
from pages.addRemove import AddRemoveElement
from pages.contextMenu import ContextMenu
def test_form_authentication(driver):
form = FormAuthentication(driver)
form.navigate_to_form_page()
form.enter_login_username("tomsmith")
form.enter_login_password("SuperSecretPassword!")
form.click_login_button()
assert "logged in" in form.check_login_logout_status().text
form.click_logout_button()
assert "logged out" in form.check_login_logout_status().text
def test_add_remove_element(driver):
add_rem = AddRemoveElement(driver)
add_rem.navigate_to_add_remove_page()
add_rem.click_add_element_button()
delete_button = add_rem.check_delete_button().text
assert delete_button == "Delete"
add_rem.click_delete_button()
delete_button = add_rem.check_delete_button()
assert delete_button == "No Delete Button"
def test_context_menu(driver):
context = ContextMenu(driver)
context.navigate_to_context_menu_page()
context.right_click_context_menu()
assert context.check_alert_message() != ""
context.accept_alert()
assert context.alert_is_accepted() != ""
def test_dynamic_control_checkbox(driver):
checkbox = DynamcControls(driver)
checkbox.navigate_to_dynamic_controls_page()
assert checkbox.check_checkbox_element() == "Checkbox Element Presents"
checkbox.click_control_button("checkbox")
assert checkbox.check_checkbox_element() == "No Checkbox Element"
checkbox.click_control_button("checkbox")
assert checkbox.check_checkbox_element() == "Checkbox Element Presents"
def test_dynamic_control_input_text(driver):
input_text = DynamcControls(driver)
input_text.navigate_to_dynamic_controls_page()
assert input_text.checking_input_text_element() == False
input_text.click_control_button("input")
assert input_text.checking_input_text_element() == True
input_text.click_control_button("input")
assert input_text.checking_input_text_element() == False