grr/server/grr_response_server/gui/selenium_tests/flow_management_test.py
def testFlowManagement(self):
    """Test that scheduling flows works."""
    self.Open("/")

    self.Type("client_query", self.client_id)
    self.Click("client_query_submit")

    self.WaitUntilEqual(self.client_id, self.GetText, "css=span[type=subject]")

    # Choose client 1
    self.Click("css=td:contains('%s')" % self.client_id)

    # First screen should be the Host Information already.
    self.WaitUntil(self.IsTextPresent, "Host000011112222")

    self.Click("css=a[grrtarget='client.launchFlows']")
    self.Click("css=#_Processes a")
    self.Click("link=" + flows_processes.ListProcesses.__name__)

    self.WaitUntil(self.IsTextPresent, "List running processes on a system.")

    self.Click("css=button.Launch")
    self.WaitUntil(self.IsTextPresent, "Launched Flow ListProcesses")

    self.Click("css=#_Browser a")

    # Wait until the tree has expanded.
    self.WaitUntil(self.IsTextPresent, flows_webhistory.FirefoxHistory.__name__)

    # Check that we can get a file in chinese
    self.Click("css=#_Filesystem a")

    # Wait until the tree has expanded.
    self.WaitUntil(self.IsTextPresent,
                   flows_filesystem.UpdateSparseImageChunks.__name__)

    self.Click("link=" + flows_transfer.GetFile.__name__)

    self.Select("css=.form-group:has(> label:contains('Pathtype')) select",
                "OS")
    self.Type("css=.form-group:has(> label:contains('Path')) input",
              u"/dev/c/msn[1].exe")

    self.Click("css=button.Launch")

    self.WaitUntil(self.IsTextPresent, "Launched Flow GetFile")

    # Test that recursive tests are shown in a tree table.
    api_regression_test_lib.StartFlow(
        self.client_id, gui_test_lib.RecursiveTestFlow, token=self.token)

    self.Click("css=a[grrtarget='client.flows']")

    # Some rows are present in the DOM but hidden because parent flow row
    # wasn't expanded yet. Due to this, we have to explicitly filter rows
    # with "visible" jQuery filter.
    self.WaitUntilEqual(
        gui_test_lib.RecursiveTestFlow.__name__, self.GetText,
        "css=grr-client-flows-list tr:visible:nth(1) td:nth(2)")

    self.WaitUntilEqual(
        flows_transfer.GetFile.__name__, self.GetText,
        "css=grr-client-flows-list tr:visible:nth(2) td:nth(2)")

    # Click on the first tree_closed to open it.
    self.Click("css=grr-client-flows-list tr:visible:nth(1) .tree_closed")

    self.WaitUntilEqual(
        gui_test_lib.RecursiveTestFlow.__name__, self.GetText,
        "css=grr-client-flows-list tr:visible:nth(2) td:nth(2)")

    # Select the requests tab
    self.Click("css=td:contains(GetFile)")
    self.Click("css=li[heading=Requests]")

    self.WaitUntil(self.IsElementPresent, "css=td:contains(1)")

    # Check that a StatFile client action was issued as part of the GetFile
    # flow. "Stat" matches the next state that is called.
    self.WaitUntil(self.IsElementPresent,
                   "css=.tab-content td.proto_value:contains(Stat)")
