@@ -0,0 +1,2282 @@
+# -*- coding: utf-8 -*-%0Afrom helper import SeleniumTestCase%0Aimport page%0A%0A%0Aclass NotificationsTestCase(SeleniumTestCase):%0A%0A  @classmethod%0A  def setUpClass(cls):%0A    # connect to webdriver, create app, launch server in thread%0A    super(NotificationsTestCase, cls).setUpClass()%0A%0A%0A  @classmethod%0A  def tearDownClass(cls):%0A    # stop the server, destroy db and remove app context%0A    super(NotificationsTestCase, cls).tearDownClass()%0A%0A%0A  def setUp(self):%0A    if not self.client:%0A      self.skipTest('Web browser not available')%0A%0A  def tearDown(self):%0A    pass%0A%0A%0A  def test_reply_message(self):%0A    '''Verify user can reply%0A    1. Go to home page%0A    2. Log in with user1%0A    3. Verify user has notification badge%0A    4. Go to notification page%0A    5. Click on unread message%0A    6. Reply%0A    7. Verify you are redirected to notifications and have 1 sent msg%0A    8. Log out%0A    '''%0A    self.client.get('http://localhost:5000')%0A%0A    # home page object%0A    home_page = page.HomePage(self.client)%0A    self.assertTrue(home_page.is_title_matches)%0A%0A    # navigate to login page%0A    home_page.go_to_login()%0A%0A    login_page = page.LoginPage(self.client)%0A    self.assertTrue(login_page.is_title_matches)%0A%0A    # login user ES%0A    login_page.login(self.app.config%5B'FB_TEST_EMAIL1'%5D,%0A                      self.app.config%5B'FB_TEST_PWD1'%5D)%0A%0A    #verify you have the notification badge%0A    self.assertTrue(home_page.has_notifications)%0A    #go to notifications%0A    home_page.go_to_notifications()%0A%0A    # notifications page object%0A    notifications_page = page.NotificationsPage(self.client)%0A    #click on unread message%0A    notifications_page.go_to_unread_message('Hi there!')%0A%0A    #verify you are redirected to message page%0A    msg_page = page.MessagePage(self.client)%0A    self.assertTrue(msg_page.is_title_matches)%0A%0A    #reply message%0A    msg_page.reply_message('I think we have a deal!')%0A%0A    #verify you are in notifications page%0A    self.assertTrue(notifications_page.is_title_matches)%0A%0A    #verify you have 0 unread / 1 received / 1 sent messages%0A    self.assertTrue(notifications_page.get_num_unread() == '0')%0A    self.assertTrue(notifications_page.get_num_received() == '1')%0A    self.assertTrue(notifications_page.get_num_sent() == '1')%0A%0A    #log out user%0A    notifications_page.go_to_log_out()%0A

test notifications page and reply message #30