Exemplo n.º 1
0
    def testFlowError(self):
        flow_args = rdf_file_finder.CollectFilesByKnownPathArgs(
            paths=["/file0", "/file1"])
        flow_id = flow_test_lib.StartFlow(file.CollectFilesByKnownPath,
                                          creator=self.test_username,
                                          client_id=self.client_id,
                                          flow_args=flow_args)

        flow_test_lib.MarkFlowAsFailed(self.client_id, flow_id)

        self.Open(f"/v2/clients/{self.client_id}")
        self.WaitUntil(self.IsElementPresent,
                       "css=flow-details mat-icon.error")
Exemplo n.º 2
0
    def testCorrectlyDisplaysError(self):
        flow_args = rdf_file_finder.CollectSingleFileArgs(path="/etc/hosts")
        flow_id = flow_test_lib.StartFlow(file.CollectSingleFile,
                                          creator=self.test_username,
                                          client_id=self.client_id,
                                          flow_args=flow_args)
        flow_test_lib.MarkFlowAsFailed(self.client_id, flow_id)

        with flow_test_lib.FlowProgressOverride(
                file.CollectSingleFile,
                rdf_file_finder.CollectSingleFileProgress(
                    status=rdf_file_finder.CollectSingleFileProgress.Status.
                    FAILED,
                    error_description="Something went wrong")):
            self.Open(f"/v2/clients/{self.client_id}")
            self.WaitUntil(
                self.IsElementPresent,
                "css=flow-details :contains('Something went wrong')")
Exemplo n.º 3
0
    def testCorrectlyDisplaysNotFoundResult(self):
        flow_args = rdf_file_finder.CollectSingleFileArgs(path="/etc/hosts")
        flow_id = flow_test_lib.StartFlow(file.CollectSingleFile,
                                          creator=self.test_username,
                                          client_id=self.client_id,
                                          flow_args=flow_args)
        flow_test_lib.MarkFlowAsFailed(self.client_id, flow_id)

        with flow_test_lib.FlowProgressOverride(
                file.CollectSingleFile,
                rdf_file_finder.CollectSingleFileProgress(
                    status=rdf_file_finder.CollectSingleFileProgress.Status.
                    NOT_FOUND)):
            self.Open(f"/v2/clients/{self.client_id}")
            self.WaitUntil(self.IsElementPresent,
                           "css=.flow-status mat-icon.error")
            self.WaitUntil(self.IsElementPresent,
                           "css=flow-details :contains('File not found')")