b4e78d426dcdb47a20f1979025d5a0969ea79ac4 braney Thu Sep 17 17:07:49 2026 -0700 docent: a box: check for where an element sits, and lists for text:/noText:, refs #37892 `expect:` could say what was in a page and never where it was on the screen. has:/noHas: take a CSS selector, which describes the tree; color: reads pixels but only inside a track's row. #38251 moved the narrow-window menu icon out of the blue bar with every selector still matching and every word of the page still there, and nothing in the language could ask about it. box: takes `inside:` (every edge within another element's box, with `tolerance:` px of slack), `clear:` (no overlap with anything a selector matches, `gap:` for a minimum separation) and `height:`/`width:`. Every element `sel:` matches has to satisfy every clause, so {sel: "ul.nice-menu > li", inside: "#main-menu-whole"} reads as "every menu item is in the bar". Boxes are read in document coordinates; an element with no box at all is skipped rather than treated as a zero-sized box at the origin, which would sit "inside" anything. A failure prints the measurement: #topRightLinks is not inside #main-menu-whole: 114px above it -- it is at 666,0 34x32, #main-menu-whole at 0,114 1000x32 The image height: and box's own height:/width: now share one cmpSize(), so the two cannot drift into different comparison grammars. text: and noText: take a list, the way rows:, has: and noHas: always did. They have to: a list handed to a check that stringifies its argument fails OPEN -- ["a", "b"] becomes "a,b", which no page contains, so it passes on anything, and passes silently. Six scripts in one batch were written that way and all six looked green. pagechecks and its .xfail twin cover both, the xfail with one entry aimed wrongly and one aimed rightly in each list, so it fails only if every entry is really looked at on its own. diff --git src/hg/utils/docent/tests/README.txt src/hg/utils/docent/tests/README.txt index e2ccb73b8c9..a3f003f3ea4 100644 --- src/hg/utils/docent/tests/README.txt +++ src/hg/utils/docent/tests/README.txt @@ -121,38 +121,45 @@ below. views.xfail the same thing aimed at the COMPOSITE instead, which loses the row. Expected to fail. supertrack varsInPubs hideKids + one member: `exact: true`, because a test that only checked the member was present would pass with all six drawn. urllen {cCREs: hideKids} must not become the 1701-variable, 42,020-character GET that Apache answered with 414. Checks `noText: "Too Long"`, since a 414 renders as a perfectly good page; the derive baseline pins it at 3. customtrack addCustomTrack: with inline BED, tabs and newlines surviving the trip. scale a 3x run draws the same rows as a 1x one. ordered `ordered: true` on rows:, and the fact that a row which was not drawn is reported by rows: alone rather than failing the order check as well. ordered.xfail the same two rows named the wrong way round. Expected to fail -- a flag that cannot fail is not a check, it is a second copy of the set test. pagechecks the `expect:` checks that read the PAGE rather than the track image -- - `url:`/`noUrl:` on the address, `has:`/`noHas:` on a CSS selector -- plus - the positional form of `click:` (`{track:, frac:}`), which follows the - item box nearest a point. All four exist for bugs that rows:, height: and + `url:`/`noUrl:` on the address, `has:`/`noHas:` on a CSS selector, `box:` + on where an element sits, and `text:`/`noText:` given LISTS -- plus the + positional form of `click:` (`{track:, frac:}`), which follows the item + box nearest a point. They exist for bugs that rows:, height: and a plain text: cannot see: a search term's zero-width space stripped out of a URL - (#36387), a center label attached to the wrong row (#37785), and an item - that cannot be named at all because its track is `type bigBed 3` (#36335). - pagechecks the same four aimed the wrong way at once. Expected to fail. The message - .xfail names every check that failed, so one run says which of the four broke. + (#36387), a center label attached to the wrong row (#37785), an item that + cannot be named at all because its track is `type bigBed 3` (#36335), and + the menu icon leaving the blue bar with every selector still matching + (#38251). The list form is here because it used to fail OPEN: text: took + one string, so ["a", "b"] became "a,b", matched nothing and passed on any + page, silently. + pagechecks the same checks aimed the wrong way at once. Expected to fail. The message + .xfail names every one that failed, so one run says which broke. Each list holds + one entry aimed wrongly and one aimed rightly, so it fails only if every + entry is really looked at on its own. colorchecks `color:`, the one check that reads the track IMAGE: is:/not: on the color a row is mostly drawn in, `part: label` for the center label instead of the items, `at:` for one item rather than the whole row, and the list form. It exists for #36212, where a track that sets both `itemRgb on` and `color` draws its items in the wrong one -- same rows, same height, same names, same tooltips, so nothing but the pixels can tell. colorchecks the same six aimed wrong, all in ONE expect: step so the message has to .xfail name all six. Expected to fail. The comment lists them in order; read the log rather than trusting the exit code. expectfail an assertion that is plainly false. Expected to fail -- if it ever passes, .xfail `expect:` has stopped throwing and every other test here means nothing. make parity FAST vs slow, and a rerun, on composite. FAST drops the dwells and the recording and must not change what the page ends up showing; the rerun catches state left behind in the cart.