I’m trying to write UI tests with Jenkins test harness (based on HTMLUnit). 
When one of my jelly files under test uses a JS library that is part of another 
plugin (i.e. in a maven dependency) then the JS file seems to be not exposed 
and Jenkins reports a 404. The same jelly file works fine when deployed to a 
real Jenkins instance.  

Is this a known limitation of the test harness? Or is this a bug I can try to 
fix in the test harness (or is this the epic in 
https://issues.jenkins-ci.org/browse/JENKINS-41827 
<https://issues.jenkins-ci.org/browse/JENKINS-41827>)? 
Or do I need to bundle or reference the dependencies in a different way? 

My Jelly looks like:

<l:main-panel>

  <st:adjunct includes="io.jenkins.plugins.bootstrap4"/>
  <st:adjunct includes="io.jenkins.plugins.data-tables"/>
  <st:adjunct includes="io.jenkins.plugins.font-awesome"/>

  <div class="fluid-container">

    <h3>${it.displayName}</h3>

    <div class="row py-3">

      <div class="col">
        <div id="statistics">
          <bs:card title="${%Details}" fontAwesomeIcon="fa-chart-bar">
            <dt:table model="${it.getTableModel('forensics')}"/>
          </bs:card>
        </div>
      </div>

    </div>

  </div>

</l:main-panel>
The JS files are located in the webjars folder of the dependencies (not part of 
the WEB-INF/lib jar file anymore). They are resolved to something like
http://localhost:57434/plugin/jquery3-api/webjars/jquery.min.js  
and so on. 

In a real Jenkins instance the same URL will return the JS file, in the tests a 
404.

(Full code is available in 
https://github.com/jenkinsci/forensics-api-plugin/pull/59 
<https://github.com/jenkinsci/forensics-api-plugin/pull/59>)


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/2C8F6B1E-0A4B-4EDD-A19D-A9675616B605%40gmail.com.

Reply via email to