[MGNLCE-273] Add missing ui-tests for adding related categories in Categories App Created: 28/Apr/21  Updated: 02/Jul/21  Resolved: 02/Jul/21

Status: Closed
Project: Community Edition
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.11

Type: Improvement Priority: Neutral
Reporter: Milan Divilek Assignee: Adam Siska
Resolution: Fixed Votes: 0
Labels: QA&Testing, functional-tests
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLTEST-10 Form page object can handle multi-fields Closed
depends upon MGNLTEST-4 Page Object for chooser dialog Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Epic Link: Migrate categories app
Sprint: UI FW 31
Story Points: 3

 Description   

CategoriesCoreFunctionalTests#addRelatedCategories was not implemented because of missing support for handling the multi-fields in form. This is implemented now in MGNLTEST-10

Also we need to use chooser dialog here, done in MGNLTEST-4. Here is scenario and sketch for the test

/**
     * <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));
    }

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