ce8cbfc3d2ef6853f94bf80b0f8b5f389c60025b
braney
Sat Sep 5 09:21:32 2026 -0700
docent: two more expect: checks, a positional click:, and three fixes found writing tests
Everything here was needed by a regression script that could not otherwise be
written, or by one that failed for a reason that was not a bug.
expect: {url:, noUrl:} is a substring check on the current address. Some things
are visible nowhere else: which CGI a click reached, and what a form put in a
query string. #36387's fix strips zero-width characters out of a search term
before the position box submits it, and the character is invisible in the
rendered page, so whether %E2%80%8B survives into the URL is the only evidence
either way.
expect: {has:, noHas:} takes a CSS selector, for a bug whose whole signature is
WHERE something sits. #37785 attached a squishyPack track's center label to the
wrong row: same rows drawn, same image height, same pixels, and only the row the
label's image map hangs off changed, so rows:, height: and text: are all blind
to it. Documented as a last resort, since an assertion on hgTracks' own ids
breaks easily for reasons that are not bugs.
click: now takes the positional forms mouseover: already had (at:/frac:/x:) and
follows the item box nearest that point. Some tracks have no item that can be
named at all: every GIAB Problematic Regions subtrack is type bigBed 3, so
hgTracks writes an EMPTY i= into the hgc href and gives every box the title
"Start of Exon (1/1)". Neither item: nor title: can pick one, and a raw mouse
click on the data area is swallowed by the drag-select handler.
The "item not found" message now picks the row's map boxes by MAP NAME instead of
by a y-band, reports how many boxes are in the row, and falls back to a box's
title when it has no name. On a quickLift target the band test dropped every item
box, so the message said the GIAB row held three things when it held twenty-six,
and the three it named were a density control and two exon arrows.
goShow now scrolls to the top and takes the Login/Share links out of the way
before clicking Search. Those links sit in an absolutely-positioned container at
the top right of the header bar and on a wide page land on top of #goButton;
Playwright then retries for the full 30s and fails with "<a id=loginLink ...>
subtree intercepts pointer events", which reads like a broken Search button
rather than a covered one. Pressing Enter in the position box is not a
substitute: by the time a 30s click timeout has been caught, the navigation wait
armed before it has already expired.
tests/pagechecks and tests/pagechecks.xfail cover all of it, per the rule in
tests/README.txt that a verb we touch and find untested belongs on its list. The
xfail aims all four new checks the wrong way at once, because a check that cannot
fail is not a check.
refs #38252
diff --git src/hg/utils/docent/tests/pagechecks.xfail.docent.yaml src/hg/utils/docent/tests/pagechecks.xfail.docent.yaml
new file mode 100644
index 00000000000..6f70ae570d3
--- /dev/null
+++ src/hg/utils/docent/tests/pagechecks.xfail.docent.yaml
@@ -0,0 +1,30 @@
+# EXPECTED TO FAIL. The other half of pagechecks.docent.yaml.
+#
+# The same view with all four new checks aimed the wrong way at once. If this run ever
+# exits 0, at least one of url:, noUrl:, has: and noHas: has stopped comparing anything --
+# and since the regression suite next door leans on them for bugs that rows:, height: and
+# text: cannot see, they would pass silently over exactly those bugs.
+#
+# One script rather than four because each check was also verified on its own by hand when
+# it was written, and four near-identical scripts is four things to keep in step. The
+# failure names every check that failed, so a single run says which of the four broke.
+#
+# The failure it should print, all four in one message:
+# url is "https://genome-test.gi.ucsc.edu/cgi-bin/hgTracks?...", wanted it to contain
+# "/hgSearch"; url contains "/hgTracks": ...; nothing matches
+# "#td_data_ruler map[name=map_center_mane]"; 1 element(s) match
+# "#td_data_mane map[name=map_center_mane]", wanted none
+target: genome-test
+db: hg38
+position: chr7:155799529-155812871
+reset: true
+fast: true
+steps:
+ - go: chr7:155799529-155812871
+ - hide: all
+ - track: {mane: pack}
+ - expect:
+ url: "/hgSearch"
+ noUrl: "/hgTracks"
+ has: "#td_data_ruler map[name=map_center_mane]"
+ noHas: "#td_data_mane map[name=map_center_mane]"