Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69888

Test framework Result File path for JUnit XML Result file does not retain path value

      The file path cannot be changed when we set the JUnit XML result file as the Test Framework.

      When we change it to a custom path and save the job configuration, it defaults back to target/surefire-reports/*.xml

      Can you please allow this to be customised when we save configuration.

          [JENKINS-69888] Test framework Result File path for JUnit XML Result file does not retain path value

          Iffi Anwar created issue -

          Shane added a comment -

          I encountered this issue and found a fix for it after finding the index.js file in the plugin directory and amending to be as follows -

           

          (function(){
              setTimeout(function(){
                  const formatSelect = document.querySelector('#tm4jAutomationPostBuildActionFormatSelect');
                  const filePath = document.querySelector('#tm4jAutomationPostBuildActionFilePath');
                  let currentPath;
                  if (filePath) {
                      currentPath = (formatSelect.value === 'Cucumber' || formatSelect.value === 'JUnit XML Result File') ? filePath.value : null;
                  }
                  formatSelect.onchange=changeEventHandler;
                  checkFormat(formatSelect);
          
                  function changeEventHandler(event) {
                      checkFormat(event.target)
                  }
          
                  function checkFormat(target){
                      if  (target.value === 'Cucumber') {
                          filePath.value = currentPath ? currentPath : 'target/cucumber/*.json';
                          filePath.disabled = false;
                      } else if (target.value == 'JUnit XML Result File') {
                          filePath.value = currentPath ? currentPath : 'target/surefire-reports/*.xml';
                          filePath.disabled = false;
                      } else {
                          filePath.value = 'zephyrscale_result.json';
                          filePath.disabled = true;
                      }
                      filePath.onchange();
                  }
              },200)
          })(); 

          The issue appears to be that JUnit XML Result File was not being considered.

          Shane added a comment - I encountered this issue and found a fix for it after finding the index.js file in the plugin directory and amending to be as follows -   (function(){ setTimeout(function(){ const formatSelect = document.querySelector( '#tm4jAutomationPostBuildActionFormatSelect' ); const filePath = document.querySelector( '#tm4jAutomationPostBuildActionFilePath' ); let currentPath; if (filePath) { currentPath = (formatSelect.value === 'Cucumber' || formatSelect.value === 'JUnit XML Result File' ) ? filePath.value : null ; } formatSelect.onchange=changeEventHandler; checkFormat(formatSelect); function changeEventHandler(event) { checkFormat(event.target) } function checkFormat(target){ if (target.value === 'Cucumber' ) { filePath.value = currentPath ? currentPath : 'target/cucumber/*.json' ; filePath.disabled = false ; } else if (target.value == 'JUnit XML Result File' ) { filePath.value = currentPath ? currentPath : 'target/surefire-reports/*.xml' ; filePath.disabled = false ; } else { filePath.value = 'zephyrscale_result.json' ; filePath.disabled = true ; } filePath.onchange(); } },200) })(); The issue appears to be that JUnit XML Result File was not being considered.

            zeedeveloper Zephyr Developer
            ianwar89 Iffi Anwar
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: