'Test the notifications interface.'

def testNotifications(self):

    self.Open('/')
    self.WaitUntil(self.IsElementPresent, 'client_query')
    self.WaitUntilEqual('7', self.GetText, 'css=button[id=notification_button]')
    self.Click('css=button[id=notification_button]')
    self.Click("css=button:contains('Close')")
    self.WaitUntilEqual('0', self.GetText, 'css=button[id=notification_button]')
    self.Open('/')
    self.WaitUntil(self.IsElementPresent, 'client_query')
    self.WaitUntilEqual('0', self.GetText, 'css=button[id=notification_button]')
    self.Click('css=button[id=notification_button]')
    self.Click("css=td:contains('File    fetch    completed')")
    self.WaitUntil(self.IsElementPresent, 'css=li[id=_fs-os-proc-10]')
    self.WaitUntil(self.IsElementPresent, "css=li.active    a[grrtarget='client.vfs']")
    self.WaitUntil(self.IsElementPresent, 'css=li[id=_fs-os-proc-10]')
    self.WaitUntil(self.IsTextPresent, ('%s/fs/os/proc/10/exe' % self.client_id))
    self.Click('css=button[id=notification_button]')
    self.WaitUntilContains('terminated    due    to    error', self.GetText, "css=td:contains('error')")
    self.Click("css=td:contains('terminated    due    to    error')")
    self.WaitUntil(self.IsTextPresent, 'Flow    Information')
    self.WaitUntil(self.IsElementPresent, "css=li.active    a[grrtarget='client.flows']")
    self.WaitUntilContains(self.session_id, self.GetText, 'css=grr-flow-overview')
