[MGNLTEST-4] Page Object for chooser dialog Created: 25/May/20  Updated: 30/Jun/21  Resolved: 26/Apr/21

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.0

Type: Task Priority: High
Reporter: Christoph Meier Assignee: Milan Divilek
Resolution: Fixed Votes: 1
Labels: QA&Testing, VN-Testing, form-element, ui-test-fwk
Remaining Estimate: Not Specified
Time Spent: 0.5d
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLTEST-131 Align Form PO button lookup by icon v... Selected
relates to MGNLTEST-141 Add support for LinkField's ComboBox ... Selected
dependency
is depended upon by MGNLTEST-10 Form page object can handle multi-fields Closed
is depended upon by MGNLCE-273 Add missing ui-tests for adding relat... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: Fn tests spike 2
Sprint: UI FW 25, UI FW 26
Story Points: 8

 Description   

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){}
//maybe:
boolean chooser.hasRow(string){}

Expanding

Calling #expand assumes that an "expandable node" is already selected.

ChooserDialog expand();

e.g.

chooser.selectRowByPath("ASIA").expand();

Choosing 

 To confirm the selection: chooser.select() which actually should hit the button "Select".

void 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

void close(); // could also be named cancel. To close the chooser.

 


Use cases

  • move (various) items (in the browser subapp of various content apps)
  • select (various) items (e.g. in page editor)


 Comments   
Comment by Christoph Meier [ 22/Mar/21 ]

mgeljic, cc asiska - I have proposed a (more concrete) API in the description above.
I have a minimal version  ... plus a few bits for an extended versions.
Right now I assume the "minimal" version would already cover a lot.

Idk how much it complicates things when we allow to switch to another view.

wdyt?

Generated at Mon Feb 12 07:44:36 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.