Skip to content

test: stabilize button visual tests by disabling hover and active transitions#11599

Merged
web-padawan merged 1 commit intomainfrom
test/aura-button-stabilize
Apr 29, 2026
Merged

test: stabilize button visual tests by disabling hover and active transitions#11599
web-padawan merged 1 commit intomainfrom
test/aura-button-stabilize

Conversation

@web-padawan
Copy link
Copy Markdown
Member

Summary

Aura defines two transitions on the shared :is(vaadin-button, vaadin-upload-button, …) selector at packages/aura/src/components/button.css:7,86-88:

  • scale 180ms on press ([active])
  • opacity 100ms, background-color 100ms on the ::before hover overlay

The button visual tests' hover and active scenarios trigger these via sendMouseToElement / mousedown and capture immediately after, so the screenshot lands somewhere on the 100–180 ms ramp. Different Playwright versions land at different points along that ramp, producing baseline drift on every bump.

Same pattern as #11598 (upload-button), #11595 (tabs scroll buttons), and the cascade-order fix from #11587/#11588/#11591.

Changes

  • New packages/button/test/visual/not-animated-styles.js registering transition: none !important on vaadin-button :host, :host::before, :host::after.
  • Imported from the button visual tests for all 3 themes (aura, lumo, base).

!important is required because Aura is adopted into adoptedStyleSheets after registerStyles, and both rules sit at specificity 0,1,0.

Baseline impact

Six Aura *-hover.png button baselines shifted to the fully-opaque hover overlay end state — three under aura/screenshots/default/button/ and three under aura/screenshots/dark/button/. Diff is sub-LSB (MAX_DELTA = 1, button center byte-identical). The active, default, focus-ring, disabled, icon, accent, and variant baselines stay byte-identical, as do all Lumo and base baselines.

Test plan

  • Two consecutive yarn update:aura --group button and yarn update:aura:dark --group button runs in Docker produce byte-identical baselines (md5 confirmed for all 6 affected files).
  • yarn test:aura --group button (52/52), yarn test:aura:dark --group button (implicit), yarn test:lumo --group button, yarn test:base --group button (18/18) — all pass against the new baselines.
  • CI visual-tests workflow stays green.

🤖 Generated with Claude Code

Aura defines two transitions on the shared
:is(vaadin-button, vaadin-upload-button, …) selector in
packages/aura/src/components/button.css:7,86-88:
- scale 180ms on press ([active])
- opacity 100ms, background-color 100ms on the ::before hover overlay

The button visual tests' hover and active scenarios trigger these via
sendMouseToElement / mousedown and capture immediately after, so the
screenshot lands somewhere on the 100-180ms ramp. Different Playwright
versions land at different points along that ramp, producing baseline
drift on every bump.

Add packages/button/test/visual/not-animated-styles.js with
transition: none !important on vaadin-button :host, :host::before,
:host::after, and import it from the button visual tests for all
3 themes. Six Aura *-hover.png baselines (3 default + 3 dark) shift
to the fully-opaque hover overlay end state (sub-LSB diff,
max delta=1); active and default baselines, and all Lumo and base
baselines, stay byte-identical.

Same pattern as #11598 (upload-button), #11595 (tabs scroll buttons),
and the cascade-order fix from #11587/#11588/#11591.
@web-padawan web-padawan changed the title test: stabilize button visual tests by disabling Aura button transitions test: stabilize button visual tests by disabling hover and active transitions Apr 29, 2026
@sonarqubecloud
Copy link
Copy Markdown

@web-padawan web-padawan merged commit 02f0408 into main Apr 29, 2026
10 checks passed
@web-padawan web-padawan deleted the test/aura-button-stabilize branch April 29, 2026 09:16
@vaadin-bot
Copy link
Copy Markdown
Collaborator

Hi @web-padawan and @web-padawan, when i performed cherry-pick to this commit to 25.1, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 02f0408
error: could not apply 02f0408... test: stabilize button visual tests by disabling hover transitions (#11599)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants