-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestResetPassEmpty.py
More file actions
32 lines (23 loc) · 1.38 KB
/
TestResetPassEmpty.py
File metadata and controls
32 lines (23 loc) · 1.38 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.pages import MainPageLocators, MainPage
class ResetPassEmpty(unittest.TestCase):
""" A sample test class to show that non-empty passwords are required during password resetting """
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(10)
self.driver.get("https://news360.com/#~ffb82714-3715-4f9e-8c45-db6aadc439e9") # This link is to be replaced when corresponding link obtaining mechanism is to be created.
def test_empty_reset_password(self):
""" Test ResetPassEmpty checks that user can't use empty password during resetting """
main_page = MainPage(self.driver)
main_page.set_credential('', *MainPageLocators.NEW_PASSWORD)
main_page.set_credential('', *MainPageLocators.CONFIRM_PASSWORD)
main_page.click_confirm_button()
text = main_page.return_message_value(*MainPageLocators.EMAIL_PARSING_ERROR)
self.assertEquals(text, 'This value is required.', 'The messages are different!')
text = main_page.return_message_value(*MainPageLocators.PASSWORD_CONFIRM_ERROR)
self.assertEquals(text, 'This value is required.', 'The messages are different!') # Message parametrization will be required for localized site
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
unittest.main()