Skip to content

feat: add DashboardTester for widget move/resize/remove - #105

Merged
caalador merged 1 commit into
mainfrom
dashboard-tester
Jun 30, 2026
Merged

caalador merged 1 commit into
mainfrom
dashboard-tester

Conversation

@Artur-

@Artur- Artur- commented Jun 23, 2026

Copy link
Copy Markdown
Member

Adds a tester for the commercial Dashboard component that simulates the interactions a user performs on an editable dashboard: reordering, resizing and removing widgets (at the dashboard root and within sections). Each method fires the same client-side DOM event the web component sends, so the dashboard updates its server-side model and notifies registered listeners exactly as in a browser; all three require edit mode, mirroring the component.

Registers test(Dashboard) in CommercialTesterWrappers and routes the generated findDashboard() locator to GeneratedCommercialLocators by adding the dashboard package to the processor's commercial-package list. Covered by DashboardTesterTest.

Adds a tester for the commercial Dashboard component that simulates the
interactions a user performs on an editable dashboard: reordering, resizing
and removing widgets (at the dashboard root and within sections). Each method
fires the same client-side DOM event the web component sends, so the dashboard
updates its server-side model and notifies registered listeners exactly as in
a browser; all three require edit mode, mirroring the component.

Registers test(Dashboard) in CommercialTesterWrappers and routes the generated
findDashboard() locator to GeneratedCommercialLocators by adding the dashboard
package to the processor's commercial-package list. Covered by DashboardTesterTest.
@mcollovati
mcollovati requested a review from caalador June 29, 2026 11:39
@caalador
caalador merged commit b98e31e into main Jun 30, 2026
6 checks passed
@caalador
caalador deleted the dashboard-tester branch June 30, 2026 04:33
Artur- added a commit to vaadin/docs that referenced this pull request Sep 22, 2026
## Summary

Browserless Test 1.2 is what Vaadin 25.3 ships. It adds seven testers
and a set of tester methods that the *Component Testers* page does not
mention, and it changes what a value tester does with a value that
breaks a constraint. The page currently tells a test author the opposite
of what the code does.

Covered here:

- `vaadin/browserless-test#211` — `NumberFieldTester`,
`DatePickerTester`, `TimePickerTester` and `DateTimePickerTester` no
longer throw on `min` / `max` / `step` / required violations. They
commit the value and leave the field invalid, and `isValid()` asserts
the outcome. The page's *Constraint Enforcement* example claimed the
opposite.
- `vaadin/browserless-test#189` — `TreeGridTester` with `expand`,
`collapse`, `isExpanded` and `hasChildren`.
- `vaadin/browserless-test#197` — `SplitLayoutTester`, `CardTester` and
`AvatarGroupTester`.
- `vaadin/browserless-test#187` — `GridTester.deselect(int)` and
`deselectAll()`.
- `vaadin/browserless-test#186` — `AccordionTester.closeDetails()` and
`toggleDetails(String)`.
- `vaadin/browserless-test#191` — `NumberFieldTester.stepUp()` /
`stepDown()` and `isValid()`.
- `vaadin/browserless-test#183` — `DialogTester.pressEscape()` and
`clickOutside()`.
- `vaadin/browserless-test#168` — a uniform `clear()` plus the new
`clickClearButton()`.
- `vaadin/browserless-test#185` — `CheckboxTester.check()` / `uncheck()`
and `SwitchTester.switchOn()` / `switchOff()`.
- `vaadin/browserless-test#198` — `UploadTester` enforces `maxFiles`,
`maxFileSize` and accepted types, and adds `getLastUploadStatus()` and
`ensureUploaded()`.
- `vaadin/browserless-test#188` — tester interactions reach the
application as client-originated events.

Four testers released earlier, in 1.1.2, never reached the docs either,
so they are added with a `V25.2` badge: `DashboardTester`
(`vaadin/browserless-test#105`), `BreadcrumbsTester.getItemPaths()`
(`vaadin/browserless-test#107`), `TextTester`
(`vaadin/browserless-test#135`) and `MarkdownTester`
(`vaadin/browserless-test#132`).

## What changed

In `articles/flow/testing/browserless/component-testers.adoc`:

- *Using Component Testers* — one sentence saying that a tester drives
the component through the browser's path, so `isFromClient()` behaves as
it does in a running application.
- *Common Testers* — new rows for `TreeGrid`, `Accordion`,
`SplitLayout`, `Card`, `AvatarGroup`, `Dashboard`, `Text` and
`Markdown`, and new methods on the `TextField`, `Checkbox`,
`NumberField`, `Grid`, `Dialog`, `Upload`, `Breadcrumbs` and `Switch`
rows.
- *Constraint Enforcement* — rewritten around the distinction the code
makes. A constraint that keeps the value out of the field, such as
`maxLength` or an allowed character pattern, still makes the tester
throw. A constraint that only marks the field invalid is committed, as a
browser commits it, and asserted with `isValid()`.
- *Clearing a Value* — a new section for `clear()` versus
`clickClearButton()`, and the wording selection testers use instead.

## Notes for the reviewer

- `vaadin/browserless-test#185` and `#198` are merged but landed after
the `1.2.0-rc1` tag, so they are not in rc1. They need 1.2.0 final to
ship with 25.3. If the release does not pick them up, drop the `check()`
/ `uncheck()`, `switchOn()` / `switchOff()`, `getLastUploadStatus()` and
`ensureUploaded()` entries.
- The behavior change from `vaadin/browserless-test#211` is breaking for
existing tests that assert `assertThrows(IllegalArgumentException.class,
...)`. The upgrade-guide note is #6101.
- `Dashboard` is a commercial component, like the `GridPro` and `Chart`
rows already in the table.

## How to test

Documentation only, with inline snippets that are not compiled. The
behavior matches `NumberFieldTester`, `TreeGridTester`,
`AccordionTester`, `DialogTester`, `UploadTester` and the other testers
on `vaadin/browserless-test` `main`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Co-authored-by: Artur Signell <artur@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants