public void SetUp() { TestSettings.PrepareModuleTests(); TestFactory.GetTestRunWithStatus(TestRunStatuses.Running); _workflow = WorkflowCollection.Workflows.First(); _testRun = TestRunQueue.TestRuns.First(); }
// 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); }
public TestResultsModuleTestFixture() { TestSettings.PrepareModuleTests(); _browser = TestFactory.GetBrowserForTestResultsModule(); TestFactory.GetTestRunWithStatus(TestRunStatuses.Running); _workflow = WorkflowCollection.Workflows.First(); _testRun = TestRunQueue.TestRuns.First(); }
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); }
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); }
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); }
public void SetWorkflow(ITestWorkflow testWorkflow) { _workflow = testWorkflow; }
public static void AddWorkflow(ITestWorkflow workflow) { Workflows.Add(workflow); }
// 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; }
// 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; }