Skip to content

Commit 65cd2ce

Browse files
committed
Adding two more tests
1 parent f42351b commit 65cd2ce

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/SeleniumTests/__init__.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,31 @@ def test_title(self):
88
self.driver.get('https://the-internet.herokuapp.com')
99
self.assertTrue(self.driver.title == 'The Internet')
1010

11-
def test_example_1(self):
11+
# https://github.com/tourdedave/elemental-selenium-tips/blob/master/03-work-with-frames/python/frames.py
12+
def test_with_frames(self):
1213
driver = self.driver
1314
driver.get('http://the-internet.herokuapp.com/nested_frames')
1415
driver.switch_to.frame('frame-top')
1516
driver.switch_to.frame('frame-middle')
1617
self.assertTrue(driver.find_element_by_id('content').text == "MIDDLE", "content should be MIDDLE")
1718

19+
# https://github.com/tourdedave/elemental-selenium-tips/blob/master/04-work-with-multiple-windows/python/windows.py
20+
def test_with_windows(self):
21+
driver = self.driver
22+
driver.get('http://the-internet.herokuapp.com/windows')
23+
driver.find_element_by_css_selector('.example a').click()
24+
driver.switch_to_window(driver.window_handles[0])
25+
self.assertTrue(driver.title != "New Window", "title should not be New Window")
26+
driver.switch_to_window(driver.window_handles[-1])
27+
self.assertTrue(driver.title == "New Window", "title should be New Window")
28+
29+
# https://github.com/tourdedave/elemental-selenium-tips/blob/master/13-work-with-basic-auth/python/basic_auth_1.py
30+
def test_visit_basic_auth_secured_page(self):
31+
driver = self.driver
32+
driver.get('http://admin:[email protected]/basic_auth')
33+
page_message = driver.find_element_by_css_selector('.example p').text
34+
self.assertTrue(page_message == 'Congratulations! You must have the proper credentials.')
35+
1836
def tearDown(self):
1937
self.driver.quit()
2038

0 commit comments

Comments
 (0)