Three review points. The table id was sliced out of the stage URL without trimming a trailing slash, so a route rendered as /stage/<id>/ produced an id that never matched the button. Trailing slashes are removed before use. The options menu entry is matched on the whole label, /^\s*Download\s*$/, because an entry like "Download web query" would make cy.contains ambiguous and it fails outright rather than picking one. The getddl guard covers both hosts: libref is read behind a typeof too, so a call with either variable out of scope falls back instead of throwing.