-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestSignUpNormal.py
More file actions
33 lines (26 loc) · 1.32 KB
/
TestSignUpNormal.py
File metadata and controls
33 lines (26 loc) · 1.32 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
import unittest
from selenium import webdriver
from test_support.pages import MainPageLocators, MainPage, DashboardLocators
class SignUpNormal(unittest.TestCase):
""" Test that check that user can sign up with correct login and password """
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("https://news360.com/")
self.driver.implicitly_wait(10)
def test_signup_normal(self):
""" Test SignUpNormal checks sign up with valid credentials """
main_page = MainPage(self.driver)
main_page.click_signin_link()
main_page.click_signup_link()
email = main_page.get_random_email()
main_page.set_credential(email, *MainPageLocators.SIGNUP_EMAIL_FIELD)
main_page.set_credential('555555', *MainPageLocators.SIGNUP_PASSWORD_FIELD)
main_page.set_credential('555555', *MainPageLocators.SIGNUP_PASSWORD_CONFIRM)
main_page.click_signup_button()
main_page.wait_for_element(30, DashboardLocators.GREETING_TEXT)
text = main_page.return_message_value(*DashboardLocators.GREETING_TEXT)
self.assertEquals(text, "To begin, select a few topics you're interested in", 'The messages are different!') # Completely optional check
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
unittest.main()