Ejemplo n.º 1
0
    def _RunUpdateFlow(self, client_id):
        # Get the flows that should have been started and finish them.
        fd = aff4.FACTORY.Open(client_id.Add("flows"), token=self.token)
        flows = list(fd.ListChildren())

        gui_test_lib.CreateFileVersion(client_id,
                                       "fs/os/c/a.txt",
                                       "Hello World",
                                       timestamp=gui_test_lib.TIME_0,
                                       token=self.token)
        gui_test_lib.CreateFolder(client_id,
                                  "fs/os/c/TestFolder",
                                  timestamp=gui_test_lib.TIME_0,
                                  token=self.token)
        gui_test_lib.CreateFolder(client_id,
                                  "fs/os/c/bin/TestBinFolder",
                                  timestamp=gui_test_lib.TIME_0,
                                  token=self.token)

        client_mock = action_mocks.ActionMock()
        for flow_urn in flows:
            flow_test_lib.TestFlowHelper(flow_urn,
                                         client_mock,
                                         client_id=client_id,
                                         token=self.token,
                                         check_flow_errors=False)
Ejemplo n.º 2
0
    def testClickingOnTreeNodeRefreshesChildrenFoldersList(self):
        self.Open("/#/clients/C.0000000000000001/vfs/fs/os/c/")
        self.WaitUntilNot(self.IsElementPresent, "link=foo")

        gui_test_lib.CreateFolder(rdf_client.ClientURN("C.0000000000000001"),
                                  "fs/os/c/foo",
                                  timestamp=gui_test_lib.TIME_0,
                                  token=self.token)

        self.Click("link=c")
        self.WaitUntil(self.IsElementPresent, "link=foo")
Ejemplo n.º 3
0
    def testClickingOnTreeNodeArrowRefreshesChildrenFoldersList(self):
        self.Open("/#/clients/C.0000000000000001/vfs/fs/os/c/")
        self.WaitUntil(self.IsElementPresent, "link=Downloads")
        self.WaitUntilNot(self.IsElementPresent, "link=foo")

        gui_test_lib.CreateFolder(rdf_client.ClientURN("C.0000000000000001"),
                                  "fs/os/c/foo",
                                  timestamp=gui_test_lib.TIME_0,
                                  token=self.token)

        # Click on the arrow icon, it should close the tree branch.
        self.Click("css=#_fs-os-c i.jstree-icon")
        self.WaitUntilNot(self.IsElementPresent, "link=Downloads")
        self.WaitUntilNot(self.IsElementPresent, "link=foo")

        # Click on the arrow icon again, it should reopen the tree
        # branch. It should be updated.
        self.Click("css=#_fs-os-c i.jstree-icon")
        self.WaitUntil(self.IsElementPresent, "link=Downloads")
        self.WaitUntil(self.IsElementPresent, "link=foo")