rust/tests/rustdoc-gui
bors 0d6e130196 Auto merge of #131002 - steffahn:rustdoc-long-names-fix, r=notriddle
In redesigned rustdoc toolbar: Adjust spacings and sizing to improve behavior with over-long names

Fixes #130993.

Some additional adjustments also fix more issues I’ve noticed such as:

* on small screens, opening search made the 3 bottons move down very slightly (because the row with the crate picker got larger, enlarging the whole grid), this is fixed with a `min-height: 60px` on the toolbar
* with long names in the “breadcrumps” area, wrapping was very broken
  * ![Screenshot_20240929_031831](https://github.com/user-attachments/assets/6f46bbb7-004b-4606-bf17-8a6f3289a8f7)
  * fixed:
  * ![Screenshot_20240929_035312](https://github.com/user-attachments/assets/4e2f8dd2-043e-4279-b588-0a72c7533f8e)
* the left grid area has a minimal width (105px); like before, that leaves about enough space for crate names becoming as short as “all cra…”;
    to save even more space, there’s support for a little bit of extra squeezing of the buttons
  * ![Screenshot_20240929_034511](https://github.com/user-attachments/assets/7c6788ee-8ec1-4a38-b341-8d67704f5575)
  * ![Screenshot_20240929_034525](https://github.com/user-attachments/assets/e141756d-37a9-4205-bc4d-235ddd1c0609)
  * ![Screenshot_20240929_034535](https://github.com/user-attachments/assets/526447f3-48b6-47aa-8a60-e5b0d4d055f0)

I’m really not super good with HTML or CSS stuff at all; there seem to be many magical numbers already, I’ve just used `px` values until things look right, I hope that’s okay 🤷‍♂️

r? `@GuillaumeGomez`

cc `@notriddle`
2024-09-29 22:04:32 +00:00
..
src rustdoc: make the header show all three buttons 2024-09-10 17:56:06 -07:00
anchor-navigable.goml
anchors.goml rustdoc: make the header show all three buttons 2024-09-10 17:56:06 -07:00
basic-code.goml
check_info_sign_position.goml
check-code-blocks-margin.goml
check-stab-in-docblock.goml
code-blocks-overflow.goml
code-color.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
code-example-buttons.goml Simplify CSS but wrapping scraped example into a div and move the title out of the code block 2024-09-02 15:59:00 +02:00
code-sidebar-toggle.goml
code-tags.goml
codeblock-sub.goml
codeblock-tooltip.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
copy-code.goml Update GUI tests for code example buttons 2024-08-05 11:04:51 +02:00
copy-path.goml Add GUI test for copy path button 2024-04-17 16:56:14 +02:00
cursor.goml
default-settings.goml
deref-block.goml Add tests for new toggle on deref blocks 2024-07-15 20:07:24 +02:00
docblock-big-code-mobile.goml
docblock-code-block-line-number.goml Make use of wait-for*-false commands 2024-09-28 18:04:00 +02:00
docblock-details.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
docblock-table-overflow.goml
docblock-table.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
duplicate-macro-reexport.goml rustdoc: use <wbr>-tolerant function to check text contents 2024-07-29 08:46:11 -07:00
enum-variants.goml
escape-key.goml
extend-css.goml
fields.goml
font-weight.goml rustdoc: use <wbr>-tolerant function to check text contents 2024-07-29 08:46:11 -07:00
globals.goml
go-to-collapsed-elem.goml
hash-item-expansion.goml
headers-color.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
headings-anchor.goml
headings.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
help-page.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
hide-mobile-topbar.goml
highlight-colors.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
huge-collection-of-constants.goml
huge-logo.goml rustdoc: add test cases for mile wide bar 2024-07-16 13:29:35 -07:00
impl_on_foreign_order.goml
impl-default-expansion.goml
impl-doc.goml
implementors.goml
item-decl-colors.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
item-decl-comment-highlighting.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
item-info-alignment.goml
item-info-overflow.goml
item-info.goml rustdoc: tweak spacing in toolbar 2024-09-10 17:56:17 -07:00
item-name-wrap.goml Add regression test for items list size (#128023) 2024-07-22 11:33:03 +02:00
item-summary-table.goml
javascript-disabled.goml rustdoc: dedup search form HTML 2024-05-05 08:15:08 -07:00
jump-to-def-background.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
label-next-to-symbol.goml rustdoc: properly handle path wrapping 2024-07-29 10:31:02 -07:00
links-color.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
list_code_block.goml
method-margins.goml
mobile-crate-name.goml
mobile.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
module-items-font.goml
no-docblock.goml
notable-trait.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
overflow-tooltip-information.goml
pocket-menu.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
README.md
rust-logo.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
scrape-examples-button-focus.goml Fix wrong padding for expanded scraped example 2024-09-03 01:04:59 +02:00
scrape-examples-color.goml Simplify CSS but wrapping scraped example into a div and move the title out of the code block 2024-09-02 15:59:00 +02:00
scrape-examples-fonts.goml
scrape-examples-layout.goml rustdoc-gui: fix test cases 2024-09-29 10:02:06 -07:00
scrape-examples-toggle.goml Make theme switching closer to reality 2024-04-08 12:14:41 +02:00
search-corrections.goml
search-error.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
search-filter.goml rustdoc: make the header show all three buttons 2024-09-10 17:56:06 -07:00
search-form-elements.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
search-input-mobile.goml
search-keyboard.goml
search-no-result.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
search-reexport.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
search-result-color.goml rustdoc: use <wbr>-tolerant function to check text contents 2024-07-29 08:46:11 -07:00
search-result-description.goml
search-result-display.goml rustdoc-gui: fix test cases 2024-09-29 10:02:06 -07:00
search-result-go-to-first.goml Tweak breadcrumbs list 2024-09-23 09:21:39 -07:00
search-result-impl-disambiguation.goml rustdoc-search: account for numeric disambiguators on impls 2024-08-06 07:36:12 -07:00
search-result-keyword.goml
search-tab-change-title-fn-sig.goml
search-tab.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
search-title.goml Add rustdoc GUI test to check title with and without search 2024-07-27 12:12:16 +02:00
setting-auto-hide-content-large-items.goml
setting-auto-hide-item-methods-docs.goml
setting-auto-hide-trait-implementations.goml
setting-go-to-only-result.goml
settings-button.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
settings.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
shortcuts.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
sidebar-links-color.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
sidebar-macro-reexport.goml rustdoc: use <wbr>-tolerant function to check text contents 2024-07-29 08:46:11 -07:00
sidebar-mobile-scroll.goml
sidebar-mobile.goml rustdoc: use <wbr>-tolerant function to check text contents 2024-07-29 08:46:11 -07:00
sidebar-modnav-position.goml rustdoc: add test case for modnav position when TOC is off 2024-08-20 16:54:04 -07:00
sidebar-resize-close-popover.goml
sidebar-resize-setting.goml
sidebar-resize-window.goml
sidebar-resize.goml
sidebar-source-code-display.goml rustdoc-gui: fix test cases 2024-09-29 10:02:06 -07:00
sidebar-source-code.goml rustdoc: use <wbr>-tolerant function to check text contents 2024-07-29 08:46:11 -07:00
sidebar.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
source-anchor-scroll.goml rustdoc-gui: fix test cases 2024-09-29 10:02:06 -07:00
source-code-page-code-scroll.goml Update source-code-page-code-scroll.goml GUI test 2024-07-21 12:47:34 +02:00
source-code-page.goml rustdoc: make the header show all three buttons 2024-09-10 17:56:06 -07:00
src-font-size.goml
stab-badge.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
stab-in-doc.goml Add regression test for stab display in doc blocks 2024-07-21 11:52:24 +02:00
struct-fields.goml
target.goml rustdoc: animate the :target highlight 2024-08-19 18:14:35 -07:00
theme-change.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
theme-defaults.goml
theme-in-history.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
toggle-click-deadspace.goml Tweak breadcrumbs list 2024-09-23 09:21:39 -07:00
toggle-docs-mobile.goml rustdoc-gui: fix test cases 2024-09-29 10:02:06 -07:00
toggle-docs.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
toggle-implementors.goml
toggled-open-implementations.goml
tooltip-over-sidebar.goml
trait-sidebar-item-order.goml
trait-with-bounds.goml Add GUI test for trait bounds display 2024-07-19 21:31:30 +02:00
type-declation-overflow.goml rustdoc: redesign toolbar and disclosure widgets 2024-09-10 17:56:05 -07:00
type-impls.goml
unsafe-fn.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
utils.goml Make theme switching closer to reality 2024-04-08 12:14:41 +02:00
warning-block.goml Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
where-whitespace.goml

The tests present here are used to test the generated HTML from rustdoc. The goal is to prevent unsound/unexpected GUI changes.

This is using the browser-ui-test framework to do so. It works as follows:

It wraps puppeteer to send commands to a web browser in order to navigate and test what's being currently displayed in the web page.

You can find more information and its documentation in its repository.

If you need to have more information on the tests run, you can use --test-args:

$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --debug

If you don't want to run in headless mode (helpful to debug sometimes), you can use --no-headless:

$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-headless

To see the supported options, use --help.

Important to be noted: if the chromium instance crashes when you run it, you might need to use --no-sandbox to make it work:

$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-sandbox