If you open up the dev-tools, go to console you will see the error message reproduced there.
The message contains a link to the spot that causes the error. If you click the link, the dev-tools will switch to the elements pane and show you the script that is failing:
window.onload = function() {
/* oneway */
document.getElementById("one-way").onclick = function() {
document.getElementById("show").className = "col hide";
document.getElementById("onereturn").className = "row g-2 contact-form-action";
document.getElementById("multiway").className = "";
document.getElementById("departure").className = "depart form-control";
}
/* return */
document.getElementById("round-trip").onclick = function() {
document.getElementById("show").className = "col show_";
document.getElementById("onereturn").className = "row g-2 contact-form-action";
document.getElementById("multiway").className = "";
document.getElementById("departure").className = "depart form-control dateleft border-top-r0";
}
// the following line causes the error in the test
/* multiway */
document.getElementById("multi-trip").onclick = function() {
document.getElementById("multiway").className = "multi-flight-wrap show_ mt-2";
document.getElementById("show").className = "col hide";
document.getElementById("departure").className = "depart form-control";
}
};
</script>
If you then press ctrl-f to search for the id multi-trip there is only one reference to that string, and it occurs in the above script, which means there is no such element.
Compare to searching for round-trip, it will find the element with that id.
<div class="col-md-4 flight_types m-0">
<div class="row">
<div class="d-flex gap-4 m-1">
<div class="form-check d-flex align-items-center gap-2 p-0">
<input class="form-check-input m-0" type="radio" name="trip" id="one-way" onclick="oneway();"
value="oneway"
checked>
<label class="form-check-label" for="one-way">
<!--<i class="icon mdi mdi-arrow-missed"></i>--> One Way </label>
</div>
<div class="form-check d-flex align-items-center gap-2 p-0">
<input class="form-check-input m-0" type="radio" name="trip" id="round-trip" value="return"
>
<label class="form-check-label" for="round-trip">
<!--<i class="icon mdi mdi-import-export"></i>--> Round Trip </label>
</div>
</div>
</div>
</div>
It seems logical that multi-trip option would be next to round-trip option in the above block, but maybe it is a feature that's not yet implemented.
If so, you can ignore the error by using this at the top of the test:
cy.once('uncaught:exception', () => false )
or if it's a regression that you need to catch, add this after the cy.visit() call
cy.get('#multi-trip').should('be.visible')