Overview & context
Provide a page object for the chooser dialog. It should work for different types of items which can be choosen (pages, assets, ...)
Since the chooser dialog usually / per default (always?) wraps a grid, the API could be similar or "the same" as the API from the Grid P.O.,
when it comes to choose an item - e.g. selectRowByPath
Foreseen basic APIs for:
- selecting
- expanding
- choosing
API - minimal
New PO ChooserDialog
Note that we have other dialogs which we reference so far via form, e.g. expect.form("Add page").
For the chooser dialog, i propose to create a distinct PO Chooser or ChooserDialog - which can be accessed via pageObjects:
ChooserDialog chooser = expect.chooser("Select");
(Maybe) Exposing the grid
The ChooserDialog wraps a "grid" - I expect we can use info.magnolia.test.selenium.pageobjects.Grid within ChooserDialog.
The chooser dialog would then expose the Grid:
Grid grid = chooser.grid();
Selecting
Chooser dialog should expose for convenience methods originating in the grid for selection.
(We did some very similar stuff on info.magnolia.test.selenium.pageobjects.ContentApp).
ChooserDialog chooser.selectRowByPath(string){}
ChooserDialog chooser.clickRow(string){}
boolean chooser.hasRow(string){}
Expanding
Calling #expand assumes that an "expandable node" is already selected.
e.g.
chooser.selectRowByPath("ASIA").expand();
Choosing
To confirm the selection: chooser.select() which actually should hit the button "Select".
Example:
ChooserDialog chooser = expect("Select");
chooser.clickRow("Foobar")
.select();
API - extended
Set active view
Basically to choose between the (available) views.
Not sure whether we need this. For the INT-/UI-test it could be sufficient to operate on the tree only.
(See info.magnolia.test.selenium.pageobjects.ContentApp#setActiveView.)
Miscellaneous
Use cases
- move (various) items (in the browser subapp of various content apps)
- select (various) items (e.g. in page editor)
|