wttech / bobcat

Bobcat is an automated testing framework for functional testing of web applications.
https://cognifide.github.io/bobcat/
Apache License 2.0
91 stars 40 forks source link

How to configure a multifield inside a multifield ? #436

Open crisandani opened 4 years ago

crisandani commented 4 years ago

Environment

Bobcat version:

Bobcat modules used:

Browser + version: Chrome 81

I have problems configuring a component that contains a multifield in another multifield

Expected Behavior

Create 3 items of first multifield and complete them with the data from .yaml file

Actual Behavior

Create 1 item of first multifield and complete them with the data from .yaml file . Create 2 items of second multifield and crashes the test

Steps to reproduce

This is the Yaml file:

Tab:
  - label: 'Multifield1'
    type: MULTIFIELD
    value:
    - item:
      - type: PATHBROWSER
        label:  'Image'
        value: '/content/dam/folder/Asset.png'
      - type: TEXTFIELD
        label:  'Heading'
        value: 'Create your own template'
      - type: RICHTEXT
        label:  'Description'
        value: 'value'

    - item:
      - type: PATHBROWSER
        label:  'Image'
        value: '/content/dam/folder/Asset.png'
      - type: TEXTFIELD
        label:  'Heading'
        value: 'Automatic Backup Data'
      - type: RICHTEXT
        label:  'Description'
        value: 'value' 

    - item:
      - type: PATHBROWSER
        label:  'Image'
        value: '/content/dam/folder/Asset.png'
      - type: TEXTFIELD
        label:  'Heading'
        value: 'Page Builder'
      - type: RICHTEXT
        label:  'Description'
        value: 'value'

And this is cq_dialog File:

<multifield1
        jcr:primaryType="nt:unstructured"
        jcr:title="Multifield1"
    fieldLabel="Multifield1"
        ling:resourceType="granite/ui/components/coral/foundation/form/multifield"
        composite="{Boolean}true">
        <field
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container"
                name="./multifield1Items">
            <items jcr:primaryType="nt:unstructured">
                <image
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                        class="cq-droptarget"
                        fieldLabel="Image"
                        required="{Boolean}false"
                        rootPath="/content/dam/"
                        fieldDescription="Drag and drop an image asset from the asset finder here."
                        name="./imagePath"/>
        <heading
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
            fieldLabel="Heading"
            name="./heading"/>
        <text
            jcr:primaryType="nt:unstructured"
            sling:resourceType="cq/gui/components/authoring/dialog/richtext"
            fieldLabel="Description"
            name="./description"
            useFixedInlineToolbar="{Boolean}true">
            //more richText settings
        </text>
        <multifield2
            jcr:primaryType="nt:unstructured"
            jcr:title="Multifield2"
            sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
            composite="{Boolean}true">
            <field
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/container"
                name="./multifield2Items">
                <items jcr:primaryType="nt:unstructured">
                    <check
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Check List"
                        name="./check"/>
                </items>
            </field>
        </multifield2>
            </items>
        </field>
</multifield1>
crisandani commented 4 years ago

I think the configuration hierarchy of the .yaml file doesn't work well. I have a RICHTEXT field before multifield and another in multifield. For the RICHTEXT field inside the multifield I set a value but change the one before the multifield.