-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestSingInInvalid.py
More file actions
32 lines (22 loc) · 1.01 KB
/
TestSingInInvalid.py
File metadata and controls
32 lines (22 loc) · 1.01 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
import unittest
from selenium import webdriver
from test_support import pages
class SignInInvalid(unittest.TestCase):
""" A sample test class to check that user can't sign in with invalid credentials """
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("https://news360.com/")
self.driver.implicitly_wait(10)
def test_normal_signin(self):
""" Test SignInInvalid checks sign in with invalid credentials """
main_page = pages.MainPage(self.driver)
main_page.click_signin_link()
main_page.set_email('asd@asd.il')
main_page.set_password('111111')
main_page.click_signin_button()
text = main_page.return_message_value(*pages.MainPageLocators.INVALID_CREDENTIALS_MESSAGE)
self.assertEquals(text, 'Invalid login or password', 'The messages are different!') # Message parametrization will be required for localized site
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
unittest.main()