[MGNLTEST-10] Form page object can handle multi-fields Created: 24/Oct/19  Updated: 30/Jun/21  Resolved: 28/Apr/21

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

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

Attachments: PNG File add-related-category_MULTIFIELD.png     PNG File choose-audience-complex-field.png    
Issue Links:
Cloners
is cloned by MGNLTEST-100 Form page object can handle composite... Closed
Issue split
split to MGNLTEST-162 Support different field types in Mult... Closed
Relates
dependency
depends upon MGNLTEST-4 Page Object for chooser dialog Closed
is depended upon by MGNLCE-227 Functional tests p13n - high prio Closed
is depended upon by MGNLEE-633 Implement Int. tests for p13n - high ... Closed
is depended upon by MGNLCE-273 Add missing ui-tests for adding relat... Closed
relation
is related to MGNLTEST-8 Page object for the PasswordField Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Story Points: 5

 Description   

Provide a possibility which enables the input of values into complex fields with multiple fields where some of the fields may not have a label.

Entails providing Form APIs for:

  • multi-fields: user wants to add/remove entries, and fill entries by position
  • composite-fields: user wants to fill a field by a certain caption (extracted to MGNLTEST-100)

 


Use cases:

  • Related categories in Categories App
  • Add trait segments in audience of p13n 
  • Select tours field in Tour Carousel component

DEV note:
there is info.magnolia.test.selenium.pageobjects.MultiField already, just Form PO needs to be adjusted accordingly (see ContentEditor)



 Comments   
Comment by Adam Siska [ 12/Jan/21 ]
    /**
     * <pre>
     * Scenario: Add related category within category
     *   Given user "Paige" opens the Categories app
     *   When user "Paige" click on "TestCategory" item
     *   And hits the action "Edit category",
     *   And add "TestCategoriesFolder/cat", "TestCategoriesFolder/ego" and "TestCategoriesFolder/ry" to "Related categories" field.
     *   And saves the form.
     *   Then "TestCategoriesFolder/cat", "TestCategoriesFolder/ego" and "TestCategoriesFolder/ry" are stored as related in "TestCategory".
     * </pre>
     */
    @Test
    @Fixture(fixtureFile = "category.TestCategory.yaml", repository = "category")
    @Fixture(fixtureFile = "category.TestCategoriesFolder.yaml", repository = "category")
    @Cleanup(value = "category:/TestCategory")
    @Cleanup(value = "category:/TestCategoriesFolder")
    void addRelatedCategories(PageObjects expect) {
        categoriesApp.clickRow("TestCategory")
                .hitAction("Edit category");        expect.form()
                .addMultiFieldItem("Related Categories")
                .setMultiFieldValueItemAt("Related Categories", 0, "/TestCategoriesFolder/cat")
                .addMultiFieldItem("Related Categories")
                .addMultiFieldItem("Related Categories")
                .setMultiFieldValueItemAt("Related Categories", 1, "/TestCategoriesFolder/ego")
                .setMultiFieldValueItemAt("Related Categories", 2, "/TestCategoriesFolder/ry")
                .save();        categoriesApp.hitAction("Edit category");
        assertEquals("/TestCategoriesFolder/cat", expect.form().getMultiFieldValueItemAt("Related Categories", 0));
        assertEquals("/TestCategoriesFolder/ego", expect.form().getMultiFieldValueItemAt("Related Categories", 1));
        assertEquals("/TestCategoriesFolder/ry", expect.form().getMultiFieldValueItemAt("Related Categories", 2));
    }
Comment by Christoph Meier [ 01/Mar/21 ]

Work is actually done. "Only" needs a review.

Comment by Milan Divilek [ 20/Apr/21 ]

https://git.magnolia-cms.com/projects/PLATFORM/repos/test-framework/pull-requests/77

PR above adds basic support for MultiField into form it allows add/remove/move items in MultiField. It also adds support for set/getValues from multified composed from single text and link field.
It allows to cover "Related categories in Categories App" and "Select tours field in Tour Carousel component" use cases.


The "Add trait segments in audience of p13n" will need additional work

"Segments" multifield is based on single ComboBox which should be relatively simple to fix(add support).

"Choose traits of audience" multifield there are two issues:

  1. The chooser dialog is custom and is composed from radio select field instead of grid (tree/list)
  2. Item can have different field inside:
  • Country trait - contains ComboBox
  • Date trait - contains two DateFields
  • Visitor and Cookie traits - contais radio select field

This will probably need some custom implementation

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