private int createTestWorkspace() { int workspaceID; using (var client = TestEnvironment.Instance.ServicesManager.CreateProxy <IRSAPIClient>(Relativity.API.ExecutionIdentity.System)) { workspaceID = CreateWorkspace.Create(client, ConfigurationHelper.TEST_WORKSPACE_NAME, ConfigurationHelper.TEST_WORKSPACE_TEMPLATE_NAME); } driver.Navigate().Refresh(); return(workspaceID); }
public void Execute_TestFixtureSetup() { //Setup for testing //Create a new instance of the Test Helper var helper = Relativity.Test.Helpers.TestHelper.System(); _servicesManager = helper.GetServicesManager(); //create client _client = helper.GetServicesManager().GetProxy<IRSAPIClient>(ConfigurationHelper.ADMIN_USERNAME, ConfigurationHelper.DEFAULT_PASSWORD); _objectManagerClient = helper.GetServicesManager().GetProxy<IObjectManager>(ConfigurationHelper.ADMIN_USERNAME, ConfigurationHelper.DEFAULT_PASSWORD); //Get workspace ID of the workspace for Nserio or Create a workspace _workspaceId = GetWorkspaceId(_workspaceName, _objectManagerClient); if (_workspaceId == 0) //-- if no workspace found, create it { _workspaceId = CreateWorkspace.Create(_client, _workspaceName, _workspaceTemplateName); _workspaceCreatedByTest = true; } _client.APIOptions.WorkspaceID = _workspaceId; var path = GetLocalDocumentsFolderPath(); //Import Application to the workspace //File path of the Test App string[] path1 = { path, "RA_Delimiter-Count-By-Saved-Search-Test-APP.rap" }; string filepathTestApp = Path.Combine(path1); //File path of the application containing the actual script string[] path2 = { path, "RA_Delimiter-Count-By-Saved-Search.rap" }; string filepathApp = Path.Combine(path2); //Importing the applications Relativity.Test.Helpers.Application.ApplicationHelpers.ImportApplication(_client, _workspaceId, true, filepathTestApp); Relativity.Test.Helpers.Application.ApplicationHelpers.ImportApplication(_client, _workspaceId, true, filepathApp); //set artifacttypeid _artifactTypeID = (int)ArtifactType.Document; //Import Documents to workspace ImportHelper.Import.ImportDocument(_workspaceId, path); }