{"id":23651862,"url":"https://github.com/microfocus/sdp-sdm-tests-to-run-conversion","last_synced_at":"2026-02-13T13:46:33.843Z","repository":{"id":260637342,"uuid":"880836331","full_name":"MicroFocus/sdp-sdm-tests-to-run-conversion","owner":"MicroFocus","description":"JavaScript-based tool that converts the `testsToRun` parameter for running automated tests from OpenText Software Delivery Platform.","archived":false,"fork":false,"pushed_at":"2025-02-14T10:39:13.000Z","size":325,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-08-25T13:01:45.694Z","etag":null,"topics":["csdp","octane","sdm","sdp"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicroFocus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-30T13:01:29.000Z","updated_at":"2025-07-23T07:22:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a1583bb-4ea2-46fc-8577-a6b4ceefcd39","html_url":"https://github.com/MicroFocus/sdp-sdm-tests-to-run-conversion","commit_stats":null,"previous_names":["microfocus/tests-to-run-conversion-tool","microfocus/sdp-sdm-tests-to-run-conversion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MicroFocus/sdp-sdm-tests-to-run-conversion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fsdp-sdm-tests-to-run-conversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fsdp-sdm-tests-to-run-conversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fsdp-sdm-tests-to-run-conversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fsdp-sdm-tests-to-run-conversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicroFocus","download_url":"https://codeload.github.com/MicroFocus/sdp-sdm-tests-to-run-conversion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fsdp-sdm-tests-to-run-conversion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274975431,"owners_count":25384279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csdp","octane","sdm","sdp"],"created_at":"2024-12-28T16:48:40.578Z","updated_at":"2026-02-13T13:46:33.835Z","avatar_url":"https://github.com/MicroFocus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 1. Introduction 🚀\n\nIn the following documentation, the **OpenText Core Software Delivery Platform** and **OpenText Software Delivery Management** will collectively be referred to as 'the product'.\n\nThis is a command-line tool desinged to convert a list of test details received from **the product** to a format accepted by common frameworks. The tool allows defining custom conversion flow for other frameworks that are not supported by default.\n\n---\n\n## 2. Table of Contents\n\n- [1. Introduction](#1-introduction-)\n- [2. Table of Contents](#2-table-of-contents)\n- [3. Description](#3-description)\n  - [3.1. Supported Frameworks](#31-supported-frameworks)\n- [4. Getting Started](#4-getting-started)\n  - [4.1. Running the tool](#41-running-the-tool)\n    - [4.1.1. Run using NPX](#411-run-using-npx)\n    - [4.1.2. Parameters](#412-parameters)\n    - [4.2. Running within GitHub Actions](#42-running-the-tool-with-github-actions)\n- [5. Custom Framework](#5-custom-framework)\n  - [5.1. Structure of the customFramework JSON](#51-structure-of-the-customFramework-json)\n  - [5.2. Simple Example](#52-simple-example)\n  - [5.3. Optional Keys](#53-optional-keys)\n  - [5.4. Complex Example](#54-complex-example)\n    - [5.4.1. Selenium with C# Example](#541-selenium-with-c-example)\n- [6. Change log](#6-change-log)\n\n---\n\n## 3. Description\n\n### 3.1. Supported Frameworks\n\nThe tool supports the following test frameworks out-of-the-box, as well as custom configurations for unsupported frameworks:\n\n- Cucumber\n- Cucumber with BDD Scenario\n- JUnit\n- Maven Surefire\n- TestNG (Selenium)\n- OpenText Functional Testing\n- Custom (define your custom framework configuration - [see more](#5-custom-framework))\n\n---\n\n## 4. Getting Started\n\n### 4.1. Running the tool\n\n#### 4.1.1. Run using NPX\n\nThe tool have been released as a NPX command: [@opentext/sdp-sdm-tests-to-run-conversion](https://www.npmjs.com/package/@opentext/sdp-sdm-tests-to-run-conversion)\n\nRun the following command to convert the value of the `--testsToRun` parameter received from **the product** to a format specified by the `--framework` parameter.\n\n```bash\nnpx @opentext/sdp-sdm-tests-to-run-conversion --framework=\"\u003cframework_name\u003e\" --testsToRun=\"\u003ctest_definitions\u003e\" [--customFramework=\"\u003cjson_format_rules\u003e\"]\n```\n\n#### 4.1.2. Parameters\n\n1. `--testsToRun` - a list of automated tests to run, usualy received from **the product**.\n2. `--framework` - the framework to which the `--testsToRun` parameter will be converted. Available options are:\n   - JUnit: `junit`\n   - Maven Surefire: `mvnSurefire`\n   - TestNG (Selenium): `testNG`\n   - Cucumber: `cucumber`\n   - Cucumber - BDD scenario: `bddScenario`\n   - OpenText Functional Testing: `uft`\n   - Custom framework: `custom`\n3. `--customFramework` _(optional)_ - a JSON object serialized to string which contains the format rules used for conversion. To configure a custom framework see the section [5. Custom Framework](#5-custom-framework).\n4. `--logLevel` _(optional)_ - the level to log at. The available options are:\n   - `0` - Disabled\n   - `1` - Debug\n   - `2` - Trace\n   - `3` - Info\n   - `4` - Warn\n   - `5` - Error\n\n\u003e [!CAUTION]\n\u003e The `logLevel` parameter should only be used while debugging. Remove or set it to `0` if you're not debugging this tool.\n\n### 4.2. Running the tool with GitHub Actions\n\nThis example workflow demonstrates how to integrate a test conversion tool (`@opentext/sdp-sdm-tests-to-run-conversion`) into a GitHub Actions pipeline to determine and execute specific tests dynamically. In the following example, the workflow will run some automated tests using the **Maven Surefire** framework.\n\n#### Workflow Overview\n\n1. **Convert `testsToRun` Parameter**:\n\n   - Use the tool as an NPX command to process the `testsToRun` input.\n   - The tool outputs a list of test identifiers.\n   - The output is stored in an environment variable for later use.\n\n2. **Set Up Java**:\n\n   - Use the `setup-java` action to prepare the environment with JDK 21.\n\n3. **Run Tests**:\n   - Use Maven to run the tests specified by the conversion tool output.\n\n#### Workflow Configuration\n\n```yaml\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      # Checkout code\n      - name: Checkout code\n        uses: actions/checkout@v4\n\n      # Step 1: Convert testsToRun parameter\n      - name: Convert testsToRun parameter\n        id: convert_tests\n        run: |\n          # Run the npx command and capture its output\n          output=$(npx @opentext/sdp-sdm-tests-to-run-conversion --framework=\"junit\" --testsToRun=\"${{ github.event.inputs.testsToRun }}\" --logLevel=0)\n\n          # Save the output to an environment variable\n          echo \"converted_tests=$output\" \u003e\u003e $GITHUB_ENV\n          echo \"::set-output name=converted_tests::$output\"\n\n      # Step 2: Set up Java environment\n      - name: Set up JDK 21\n        uses: actions/setup-java@v4\n        with:\n          distribution: \"temurin\"\n          java-version: \"21\"\n\n      # Step 3: Run the tests from the converted list\n      - name: Run JUnit Tests\n        run: mvn test -Dtest=\"$converted_tests\"\n```\n\n---\n\n## 5. Custom Framework\n\nIf your framework isn't supported by default, you can define a custom configuration. Use the `--customFramework` parameter in the command call to provide the configuration, specifying a pattern to convert the `testsToRun` value into the required format for your framework.\n\n### 5.1. Structure of the `customFramework` JSON\n\nTo configure a custom framework, you'll need to provide a JSON object with specific keys. At a minimum, the following two keys are required:\n\n- `testPattern`: Defines the structure of the tests based on Package, Class name, and Test name.\n- `testDelimiter`: A character or string that separates tests in the testsToRun parameter.\n\nIn the custom configuration, you can define a pattern using the following placeholders:\n\n- `$package`: Represents the package name of the test.\n- `$class`: Represents the class name of the test.\n- `$testName`: Represents the name of the individual test.\n\n### 5.2. Simple Example\n\nFor example, if you want to generate a JUnit report structured like this:\n\n```bash\n\"com.example:Calculator#addTwoNumbers, com.example:Calculator#subtractTwoNumbers\"\n```\n\nYou would define your custom framework JSON like this:\n\n```json\n{\n  \"testPattern\": \"$package:$class#$testName\",\n  \"testDelimiter\": \", \"\n}\n```\n\n### 5.3. Optional Keys\n\nYou can also include the following optional keys:\n\n- `prefix` and `suffix`: Strings that will be added at the beginning and end of the test names.\n\n- `replacements`: An array of replacement objects that modify string values for **package**, **class name**, and **test name**.\n\n#### Replacement Types\n\nThe replacement objects can be of various types:\n\n1. `replaceString`: Replaces every occurrence of a specified string.\n\n```json\n{\n  \"type\": \"replaceString\",\n  \"target\": \"$class\",\n  \"string\": \"\u003cstringToReplace\u003e\",\n  \"replacement\": \"\u003creplacementString\u003e\"\n}\n```\n\n2. `replaceRegex`: Replaces every occurrence of a regex pattern.\n\n```json\n{\n  \"type\": \"replaceRegex\",\n  \"target\": \"$class\",\n  \"regex\": \"\u003cregexToReplace\u003e\",\n  \"replacement\": \"\u003creplacementString\u003e\"\n}\n```\n\n3. `replaceRegexFirst`: Replaces only the first occurrence of a regex pattern.\n\n```json\n{\n  \"type\": \"replaceRegexFirst\",\n  \"target\": \"$class\",\n  \"regex\": \"\u003cregexToReplace\u003e\",\n  \"replacement\": \"\u003creplacementString\u003e\"\n}\n```\n\n4. `notLatinAndDigitToOctal`: Converts non-latin or digit characters to octal representation.\n\n```json\n{\n  \"type\": \"notLatinAndDigitToOctal\",\n  \"target\": \"$class\"\n}\n```\n\n5. `joinString`: Adds a prefix and/or suffix to the target.\n\n```json\n{\n  \"type\": \"joinString\",\n  \"target\": \"$class\",\n  \"suffix\": \"\u003csuffixToAdd\u003e\",\n  \"prefix\": \"\u003cprefixToAdd\u003e\"\n}\n```\n\n6. `toUpperCase` and `toLowerCase`: Converts the target to upper or lower case, respectively.\n\n```json\n{\n  \"type\": \"toUpperCase\",\n  \"target\": \"$class\"\n}\n```\n\n7. `allowDuplication`: A boolean value (default is true) that allows or disallows duplicate values in the testsToRun parameter.\n\n```json\n{\n  \"allowDuplication\": true\n}\n```\n\n### 5.4. Complex Example\n\nUsing the same JUnit report structure, if you need to adjust the format of the class name and include additional transformations:\n\n```json\n{\n  \"testPattern\": \"$package:$class#$testName\",\n  \"testDelimiter\": \", \",\n  \"replacements\": [\n    {\n      \"type\": \"replaceString\",\n      \"target\": \"$class\",\n      \"string\": \".\",\n      \"replacement\": \"\\\\\"\n    },\n    {\n      \"type\": \"replaceRegex\",\n      \"target\": \"$class\",\n      \"regex\": \"(\\\\b\\\\\\\\\\\\b)(?!.*\\\\1)\",\n      \"replacement\": \".mytest:\"\n    }\n  ]\n}\n```\n\n\u003e [!NOTE]\n\u003e When specifying escape characters in the JSON, ensure that each escape character is doubled (e.g., \\\\\\\\ instead of \\\\).\n\n#### 5.4.1. Selenium with C# Example\n\nTo generate the format expected by Selenium tests written in a C# project, use the following custom configuration:\n\n```json\n{\n  \"testPattern\": \"FullyQualifiedName~$testName\",\n  \"testDelimiter\": \"|\",\n  \"allowDuplication\": false\n}\n```\n\n\u003e [!NOTE]\n\u003e This argument needs to be encoded to base64 in order to be used.\n\n## 6. Change log\n\n### v26.1.0\n\n- The `customFramework` argument should be encoded before running the tool in order to avoid issues with special characters.\n\n### v25.2.0\n\n- Added support for OpenText Functional Testing.\n\n### v25.1.0\n\n- Converts the `testsToRun` parameter to a format accepted by a specific framework.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofocus%2Fsdp-sdm-tests-to-run-conversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrofocus%2Fsdp-sdm-tests-to-run-conversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofocus%2Fsdp-sdm-tests-to-run-conversion/lists"}