[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: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| 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:
Use cases:
DEV note: |
| 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. 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:
This will probably need some custom implementation |