-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathssertions.py
More file actions
32 lines (24 loc) · 867 Bytes
/
ssertions.py
File metadata and controls
32 lines (24 loc) · 867 Bytes
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
import unittest
from selenium import webdriver
from time import gmtime,strftime
class Login (unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.a = webdriver.Firefox()
cls.a.implicitly_wait(30)
cls.a.get("http://demo.magentocommerce.com/")
cls.a.maximize_window()
def test_register(self):
self.a.find_element_by_link_text("ACCOUNT").click()
self.a.find_element_by_link_text("Log In").click()
x = self.a.find_element_by_link_text("CREATE AN ACCOUNT")
self.assertTrue(x.is_displayed() and x.is_enabled())
x.click()
self.assertIsNot("Create New Custmer Account",self.a.title,['Hai'])
su = self.a.find_element_by_id("is_subscribed")
self.assertFalse(su.is_selected())
@classmethod
def tearDownClass(cls):
cls.a.quit()
if __name__ == '__main__':
unittest.main(verbosity=2)