Пример #1
0
 public void SetUp()
 {
     TestSettings.PrepareModuleTests();
     TestFactory.GetTestRunWithStatus(TestRunStatuses.Running);
     _workflow = WorkflowCollection.Workflows.First();
     _testRun  = TestRunQueue.TestRuns.First();
 }
Пример #2
0
        // Guid AddWorkflow(string name, XContainer xDocument)
        Guid AddWorkflow(string name, XContainer xDocument, string pathToWorkflowFile)
        {
            var testLabName = xDocument.Descendants(LogicConstants.WorkflowLoader_TestWorkflow_TestLabNode).FirstOrDefault().Value;

            var testLab = string.IsNullOrEmpty(testLabName) ?
                          GetFirstTestLab() :
                          GetOrCreateTestLab(testLabName);

            // _workflow = new TestWorkflow(testLab) { Name = name };
            _workflow = new TestWorkflow(testLab)
            {
                Name = name, Path = pathToWorkflowFile
            };
            // 20150708
            // if there already is a workflow with the same name
            // merge the new one with the existing
            var replace = false || WorkflowCollection.Workflows.Any(wfl => wfl.Name == _workflow.Name && wfl.Path == _workflow.Path);

            if (replace)
            {
                WorkflowCollection.MergeWorkflow(_workflow);
            }
            else
            {
                WorkflowCollection.AddWorkflow(_workflow);
            }

            ServerObjectFactory.Resolve <TestWorkflowCollectionMethods>().SetDefaultWorkflow();
            return(_workflow.Id);
        }
Пример #3
0
 public void SetUp()
 {
     TestSettings.PrepareModuleTests();
     TestFactory.GetTestRunWithStatus(TestRunStatuses.Running);
     _workflow = WorkflowCollection.Workflows.First();
     _testRun = TestRunQueue.TestRuns.First();
 }
Пример #4
0
 public TestResultsModuleTestFixture()
 {
     TestSettings.PrepareModuleTests();
     _browser = TestFactory.GetBrowserForTestResultsModule();
     TestFactory.GetTestRunWithStatus(TestRunStatuses.Running);
     _workflow = WorkflowCollection.Workflows.First();
     _testRun  = TestRunQueue.TestRuns.First();
 }
Пример #5
0
 public void SetUp()
 {
     TestSettings.PrepareModuleTests();
     _browser = TestFactory.GetBrowserForTestTasksModule();
     TestFactory.GetTestRunWithStatus(TestRunStatuses.Running);
     _workflow = WorkflowCollection.Workflows.First();
     _testRun  = TestRunQueue.TestRuns.First();
     TestFactory.GetAnotherTestRunWithStatus(TestRunStatuses.Pending, _workflow);
 }
Пример #6
0
 public static void GetAnotherTestRunWithStatus(TestRunStatuses status, ITestWorkflow workflow)
 {
     var testRun = new TestRun {
         Name = "test run the second",
         Status = status
     };
     testRun.SetWorkflow(workflow);
     TestRunQueue.TestRuns.Add(testRun);
 }
Пример #7
0
        public static void GetAnotherTestRunWithStatus(TestRunStatuses status, ITestWorkflow workflow)
        {
            var testRun = new TestRun {
                Name   = "test run the second",
                Status = status
            };

            testRun.SetWorkflow(workflow);
            TestRunQueue.TestRuns.Add(testRun);
        }
Пример #8
0
 public static void MergeWorkflow(ITestWorkflow workflow)
 {
     // Workflows.Add(workflow);
     var existingWorkflow = Workflows.First(wfl => wfl.Name == workflow.Name && wfl.Path == workflow.Path);
     existingWorkflow.DefaultData = workflow.DefaultData;
     existingWorkflow.Description = workflow.Description;
     // existingWorkflow.Id = workflow.Id;
     // existingWorkflow.IsDefault = 
     existingWorkflow.ParametersPageName = workflow.ParametersPageName;
     // existingWorkflow.TestLabId
     
     TaskPool.Tasks.RemoveAll(task => task.WorkflowId == existingWorkflow.Id);
 }
Пример #9
0
        public static void MergeWorkflow(ITestWorkflow workflow)
        {
            // Workflows.Add(workflow);
            var existingWorkflow = Workflows.First(wfl => wfl.Name == workflow.Name && wfl.Path == workflow.Path);

            existingWorkflow.DefaultData = workflow.DefaultData;
            existingWorkflow.Description = workflow.Description;
            // existingWorkflow.Id = workflow.Id;
            // existingWorkflow.IsDefault =
            existingWorkflow.ParametersPageName = workflow.ParametersPageName;
            // existingWorkflow.TestLabId

            TaskPool.Tasks.RemoveAll(task => task.WorkflowId == existingWorkflow.Id);
        }
Пример #10
0
 public void SetWorkflow(ITestWorkflow testWorkflow)
 {
     _workflow = testWorkflow;
 }
Пример #11
0
 public static void AddWorkflow(ITestWorkflow workflow)
 {
     Workflows.Add(workflow);
 }
Пример #12
0
 public void SetWorkflow(ITestWorkflow testWorkflow)
 {
     _workflow = testWorkflow;
 }
Пример #13
0
        // Guid AddWorkflow(string name, XContainer xDocument)
        Guid AddWorkflow(string name, XContainer xDocument, string pathToWorkflowFile)
        {
            var testLabName = xDocument.Descendants(LogicConstants.WorkflowLoader_TestWorkflow_TestLabNode).FirstOrDefault().Value;

            var testLab = string.IsNullOrEmpty(testLabName) ? 
                GetFirstTestLab() :
                GetOrCreateTestLab(testLabName);

            // _workflow = new TestWorkflow(testLab) { Name = name };
            _workflow = new TestWorkflow(testLab) { Name = name, Path = pathToWorkflowFile};
            // 20150708
            // if there already is a workflow with the same name
            // merge the new one with the existing
            var replace = false || WorkflowCollection.Workflows.Any(wfl => wfl.Name == _workflow.Name && wfl.Path == _workflow.Path);
            
            if (replace)
                WorkflowCollection.MergeWorkflow(_workflow);
            else
                WorkflowCollection.AddWorkflow(_workflow);
            
            ServerObjectFactory.Resolve<TestWorkflowCollectionMethods>().SetDefaultWorkflow();
            return _workflow.Id;
        }
Пример #14
0
        // Guid AddWorkflow(string name, XContainer xDocument)
        Guid AddWorkflow(string name, XContainer xDocument, string pathToWorkflowFile)
        {
            var testLabName = xDocument.Descendants(LogicConstants.WorkflowLoader_TestWorkflow_TestLabNode).FirstOrDefault().Value;

            var testLab = string.IsNullOrEmpty(testLabName) ? 
                GetFirstTestLab() :
                GetOrCreateTestLab(testLabName);

            // _workflow = new TestWorkflow(testLab) { Name = name };
            _workflow = new TestWorkflow(testLab) { Name = name, Path = pathToWorkflowFile};
            WorkflowCollection.AddWorkflow(_workflow);
            ServerObjectFactory.Resolve<TestWorkflowCollectionMethods>().SetDefaultWorkflow();
            return _workflow.Id;
        }
Пример #15
0
 public static void AddWorkflow(ITestWorkflow workflow)
 {
     Workflows.Add(workflow);
 }