diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/radiobutton/.content.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/radiobutton/.content.xml
index 06c97ae938..8c3b579445 100644
--- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/radiobutton/.content.xml
+++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/radiobutton/.content.xml
@@ -3,5 +3,5 @@
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Radio Button"
jcr:description="Add two or more radio buttons for users to select one of the available options."
- sling:resourceSuperType="core/fd/components/form/radiobutton/v1/radiobutton"
+ sling:resourceSuperType="core/fd/components/form/radiobutton/v2/radiobutton"
componentGroup="Core Components Examples - Adaptive Form"/>
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/customfunctions/populate-radiobuttonv2/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/customfunctions/populate-radiobuttonv2/.content.xml
new file mode 100755
index 0000000000..384a7f4154
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/customfunctions/populate-radiobuttonv2/.content.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/.content.xml
new file mode 100755
index 0000000000..7256712059
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/.content.xml
@@ -0,0 +1,7 @@
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/basic/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/basic/.content.xml
old mode 100755
new mode 100644
similarity index 93%
rename from it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/basic/.content.xml
rename to it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/basic/.content.xml
index bdc1e5fad1..033773bc60
--- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/basic/.content.xml
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/basic/.content.xml
@@ -3,7 +3,6 @@
jcr:primaryType="dam:Asset">
-
\ No newline at end of file
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/focustest/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/focustest/.content.xml
new file mode 100644
index 0000000000..72f9c8a3be
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/focustest/.content.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/radiorepeatability/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/radiorepeatability/.content.xml
new file mode 100644
index 0000000000..6a0bfd99d5
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv1/radiorepeatability/.content.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/.content.xml
new file mode 100755
index 0000000000..7256712059
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/.content.xml
@@ -0,0 +1,7 @@
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/basic/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/basic/.content.xml
new file mode 100644
index 0000000000..033773bc60
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/basic/.content.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/focustest/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/focustest/.content.xml
new file mode 100644
index 0000000000..72f9c8a3be
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/focustest/.content.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/radiorepeatability/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/radiorepeatability/.content.xml
new file mode 100644
index 0000000000..6a0bfd99d5
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiobuttonv2/radiorepeatability/.content.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiorepeatability/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiorepeatability/.content.xml
deleted file mode 100755
index 46b161b293..0000000000
--- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/radiobutton/radiorepeatability/.content.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/customfunctions/populate-radiobutton/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/customfunctions/populate-radiobutton/.content.xml
index 4cfef3806e..2ccbc6d966 100755
--- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/customfunctions/populate-radiobutton/.content.xml
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/customfunctions/populate-radiobutton/.content.xml
@@ -33,7 +33,7 @@
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="RadioButton with no options"
- sling:resourceType="forms-components-examples/components/form/radiobutton"
+ sling:resourceType="core/fd/components/form/radiobutton/v1/radiobutton"
enabled="{Boolean}true"
fieldType="radio-group"
hideTitle="false"
@@ -109,7 +109,7 @@
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="len(current options) = len(enums/enumNames)"
- sling:resourceType="forms-components-examples/components/form/radiobutton"
+ sling:resourceType="core/fd/components/form/radiobutton/v1/radiobutton"
enabled="{Boolean}true"
enum="[1,2,3]"
enumNames="[country1,country2,country3]"
@@ -187,7 +187,7 @@
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="len(current options) < len(enums/enumNames)"
- sling:resourceType="forms-components-examples/components/form/radiobutton"
+ sling:resourceType="core/fd/components/form/radiobutton/v1/radiobutton"
enabled="{Boolean}true"
enum="[1,2]"
enumNames="[country1,country2]"
@@ -265,7 +265,7 @@
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="len(current options) > len(enums/enumNames)"
- sling:resourceType="forms-components-examples/components/form/radiobutton"
+ sling:resourceType="core/fd/components/form/radiobutton/v1/radiobutton"
enabled="{Boolean}true"
enum="[1,2,3,4]"
enumNames="[country1,country2,country3,country4]"
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/customfunctions/populate-radiobuttonv2/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/customfunctions/populate-radiobuttonv2/.content.xml
new file mode 100755
index 0000000000..7a6f567ce6
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/customfunctions/populate-radiobuttonv2/.content.xml
@@ -0,0 +1,360 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/.content.xml
index 8f415a05ec..bbf62ed22c 100755
--- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/.content.xml
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/.content.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/.content.xml
new file mode 100755
index 0000000000..bbf62ed22c
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/.content.xml
@@ -0,0 +1,5 @@
+
+
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/basic/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/basic/.content.xml
new file mode 100755
index 0000000000..6efc7941c8
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/basic/.content.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/focustest/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/focustest/.content.xml
new file mode 100644
index 0000000000..255b43b69f
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/focustest/.content.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/radiorepeatability/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/radiorepeatability/.content.xml
new file mode 100755
index 0000000000..35a9ab602d
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/radiorepeatability/.content.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv2/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv2/.content.xml
new file mode 100755
index 0000000000..bbf62ed22c
--- /dev/null
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv2/.content.xml
@@ -0,0 +1,5 @@
+
+
diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/basic/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv2/basic/.content.xml
similarity index 99%
rename from it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/basic/.content.xml
rename to it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv2/basic/.content.xml
index 62063519b1..58b0d08d79 100755
--- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/basic/.content.xml
+++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/radiobutton/radiobuttonv2/basic/.content.xml
@@ -9,7 +9,7 @@
jcr:language="en"
jcr:primaryType="cq:PageContent"
jcr:title="basic"
- sling:configRef="/conf/forms/core-components-it/samples/radiobutton/basic/"
+ sling:configRef="/conf/forms/core-components-it/samples/radiobutton/radiobuttonv2/basic/"
sling:resourceType="forms-components-examples/components/page">
+
+ ${labelValue @ context = labelRichText ? 'html' : 'text'}
+
+
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/.content.xml
new file mode 100644
index 0000000000..cd3ddd1d64
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/.content.xml
@@ -0,0 +1,19 @@
+
+
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/.content.xml
new file mode 100644
index 0000000000..f212697391
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/.content.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/README.md b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/README.md
new file mode 100644
index 0000000000..0af3f2df52
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/README.md
@@ -0,0 +1,115 @@
+
+RadioButton (v2)
+====
+Adaptive form Radio Button component written in HTL.
+
+## Features
+
+* Provides the following type of input in form of radio button:
+ * string
+ * boolean
+ * number
+* Alignment of Options (`horizontal` or `vertical`)
+* Styles
+* Allows replacing this component with other component (as mentioned below).
+
+## Changes in v2
+
+- Root element changed from `div` to `fieldset` for better semantics and accessibility.
+- Label and help icon are now rendered inside a native `legend`.
+- Added modifier class `cmp-adaptiveform-radiobutton--v2` on the root block.
+- Extracted options markup to `widget.html` template (no functional change).
+- Documented `cmp-adaptiveform-radiobutton__widget` BEM element.
+- Client library categories remain the same as v1 (runtime/editor).
+
+### Use Object
+The Form Radio Button component uses the `com.adobe.cq.forms.core.components.models.form.RadioButton` Sling Model for its Use-object.
+
+### Edit Dialog Properties
+The following properties are written to JCR for this Radio Button component and are expected to be available as `Resource` properties:
+
+1. `./name` - defines the name of the field, which will be submitted with the form data
+2. `./jcr:title` - defines the label to use for this field
+3. `./hideTitle` - if set to `true`, the label of this field will be hidden
+4. `./type` - defines the type of values(string, boolean, number) which can be accepted
+5. `./enum` - an array[] of type, defines the available values for selection
+6. `./enumNames` - an array[] of strings, defines the display value of the enum
+7. `./default` - defines the default option of the field
+8. `./alignment` - defines how should the options be displayed, horizontally or vertically.
+9. `./description` - defines a help message that can be rendered in the field as a hint for the user
+10. `./required` - if set to `true`, this field will be marked as required, not allowing the form to be submitted until the field has a value
+11. `./requiredMessage` - defines the message displayed as tooltip when submitting the form if the value is left empty
+12. `./readOnly` - if set to `true`, the filed will be read only
+13. `./fieldType` - defines the type of the component
+
+
+## Client Libraries
+The component provides a `core.forms.components.radiobutton.v1.runtime` client library category that contains the Javascript runtime for the component.
+It should be added to a relevant site client library using the `embed` property.
+
+It also provides a `core.forms.components.radiobutton.v1.editor` editor client library category that includes
+JavaScript handling for dialog interaction. It is already included by its edit dialog.
+
+Note: v2 uses the v1 client library categories for both runtime and editor.
+
+## BEM Description
+```
+BLOCK cmp-adaptiveform-radiobutton
+ MODIFIER cmp-adaptiveform-radiobutton--v2
+ ELEMENT cmp-adaptiveform-radiobutton__label
+ ELEMENT cmp-adaptiveform-radiobutton__label-container
+ ELEMENT cmp-adaptiveform-radiobutton__widget
+ ELEMENT cmp-adaptiveform-radiobutton__option
+ ELEMENT cmp-adaptiveform-radiobutton__option-label
+ ELEMENT cmp-adaptiveform-radiobutton__option__widget
+ ELEMENT cmp-adaptiveform-radiobutton__questionmark
+ ELEMENT cmp-adaptiveform-radiobutton__shortdescription
+ ELEMENT cmp-adaptiveform-radiobutton__longdescription
+ ELEMENT cmp-adaptiveform-radiobutton__errormessage
+```
+
+### Note
+By placing the class names `cmp-adaptiveform-radiobutton__label` and `cmp-adaptiveform-radiobutton__questionmark` within the `cmp-adaptiveform-radiobutton__label-container` class, you create a logical grouping of the label and question mark elements. This approach simplifies the process of maintaining a consistent styling for both elements.
+
+## JavaScript Data Attribute Bindings
+
+The following attributes must be added for the initialization of the radio-button component in the form view:
+1. `data-cmp-is="adaptiveFormRadioButton"`
+2. `data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"`
+
+
+
+The following are optional attributes that can be added to the component in the form view:
+1. `data-cmp-valid` having a boolean value to indicate whether the field is currently valid or not
+2. `data-cmp-required` having a boolean value to indicate whether the field is currently required or not
+3. `data-cmp-readonly` having a boolean value to indicate whether the field is currently readonly or not
+4. `data-cmp-active` having a boolean value to indicate whether the field is currently active or not
+5. `data-cmp-visible` having a boolean value to indicate whether the field is currently visible or not
+6. `data-cmp-enabled` having a boolean value to indicate whether the field is currently enabled or not
+
+## Replace feature:
+We support replace feature that allows replacing Reset Button component to any of the below components:
+
+* Check Box Group
+* Drop down
+
+
+## Information
+* **Vendor**: Adobe
+* **Version**: v2
+* **Compatibility**: Cloud
+* **Status**: production-ready
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/radiobutton.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/radiobutton.html
new file mode 100644
index 0000000000..0c4e846a7a
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/radiobutton.html
@@ -0,0 +1,53 @@
+
+
+
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/radiobutton.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/radiobutton.js
new file mode 100644
index 0000000000..56b6a4e059
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/radiobutton.js
@@ -0,0 +1,36 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Copyright 2025 Adobe
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+use(function() {
+
+ var clientlibsArr = [ 'core.forms.components.base.v1.editor' ];
+ var labelPath = 'core/fd/components/af-commons/v1/fieldTemplates/label.html';
+ var shortDescriptionPath = "core/fd/components/af-commons/v1/fieldTemplates/shortDescription.html";
+ var longDescriptionPath = "core/fd/components/af-commons/v1/fieldTemplates/longDescription.html";
+ var questionMarkPath = "core/fd/components/af-commons/v1/fieldTemplates/questionMark.html"
+ var errorMessagePath = "core/fd/components/af-commons/v1/fieldTemplates/errorMessage.html";
+ var legendPath = "core/fd/components/af-commons/v1/fieldTemplates/legend.html"
+ return {
+ labelPath : labelPath,
+ shortDescriptionPath : shortDescriptionPath,
+ longDescriptionPath : longDescriptionPath,
+ questionMarkPath : questionMarkPath,
+ errorMessagePath : errorMessagePath,
+ legendPath : legendPath,
+ clientlibs : clientlibsArr
+ }
+});
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/widget.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/widget.html
new file mode 100644
index 0000000000..51e69eabf5
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v2/radiobutton/widget.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui.frontend/src/view/FormFieldBase.js b/ui.frontend/src/view/FormFieldBase.js
index 876441501a..6d117c14ca 100644
--- a/ui.frontend/src/view/FormFieldBase.js
+++ b/ui.frontend/src/view/FormFieldBase.js
@@ -166,8 +166,11 @@ class FormFieldBase extends FormField {
*/
#syncLabel() {
let labelElement = typeof this.getLabel === 'function' ? this.getLabel() : null;
- if (labelElement) {
+ if (labelElement && labelElement.tagName?.toUpperCase() === 'LABEL') {
labelElement.setAttribute('for', this.getWidgetId());
+ } else if (labelElement) {
+ //remove the 'for' attribute if it exists on non-label
+ labelElement.removeAttribute('for');
}
}
diff --git a/ui.tests/test-module/specs/customfunctions/radionbuttonv2.enum.enumName.cy.js b/ui.tests/test-module/specs/customfunctions/radionbuttonv2.enum.enumName.cy.js
new file mode 100644
index 0000000000..7e80d8fd76
--- /dev/null
+++ b/ui.tests/test-module/specs/customfunctions/radionbuttonv2.enum.enumName.cy.js
@@ -0,0 +1,204 @@
+/*
+ *
+ * ADOBE CONFIDENTIAL
+ * ___________________
+ *
+ * Copyright 2023 Adobe Systems Incorporated
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains
+ * the property of Adobe Systems Incorporated and its suppliers,
+ * if any. The intellectual and technical concepts contained
+ * herein are proprietary to Adobe Systems Incorporated and its
+ * suppliers and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe Systems Incorporated.
+ */
+
+describe('Test UpdateEnum, UpdateEnumName for RadioButton', () => {
+ const pagePath = "/content/forms/af/core-components-it/samples/customfunctions/populate-radiobuttonv2.html";
+ let formContainer = null;
+
+ let addEnumNameBtn1= '#button-4f38b76fd2-widget',
+ addEnumBtn1 = '#button-d4b00ec0b8-widget',
+ addBothBtn1 = '#button-eaa3f23f0b-widget',
+
+ addEnumNameBtn2 = '#button-56661f131d-widget',
+ addEnumBtn2 = '#button-0c6ee72db4-widget',
+ addBothBtn2 = '#button-69bf3d3a88-widget',
+
+ addEnumNameBtn3 = '#button-4ecaf3bc01-widget',
+ addEnumBtn3 = '#button-4dc9bdc9a3-widget',
+ addBothBtn3 = '#button-54180ffb16-widget',
+
+ addEnumNameBtn4 = '#button-a48e23295a-widget',
+ addEnumBtn4 = '#button-933aa82bb7-widget',
+ addBothBtn4 = '#button-26157ea292-widget',
+ clearBtn = '#button-3e6807207c-widget';
+
+ let radiobutton1 = '#radiobutton-9810c51fa5-widget',
+ radiobutton2 = '#radiobutton-7842f66371-widget',
+ radiobutton3 = '#radiobutton-073bbdd83c-widget',
+ radiobutton4 = '#radiobutton-6bc17edce1-widget';
+
+ let enums = ["one", "two", "three"],
+ enumNames = ["India", "US", "Singapore"];
+
+ /**
+ * initialization of form container before every test
+ * */
+ beforeEach(() => {
+ cy.previewForm(pagePath).then(p => {
+ formContainer = p;
+ })
+ });
+
+ describe('Radiobutton with no options', () => {
+ it('add enums', () => {
+ cy.get(addEnumBtn1).click().then(() => {
+ cy.get(radiobutton1).children().should('have.length', 3);
+ cy.get(radiobutton1).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(enums[index]);
+ })
+ })
+ });
+
+ it('add enums Names', () => {
+ cy.get(addEnumNameBtn1).click().then(() => {
+ cy.get(radiobutton1).children().should('have.length', 3);
+ cy.get(radiobutton1).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enumNames[index]);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ })
+ })
+ });
+
+ it('add both', () => {
+ cy.get(addBothBtn1).click().then(() => {
+ cy.get(radiobutton1).children().should('have.length', 3);
+ cy.get(radiobutton1).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ })
+ })
+ });
+ });
+
+ describe('length of current options = length of new enums, enumNames', () => {
+ it('add enums', () => {
+ cy.get(addEnumBtn2).click().then(() => {
+ cy.get(radiobutton2).children().should('have.length', 3);
+ cy.get(radiobutton2).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(`country${index + 1}`);
+ })
+ })
+ });
+
+ it('add enums Names', () => {
+ cy.get(addEnumNameBtn2).click().then(() => {
+ cy.get(radiobutton2).children().should('have.length', 3);
+ cy.get(radiobutton2).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(`${index + 1}`);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ })
+ })
+ });
+
+ it('add both', () => {
+ cy.get(addBothBtn2).click().then(() => {
+ cy.get(radiobutton2).children().should('have.length', 3);
+ cy.get(radiobutton2).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ })
+ })
+ });
+ });
+
+ describe('length of current options < length of new enums, enumNames', () => {
+ it('add enums', () => {
+ cy.get(addEnumBtn3).click().then(() => {
+ cy.get(radiobutton3).children().should('have.length', 3);
+ cy.get(radiobutton3).children().each((option, index) => {
+ if(index < 2) {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(`country${index + 1}`);
+ } else {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(enums[index]);
+ }
+ })
+ })
+ });
+
+ it('add enums Names', () => {
+ cy.get(addEnumNameBtn3).click().then(() => {
+ cy.get(radiobutton3).children().should('have.length', 2);
+ cy.get(radiobutton3).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(`${index + 1}`);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ })
+ })
+ });
+
+ it('add both', () => {
+ cy.get(addBothBtn3).click().then(() => {
+ cy.get(radiobutton3).children().should('have.length', 3);
+ cy.get(radiobutton3).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ })
+ })
+ });
+ });
+
+ describe('length of current options > length of new enums, enumNames', () => {
+ it('add enums', () => {
+ cy.get(addEnumBtn4).click().then(() => {
+ cy.get(radiobutton4).children().should('have.length', 3);
+ cy.get(radiobutton4).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(`country${index + 1}`);
+ })
+ })
+ });
+
+ it('add enums Names', () => {
+ cy.get(addEnumNameBtn4).click().then(() => {
+ cy.get(radiobutton4).children().should('have.length', 4);
+ cy.get(radiobutton4).children().each((option, index) => {
+ if(index < 3) {
+ expect(option.find('input').val()).to.be.eq(`${index + 1}`);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ } else {
+ expect(option.find('input').val()).to.be.eq(`${index + 1}`);
+ expect(option.find('span').text()).to.be.eq(`${index + 1}`);
+ }
+
+ })
+ })
+ });
+
+ it('add both', () => {
+ cy.get(addBothBtn4).click().then(() => {
+ cy.get(radiobutton4).children().should('have.length', 3);
+ cy.get(radiobutton4).children().each((option, index) => {
+ expect(option.find('input').val()).to.be.eq(enums[index]);
+ expect(option.find('span').text()).to.be.eq(enumNames[index]);
+ })
+ })
+ });
+
+ });
+
+ describe('Clear all RadioButton options', () => {
+ it('check clear', () => {
+ cy.get(clearBtn).click().then(() => {
+ cy.get(radiobutton4).children().should('have.length', 0); // only the blank option
+ })
+ });
+ });
+})
\ No newline at end of file
diff --git a/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js b/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js
index 27bb4ca228..25b45ce03f 100644
--- a/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js
+++ b/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js
@@ -15,7 +15,7 @@
******************************************************************************/
describe("Form with Radio Button Input", () => {
- const pagePath = "content/forms/af/core-components-it/samples/radiobutton/basic.html";
+ const pagePath = "content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/basic.html";
let formContainer = null;
const bemBlock = 'cmp-adaptiveform-radiobutton';
/**
@@ -207,7 +207,14 @@ describe("Form with Radio Button Input", () => {
cy.get(`#${radioButton9}`).find(".cmp-adaptiveform-radiobutton__option").should('have.length', 2);
cy.get(`#${radioButton9}`).find(".cmp-adaptiveform-radiobutton__label").contains('Select Animal').should('have.css', 'font-weight', '700');
cy.get(`#${radioButton9}`).find(".cmp-adaptiveform-radiobutton__option-label span").contains('Dog').should('have.css', 'font-style', 'italic');
- cy.get(`#${radioButton9}`).find(".cmp-adaptiveform-radiobutton__option-label span").contains('Cat').should('have.css', 'text-decoration', 'underline solid rgb(50, 50, 50)');
+ cy.get(`#${radioButton9}`)
+ .find(".cmp-adaptiveform-radiobutton__option-label span")
+ .contains('Cat')
+ .should(($el) => {
+ const line = $el.css('text-decoration-line');
+ const shorthand = $el.css('text-decoration');
+ expect(line || shorthand).to.include('underline');
+ });
});
it("decoration element should not have same class name", () => {
@@ -262,7 +269,7 @@ describe("Form with Radio Button Input", () => {
describe("setFocus on radiobutton via rules", () => {
- const pagePath = "content/forms/af/core-components-it/samples/radiobutton/focustest.html"
+ const pagePath = "content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/focustest.html"
let formContainer = null
beforeEach(() => {
@@ -283,7 +290,7 @@ describe("setFocus on radiobutton via rules", () => {
describe(" radiobutton repeatability ", () => {
- const pagePath = "content/forms/af/core-components-it/samples/radiobutton/radiorepeatability.html"
+ const pagePath = "content/forms/af/core-components-it/samples/radiobutton/radiobuttonv1/radiorepeatability.html"
let formContainer = null
beforeEach(() => {
@@ -352,7 +359,5 @@ describe(" radiobutton repeatability ", () => {
});
});
});
-
-
})
})
\ No newline at end of file
diff --git a/ui.tests/test-module/specs/radiobutton/radiobuttonv2.runtime.cy.js b/ui.tests/test-module/specs/radiobutton/radiobuttonv2.runtime.cy.js
new file mode 100644
index 0000000000..6fb1d5f51f
--- /dev/null
+++ b/ui.tests/test-module/specs/radiobutton/radiobuttonv2.runtime.cy.js
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright 2022 Adobe
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+describe("Form with Radio Button Input", () => {
+
+ const pagePath = "content/forms/af/core-components-it/samples/radiobutton/radiobuttonv2/basic.html";
+ let formContainer = null;
+ const bemBlock = 'cmp-adaptiveform-radiobutton';
+ /**
+ * initialization of form container before every test
+ * */
+ beforeEach(() => {
+ cy.previewForm(pagePath).then(p => {
+ formContainer = p;
+ })
+ });
+
+ const checkHTML = (id, state) => {
+ const visible = state.visible;
+ const passVisibleCheck = `${visible === true ? "" : "not."}be.visible`;
+ const passDisabledAttributeCheck = `${state.enabled === false || state.readOnly === true ? "" : "not."}have.attr`;
+ cy.get(`#${id}`)
+ .should(passVisibleCheck)
+ .invoke('attr', 'data-cmp-visible')
+ .should('eq', visible.toString());
+ cy.get(`#${id}`)
+ .invoke('attr', 'data-cmp-enabled')
+ .should('eq', state.enabled.toString());
+ return cy.get(`#${id}`).within((root) => {
+ cy.get('*').should(passVisibleCheck);
+ cy.get('input')
+ .should('have.length', 2);
+ cy.get('input')
+ .should(passDisabledAttributeCheck, 'disabled');
+ cy.get('input').eq(0).should('be.checked');
+ })
+ }
+
+ it("radiobutton should get model and view initialized properly", () => {
+ expect(formContainer, "formcontainer is initialized").to.not.be.null;
+ expect(formContainer._model.items.length, "model and view elements match").to.equal(Object.keys(formContainer._fields).length);
+ Object.entries(formContainer._fields).forEach(([id, field]) => {
+ expect(field.getId()).to.equal(id);
+ expect(formContainer._model.getElement(id), `model and view are in sync`).to.equal(field.getModel());
+ });
+ });
+
+ it("radiobutton model's changes are reflected in the html", () => {
+ const [id, fieldView] = Object.entries(formContainer._fields)[0];
+
+ // checking alignment of radio button in runtime
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__widget").should('have.class', 'VERTICAL');
+ const [id2, fieldView2] = Object.entries(formContainer._fields)[1];
+ cy.get(`#${id2}`).find(".cmp-adaptiveform-radiobutton__widget").should('have.class', 'HORIZONTAL');
+
+ // check model's change is reflected in HTML
+ const model = formContainer._model.getElement(id);
+ const val = Array('0','1');
+ model.value = '0';
+ checkHTML(model.id, model.getState()).then(() => {
+ model.visible = false;
+ return checkHTML(model.id, model.getState());
+ }).then(() => {
+ model.enable = false;
+ cy.get(`#${id2}`).find(".cmp-adaptiveform-radiobutton__option__widget").should('not.have.attr', 'aria-disabled');
+ return checkHTML(model.id, model.getState());
+ });
+ });
+
+ it("should have data-name attribute in parent div matching model name", () => {
+ const [radioButton1, radioButton1FieldView] = Object.entries(formContainer._fields)[0];
+ const modelName = radioButton1FieldView.getModel().name;
+ cy.get(`#${radioButton1}`).invoke('attr', 'data-name').should('eq', modelName);
+ });
+
+ it("should set proper name attribute for radio buttons", () => {
+ const [id, fieldView] = Object.entries(formContainer._fields)[0];
+ const model = formContainer._model.getElement(id);
+ const expectedName = `${id}_${model.name}`;
+
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__option__widget").each(($radio) => {
+ cy.wrap($radio).should('have.attr', 'name', expectedName);
+ });
+ });
+
+ it("radiobutton html changes are reflected in model", () => {
+ const [id, fieldView] = Object.entries(formContainer._fields)[1];
+ const model = formContainer._model.getElement(id);
+
+ // check the default value to be selected as 0
+ expect(model.getState().value).to.equal('0');
+
+ cy.get(`#${id}`).find("input").eq(1).click().then(x => {
+ expect(model.getState().value).to.equal('1');
+ });
+ cy.get(`#${id}`).find("input").eq(3).click().then(x => {
+ expect(model.getState().value).to.equal('3');
+ });
+ });
+
+ it("radiobutton should show error messages in the HTML", () => {
+ const [id, fieldView] = Object.entries(formContainer._fields)[0];
+ formContainer._model.validate();
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__errormessage").should('have.text',"This is a required radiobutton");
+ cy.get(`#${id}`).should('have.attr', 'data-cmp-valid', 'false')
+ cy.get(`#${id} > div.${bemBlock}__errormessage`).should('have.attr', 'id', `${id}__errormessage`);
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__widget").should('have.attr', 'aria-describedby', `${id}__errormessage`);
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__option__widget").should('have.attr', 'aria-invalid', 'true');
+
+ cy.get(`#${id}`).find("input").eq(1).click().then(x => {
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__errormessage").should('have.text',"");
+ cy.get(`#${id}`).should('have.attr', 'data-cmp-valid', 'true')
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__option__widget").should('have.attr', 'aria-invalid', 'false');
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__option__widget").should('not.have.attr', 'aria-checked');
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__widget").should('have.attr', 'aria-describedby', '');
+ });
+ });
+
+ it("Radio button should not have aria-disabled attribute if enable is false", () => {
+ const [id, fieldView] = Object.entries(formContainer._fields)[3];
+ cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__option__widget").should('not.have.attr', 'aria-disabled');
+ })
+
+ it("should toggle description and tooltip", () => {
+ cy.toggleDescriptionTooltip(bemBlock, 'tooltip_scenario_test');
+ })
+
+ it("should show and hide components on certain select", () => {
+ // Rule on radioButton1: When radioButton2 has Item 1 selected => Show radioButton3 and Hide radioButton4
+
+ const [radioButton1, radioButton1FieldView] = Object.entries(formContainer._fields)[0];
+ const [radioButton3, radioButton3FieldView] = Object.entries(formContainer._fields)[2];
+ const [radioButton4, radioButton4FieldView] = Object.entries(formContainer._fields)[3];
+
+ cy.get(`#${radioButton1}`).find("input").first().check().blur().then(x => {
+ cy.get(`#${radioButton3}`).should('be.visible')
+ cy.get(`#${radioButton4}`).should('not.be.visible')
+ })
+ })
+
+ it("should enable and disable components on certain select", () => {
+ // Rule on radioButton1: When radioButton2 has Item 2 selected => Enable radioButton4 and Disable radioButton2
+
+ const [radioButton1, radioButton1FieldView] = Object.entries(formContainer._fields)[0];
+ const [radioButton2, radioButton2FieldView] = Object.entries(formContainer._fields)[1];
+ const [radioButton4, radioButton4FieldView] = Object.entries(formContainer._fields)[3];
+
+ cy.get(`#${radioButton1}`).find("input").check("1").blur().then(x => {
+ cy.get(`#${radioButton4}`).find("input").should('be.enabled')
+ cy.get(`#${radioButton2}`).find("input").should('not.be.enabled')
+ })
+ })
+
+ it("should show validation error messages based on expression rule", () => {
+ // Rule on radioButton6: Validate radioButton6 using Expression: radioButton6 === radioButton5
+
+ const [radioButton5, radioButton5FieldView] = Object.entries(formContainer._fields)[4];
+ const [radioButton6, radioButton6FieldView] = Object.entries(formContainer._fields)[5];
+
+ cy.get(`#${radioButton5}`).find("input").check(["1"]).then(x => {
+ cy.get(`#${radioButton6}`).find("input").check(["0"])
+ cy.get(`#${radioButton6}`).find(".cmp-adaptiveform-radiobutton__errormessage").should('have.text', "Please enter a valid value.")
+
+ cy.get(`#${radioButton6}`).find("input").check(["1"])
+ cy.get(`#${radioButton6}`).find(".cmp-adaptiveform-radiobutton__errormessage").should('have.text', "")
+ })
+ })
+
+ it("should set and clear value based on rules", () => {
+ // Rule on radioButton4: When input has Item1 selected, set value of radioButton6 to "Item 2" and clear value of radioButton1
+
+ const [radioButton1, radioButton1FieldView] = Object.entries(formContainer._fields)[0];
+ const [radioButton6, radioButton6FieldView] = Object.entries(formContainer._fields)[5];
+ const [radioButton4, radioButton4FieldView] = Object.entries(formContainer._fields)[3];
+
+ cy.get(`#${radioButton1}`).find("input").check("1")
+ cy.get(`#${radioButton4}`).find("input").check("0").blur().then(x => {
+ cy.get(`#${radioButton6}`).find("input").should('be.checked')
+ cy.get(`#${radioButton1}`).find("input").should('not.be.checked')
+ })
+ })
+
+ it("should update enum values on providing duplicate enums", () => {
+
+ const [radioButton7, radioButton7FieldView] = Object.entries(formContainer._fields)[6];
+ cy.get(`#${radioButton7}`).find(".cmp-adaptiveform-radiobutton__option").should('have.length', 2);
+ cy.get(`#${radioButton7}`).find(".cmp-adaptiveform-radiobutton__option-label").contains('Item 3');
+ cy.get(`#${radioButton7}`).find(".cmp-adaptiveform-radiobutton__option-label").contains('Item 2');
+ cy.get(`#${radioButton7}`).find(".cmp-adaptiveform-radiobutton__option-label").contains('Item 1').should('not.exist');
+
+ })
+
+ it("rich text should render correctly", () => {
+ const [radioButton9, radioButton9FieldView] = Object.entries(formContainer._fields)[8];
+ cy.get(`#${radioButton9}`).find(".cmp-adaptiveform-radiobutton__option").should('have.length', 2);
+ cy.get(`#${radioButton9}`).find(".cmp-adaptiveform-radiobutton__label").contains('Select Animal').should('have.css', 'font-weight', '700');
+ cy.get(`#${radioButton9}`).find(".cmp-adaptiveform-radiobutton__option-label span").contains('Dog').should('have.css', 'font-style', 'italic');
+ cy.get(`#${radioButton9}`)
+ .find(".cmp-adaptiveform-radiobutton__option-label span")
+ .contains('Cat')
+ .should(($el) => {
+ const line = $el.css('text-decoration-line');
+ const shorthand = $el.css('text-decoration');
+ expect(line || shorthand).to.include('underline');
+ });
+ });
+
+ it("decoration element should not have same class name", () => {
+ expect(formContainer, "formcontainer is initialized").to.not.be.null;
+ cy.wrap().then(() => {
+ const id = formContainer._model._children[0].id;
+ cy.get(`#${id}`).parent().should("not.have.class", bemBlock);
+ })
+ })
+
+ it("should add filled/empty class at container div", () => {
+ const [radioButton1, radioButton1FieldView] = Object.entries(formContainer._fields)[0];
+ cy.get(`#${radioButton1}`).should('have.class', 'cmp-adaptiveform-radiobutton--empty');
+ cy.get(`#${radioButton1}`).invoke('attr', 'data-cmp-required').should('eq', 'true');
+ cy.get(`#${radioButton1}`).invoke('attr', 'data-cmp-readonly').should('eq', 'false');
+ cy.get(`#${radioButton1}`).find("input").check("1").blur().then(x => {
+ cy.get(`#${radioButton1}`).should('have.class', 'cmp-adaptiveform-radiobutton--filled');
+ })
+ })
+
+ it("radiobutton with boolean type selection should happen in first click", () => {
+ const [radioButton8, radioButton1FieldView] = Object.entries(formContainer._fields)[7];
+ cy.get(`#${radioButton8}`).find("input").check("true").then(() => {
+ cy.get(`#${radioButton8}`).find('input[value="true"]').should("be.checked");
+ })
+
+ cy.get(`#${radioButton8}`).find("input").check("false").then(() => {
+ cy.get(`#${radioButton8}`).find('input[value="false"]').should("be.checked");
+ })
+ })
+
+ it("test if required property updated in model is reflected in view", () => {
+ const [id, radioButtonView] = Object.entries(formContainer._fields)[7];
+ cy.get(`#${id}`).invoke('attr', 'data-cmp-required').should('eq', 'false').then(() => {
+ radioButtonView._model.required = true;
+ })
+ cy.get(`#${id}`).invoke('attr', 'data-cmp-required').should('eq', 'true');
+ })
+
+ it("reset of radiobutton resulting in invalidation", () => {
+ expect(formContainer, "formcontainer is initialized").to.not.be.null;
+ const [radioButton1, radioButton1FieldView] = Object.entries(formContainer._fields)[0];
+ const [resetButton, resetButtonFieldView] = Object.entries(formContainer._fields)[9];
+
+ cy.get(`#${radioButton1}`).find("input").check("1");
+ cy.get(`#${resetButton} button`).click().then(() => {
+ cy.get(`#${radioButton1}`).find("input[value='1']").should('not.be.checked');
+ cy.get(`#${radioButton1}`).invoke('attr', 'data-cmp-valid').should('not.exist');
+ })
+ })
+
+ it("radio button group MUST be wrapped in a