'Tests that cancelling flows works.'

def testCancelFlowWorksCorrectly(self):

    flow.GRRFlow.StartFlow(client_id=self.client_id, flow_name=gui_test_lib.RecursiveTestFlow.__name__, token=self.token)
    self.Open('/')
    self.Type('client_query', 'C.0000000000000001')
    self.Click('client_query_submit')
    self.WaitUntilEqual(u'C.0000000000000001', self.GetText, 'css=span[type=subject]')
    self.Click("css=td:contains('0001')")
    self.Click("css=a[grrtarget='client.flows']")
    self.Click("css=td:contains('RecursiveTestFlow')")
    self.Click('css=button[name=cancel_flow]')
    self.WaitUntil(self.IsTextPresent, 'Cancelled    in    GUI')
