private void ImportProject(StreamWriter streamWriter, SpiraSoapService.SoapServiceClient spiraClient, TestLink testLinkApi) { try { streamWriter.WriteLine(String.Format("Importing Test Link project '{0}' to Spira...", this.testLinkProjectName)); //Get the project info from the TestLink API TestProject tlProject = testLinkApi.GetProject(this.testLinkProjectName); if (tlProject == null) { throw new ApplicationException(String.Format("Empty project data returned by TestLink for project '{0}' so aborting import", this.testLinkProjectId)); } RemoteProject remoteProject = new RemoteProject(); remoteProject.Name = tlProject.name; remoteProject.Website = tlProject.notes; remoteProject.Active = tlProject.active; //Reconnect and import the project spiraClient.Connection_Authenticate2(Properties.Settings.Default.SpiraUserName, Properties.Settings.Default.SpiraPassword, "TestLinkImporter"); remoteProject = spiraClient.Project_Create(remoteProject, null); streamWriter.WriteLine("New Project '" + remoteProject.Name + "' Created"); int projectId = remoteProject.ProjectId.Value; this.newProjectId = remoteProject.ProjectId.Value; } catch (Exception exception) { streamWriter.WriteLine("General error importing data from TestLink to Spira The error message is: " + exception.Message); throw; } }
public void GetCustomField() { var project = testlink.GetProject("CMGE"); var firtRootTestSuite = testlink.GetFirstLevelTestSuitesForTestProject(project.id).First(); var testSuites = testlink.GetTestSuitesForTestSuite(firtRootTestSuite.id); testSuites.ForEach(ts => { Console.WriteLine($"Test Suite: {ts.id}, {ts.name}"); var testCases = testlink.GetTestCasesForTestSuite(ts.id, false); testCases.ForEach(tc => { var testCase = testlink.GetTestCase(tc.id); var product = testlink.GetCustomFileds(testCase.testcase_id, testCase.externalid, testCase.version, project.id, "Product"); var ef = testlink.GetCustomFileds(testCase.testcase_id, testCase.externalid, testCase.version, project.id, "ExecutionFramework"); Console.WriteLine($"Test Case: {tc.id}, {tc.name}, Product: {product}, ExecutionFramework: {ef}"); }); }); }
public void SetUp() { var result = proxy.CreateProject(ProjectName, Prefix, "project notes"); Assert.IsTrue(result.status); var project = proxy.GetProject(ProjectName); ProjectId = project.id; Assert.AreEqual(result.id, ProjectId); Assert.Greater(ProjectId, 0); Assert.AreEqual(result.id, ProjectId); }