@@ -78,7 +78,7 @@ describe('Page - Authoring', function () {
78
78
getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton__option' ) . should ( 'have.length' , 2 ) ;
79
79
80
80
cy . deleteComponentByPath ( radioButtonDrop ) ;
81
- }
81
+ } ;
82
82
83
83
context ( 'Open Forms Editor' , function ( ) {
84
84
const pagePath = "/content/forms/af/core-components-it/blank" ,
@@ -91,58 +91,65 @@ describe('Page - Authoring', function () {
91
91
} ) ;
92
92
93
93
it ( 'insert radio button in form container' , function ( ) {
94
- dropRadioButtonInGuideContainer ( ) ;
95
- cy . deleteComponentByPath ( radioButtonDrop ) ;
94
+ cy . cleanTest ( radioButtonDrop ) . then ( function ( ) {
95
+ dropRadioButtonInGuideContainer ( ) ;
96
+ cy . deleteComponentByPath ( radioButtonDrop ) ;
97
+ } ) ;
96
98
} ) ;
97
99
98
100
it ( 'open edit dialog of Radio Button' , function ( ) {
99
- testRadioButtonBehaviour ( radioButtonEditPathSelector , radioButtonDrop ) ;
101
+ cy . cleanTest ( radioButtonDrop ) . then ( function ( ) {
102
+ testRadioButtonBehaviour ( radioButtonEditPathSelector , radioButtonDrop ) ;
103
+ } ) ;
100
104
} ) ;
101
105
102
106
it ( 'check value type validations' , function ( ) {
103
-
104
- // For Number Type
105
- dropRadioButtonInGuideContainer ( ) ;
106
- cy . openEditableToolbar ( sitesSelectors . overlays . overlay . component + radioButtonEditPathSelector ) ;
107
- cy . invokeEditableAction ( "[data-action='CONFIGURE']" ) ;
108
- cy . get ( '.cmp-adaptiveform-radiobutton__type' ) . click ( ) ;
109
- cy . get ( "coral-selectlist-item-content" ) . contains ( 'Number' ) . should ( 'be.visible' ) . click ( { force : true } ) ;
110
- cy . get ( ".cmp-adaptiveform-radiobutton__value" ) . invoke ( 'val' , 'Not a Number' ) ;
111
- cy . get ( '.cq-dialog-submit' ) . click ( ) ;
112
- cy . get ( '.coral-Form-errorlabel' ) . should ( 'contain.text' , 'Value Type Mismatch' ) ;
113
-
114
- cy . get ( '.cq-dialog-cancel' ) . click ( ) ;
115
- cy . deleteComponentByPath ( radioButtonDrop ) ;
116
-
117
- // For Boolean
118
- dropRadioButtonInGuideContainer ( ) ;
119
- cy . openEditableToolbar ( sitesSelectors . overlays . overlay . component + radioButtonEditPathSelector ) ;
120
- cy . invokeEditableAction ( "[data-action='CONFIGURE']" ) ;
121
- cy . get ( '.cmp-adaptiveform-radiobutton__type' ) . click ( ) ;
122
- cy . get ( "coral-selectlist-item-content" ) . contains ( 'Boolean' ) . should ( 'be.visible' ) . click ( { force : true } ) ;
123
- cy . get ( ".cmp-adaptiveform-radiobutton__value" ) . invoke ( 'val' , 'Not a Boolean' ) ;
124
- cy . get ( '.cq-dialog-submit' ) . click ( ) ;
125
- cy . get ( '.coral-Form-errorlabel' ) . should ( 'contain.text' , 'Value Type Mismatch' ) ;
126
-
127
- cy . get ( '.cq-dialog-cancel' ) . click ( ) ;
128
- cy . deleteComponentByPath ( radioButtonDrop ) ;
107
+ cy . cleanTest ( radioButtonDrop ) . then ( function ( ) {
108
+ // For Number Type
109
+ dropRadioButtonInGuideContainer ( ) ;
110
+ cy . openEditableToolbar ( sitesSelectors . overlays . overlay . component + radioButtonEditPathSelector ) ;
111
+ cy . invokeEditableAction ( "[data-action='CONFIGURE']" ) ;
112
+ cy . get ( '.cmp-adaptiveform-radiobutton__type' ) . click ( ) ;
113
+ cy . get ( "coral-selectlist-item-content" ) . contains ( 'Number' ) . should ( 'be.visible' ) . click ( { force : true } ) ;
114
+ cy . get ( ".cmp-adaptiveform-radiobutton__value" ) . invoke ( 'val' , 'Not a Number' ) ;
115
+ cy . get ( '.cq-dialog-submit' ) . click ( ) ;
116
+ cy . get ( '.coral-Form-errorlabel' ) . should ( 'contain.text' , 'Value Type Mismatch' ) ;
117
+
118
+ cy . get ( '.cq-dialog-cancel' ) . click ( ) ;
119
+ cy . deleteComponentByPath ( radioButtonDrop ) ;
120
+
121
+ // For Boolean
122
+ dropRadioButtonInGuideContainer ( ) ;
123
+ cy . openEditableToolbar ( sitesSelectors . overlays . overlay . component + radioButtonEditPathSelector ) ;
124
+ cy . invokeEditableAction ( "[data-action='CONFIGURE']" ) ;
125
+ cy . get ( '.cmp-adaptiveform-radiobutton__type' ) . click ( ) ;
126
+ cy . get ( "coral-selectlist-item-content" ) . contains ( 'Boolean' ) . should ( 'be.visible' ) . click ( { force : true } ) ;
127
+ cy . get ( ".cmp-adaptiveform-radiobutton__value" ) . invoke ( 'val' , 'Not a Boolean' ) ;
128
+ cy . get ( '.cq-dialog-submit' ) . click ( ) ;
129
+ cy . get ( '.coral-Form-errorlabel' ) . should ( 'contain.text' , 'Value Type Mismatch' ) ;
130
+
131
+ cy . get ( '.cq-dialog-cancel' ) . click ( ) ;
132
+ cy . deleteComponentByPath ( radioButtonDrop ) ;
133
+ } ) ;
129
134
} )
130
135
131
136
it ( 'check for duplicate enum values' , function ( ) {
132
- dropRadioButtonInGuideContainer ( ) ;
133
- cy . openEditableToolbar ( sitesSelectors . overlays . overlay . component + radioButtonEditPathSelector ) ;
134
- cy . invokeEditableAction ( "[data-action='CONFIGURE']" ) ;
135
- cy . get ( "[data-granite-coral-multifield-name='./enum'] coral-button-label:contains('Add')" ) . should ( "exist" ) . click ( { force : true } ) ;
136
- cy . get ( 'input[name="./enum"]' ) . last ( ) . invoke ( 'val' , '0' ) ;
137
- cy . get ( 'input[name="./enumNames"]' ) . last ( ) . invoke ( 'val' , 'Item 3' ) ;
138
- cy . get ( '.cq-dialog-submit' ) . click ( ) . then ( ( ) => {
139
- cy . get ( '.cq-dialog-submit' ) . should ( 'not.exist' )
140
- } ) ;
141
- getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton__option' ) . should ( 'have.length' , 2 ) ;
142
- getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton' ) . parent ( ) . contains ( 'Item 3' ) ;
143
- getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton' ) . parent ( ) . contains ( 'Item 2' ) ;
144
- getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton' ) . parent ( ) . contains ( 'Item 1' ) . should ( 'not.exist' ) ;
145
- cy . deleteComponentByPath ( radioButtonDrop ) ;
137
+ cy . cleanTest ( radioButtonDrop ) . then ( function ( ) {
138
+ dropRadioButtonInGuideContainer ( ) ;
139
+ cy . openEditableToolbar ( sitesSelectors . overlays . overlay . component + radioButtonEditPathSelector ) ;
140
+ cy . invokeEditableAction ( "[data-action='CONFIGURE']" ) ;
141
+ cy . get ( "[data-granite-coral-multifield-name='./enum'] coral-button-label:contains('Add')" ) . should ( "exist" ) . click ( { force : true } ) ;
142
+ cy . get ( 'input[name="./enum"]' ) . last ( ) . invoke ( 'val' , '0' ) ;
143
+ cy . get ( 'input[name="./enumNames"]' ) . last ( ) . invoke ( 'val' , 'Item 3' ) ;
144
+ cy . get ( '.cq-dialog-submit' ) . click ( ) . then ( ( ) => {
145
+ cy . get ( '.cq-dialog-submit' ) . should ( 'not.exist' )
146
+ } ) ;
147
+ getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton__option' ) . should ( 'have.length' , 2 ) ;
148
+ getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton' ) . parent ( ) . contains ( 'Item 3' ) ;
149
+ getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton' ) . parent ( ) . contains ( 'Item 2' ) ;
150
+ getPreviewIframeBody ( ) . find ( '.cmp-adaptiveform-radiobutton' ) . parent ( ) . contains ( 'Item 1' ) . should ( 'not.exist' ) ;
151
+ cy . deleteComponentByPath ( radioButtonDrop ) ;
152
+ } )
146
153
147
154
} )
148
155
} )
0 commit comments