github.com/MontFerret/ferret@v0.18.0/e2e/tests/dynamic/element/inner_html/set_by_xpath.fql (about)

     1  LET url = @lab.cdn.dynamic + "/#/lists"
     2  LET doc = DOCUMENT(url, true)
     3  
     4  LET expected = [
     5      {"details":'<h5 class="track-artist">MEDUZA</h5><small class="track-name">Piece Of Your Heart (feat. Goodboys)</small>'},
     6      {"details":'<h5 class="track-artist">Metanoia Music</h5><small class="track-name">Che Crozz x Orbis - Lift Me Up</small>'}
     7  ]
     8  
     9  LET html = (
    10      FOR t IN expected
    11          RETURN '<li><div class="track-details">' + t.details + '</div></li>'
    12  )
    13  
    14  INNER_HTML_SET(doc, X(".//*[contains(@class, 'track-list')]"), CONCAT_SEPARATOR('\n', html))
    15  
    16  LET list = ELEMENT(doc, '.track-list')
    17  
    18  LET actual = (
    19      FOR item IN ELEMENTS(doc, '.track-list li')
    20          RETURN {
    21              details: INNER_HTML(item, '.track-details'),
    22          }
    23  )
    24  
    25  RETURN T::EQ(actual, expected)