Test that scheduling flows works.
Test that scheduling flows works.
Test that scheduling flows works .
def testFlowManagement(self):
    self.Open("/")
    self.Type("client_query", self.client_id)
    self.Click("client_query_submit")
    self.WaitUntilEqual(self.client_id, self.GetText, "css=span[type=subject]")
    self.Click("css=td:contains('%s')" % self.client_id)
    self.WaitUntil(self.IsTextPresent, "Host000011112222")
    self.Click("css=a[grrtarget='client.launchFlows']")
    self.Click("css=#_Processes a")
    self.Click("link=" + flows_processes.ListProcesses.__name__)
    self.WaitUntil(self.IsTextPresent, "List running processes on a system.")
    self.Click("css=button.Launch")
    self.WaitUntil(self.IsTextPresent, "Launched Flow ListProcesses")
    self.Click("css=#_Browser a")
    self.WaitUntil(self.IsTextPresent, flows_webhistory.FirefoxHistory.__name__)
    self.Click("css=#_Filesystem a")
    self.WaitUntil(self.IsTextPresent,
                   flows_filesystem.UpdateSparseImageChunks.__name__)
    self.Click("link=" + flows_transfer.GetFile.__name__)
    self.Select("css=.form-group:has(> label:contains('Pathtype')) select",
                "OS")
    self.Type("css=.form-group:has(> label:contains('Path')) input",
              u"/dev/c/msn[1].exe")
    self.Click("css=button.Launch")
    self.WaitUntil(self.IsTextPresent, "Launched Flow GetFile")
    api_regression_test_lib.StartFlow(
        self.client_id, gui_test_lib.RecursiveTestFlow, token=self.token)
    self.Click("css=a[grrtarget='client.flows']")
    self.WaitUntilEqual(
        gui_test_lib.RecursiveTestFlow.__name__, self.GetText,
        "css=grr-client-flows-list tr:visible:nth(1) td:nth(2)")
    self.WaitUntilEqual(
        flows_transfer.GetFile.__name__, self.GetText,
        "css=grr-client-flows-list tr:visible:nth(2) td:nth(2)")
    self.Click("css=grr-client-flows-list tr:visible:nth(1) .tree_closed")
    self.WaitUntilEqual(
        gui_test_lib.RecursiveTestFlow.__name__, self.GetText,
        "css=grr-client-flows-list tr:visible:nth(2) td:nth(2)")
    self.Click("css=td:contains(GetFile)")
    self.Click("css=li[heading=Requests]")
    self.WaitUntil(self.IsElementPresent, "css=td:contains(1)")
    self.WaitUntil(self.IsElementPresent,
                   "css=.tab-content td.proto_value:contains(Stat)")
def testFlowManagement ( self ) : self . Open ( "/" ) self . Type ( "client_query" , self . client_id ) self . Click ( "client_query_submit" ) self . WaitUntilEqual ( self . client_id , self . GetText , "css=span[type=subject]" ) self . Click ( "css=td:contains('%s')" % self . client_id ) self . WaitUntil ( self . IsTextPresent , "Host000011112222" ) self . Click ( "css=a[grrtarget='client.launchFlows']" ) self . Click ( "css=#_Processes a" ) self . Click ( "link=" + flows_processes . ListProcesses . __name__ ) self . WaitUntil ( self . IsTextPresent , "List running processes on a system." ) self . Click ( "css=button.Launch" ) self . WaitUntil ( self . IsTextPresent , "Launched Flow ListProcesses" ) self . Click ( "css=#_Browser a" ) self . WaitUntil ( self . IsTextPresent , flows_webhistory . FirefoxHistory . __name__ ) self . Click ( "css=#_Filesystem a" ) self . WaitUntil ( self . IsTextPresent , flows_filesystem . UpdateSparseImageChunks . __name__ ) self . Click ( "link=" + flows_transfer . GetFile . __name__ ) self . Select ( "css=.form-group:has(> label:contains('Pathtype')) select" , "OS" ) self . Type ( "css=.form-group:has(> label:contains('Path')) input" , u"/dev/c/msn[1].exe" ) self . Click ( "css=button.Launch" ) self . WaitUntil ( self . IsTextPresent , "Launched Flow GetFile" ) api_regression_test_lib . StartFlow ( self . client_id , gui_test_lib . RecursiveTestFlow , token = self . token ) self . Click ( "css=a[grrtarget='client.flows']" ) self . WaitUntilEqual ( gui_test_lib . RecursiveTestFlow . __name__ , self . GetText , "css=grr-client-flows-list tr:visible:nth(1) td:nth(2)" ) self . WaitUntilEqual ( flows_transfer . GetFile . __name__ , self . GetText , "css=grr-client-flows-list tr:visible:nth(2) td:nth(2)" ) self . Click ( "css=grr-client-flows-list tr:visible:nth(1) .tree_closed" ) self . WaitUntilEqual ( gui_test_lib . RecursiveTestFlow . __name__ , self . GetText , "css=grr-client-flows-list tr:visible:nth(2) td:nth(2)" ) self . Click ( "css=td:contains(GetFile)" ) self . Click ( "css=li[heading=Requests]" ) self . WaitUntil ( self . IsElementPresent , "css=td:contains(1)" ) self . WaitUntil ( self . IsElementPresent , "css=.tab-content td.proto_value:contains(Stat)" )
Test that scheduling flows works.
Test that scheduling flows works .
"""Test that scheduling flows works.""" # Choose client 1 # First screen should be the Host Information already. # Wait until the tree has expanded. # Check that we can get a file in chinese # Wait until the tree has expanded. # Test that recursive tests are shown in a tree table. # Some rows are present in the DOM but hidden because parent flow row # wasn't expanded yet. Due to this, we have to explicitly filter rows # with "visible" jQuery filter. # Click on the first tree_closed to open it. # Select the requests tab # Check that a StatFile client action was issued as part of the GetFile # flow. "Stat" matches the next state that is called.
self