-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFireFox_Driver.py
More file actions
37 lines (27 loc) · 1.36 KB
/
Copy pathFireFox_Driver.py
File metadata and controls
37 lines (27 loc) · 1.36 KB
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
import unittest
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class qxf2move(unittest.TestCase):
def setUp(self):
self.driver=webdriver.Firefox()
def testUserMove21Black(self):
driver=self.driver
driver.get("http://Team-bhp.com")
self.assertIn("Home | Team-BHP - The Definitive Indian Car Website",driver.title)
#Click on Black's 21st move
#driver.find_element_by_id("fb-root").click()
driver.find_element_by_xpath("//span[contains(text(),'News')]").click()
#zgkjsjkbkjdbfkvbxdkjbfvkjxkjfvbxkj
#Verify the squares b6 and f2 ([2,1], [6,5]) have the right pieces
#chess_square = driver.find_element_by_id("img_tcol5trow6")
#Verify that the square f2 has a black queen (bq.png)
#self.assertEqual("http://www.chessgames.com/pgn4web-2.82/images/bq.png",chess_square.get_attribute('src'))
title = self.assertEqual("News | Team-BHP",driver.title)
## #Verify that the square b6 is empty (clear.png)
## self.assertEqual("http://www.chessgames.com/pgn4web-2.82/images/clear.png",chess_square.get_attribute('src'))
def tearDown(self):
time.sleep(7)
self.driver.quit()
if __name__=="__main__":
unittest.main()