@@ -10,13 +10,13 @@ const { RATING_SYMBOLS } = require('../../../../support/constants');
1010const helper = require ( '../../../../support/helper' ) ;
1111
1212describe ( 'Create New Widget' , ( ) => {
13- beforeEach ( function ( ) {
13+ beforeEach ( function ( ) {
1414 navigationHelpers . goToLoginPage ( ) ;
1515 loginHelpers . login ( user . username , user . password ) ;
1616 navigationHelpers . goToFeedbackRatingsWidgetsPage ( ) ;
1717 } ) ;
1818
19- it ( 'Verify default values of page and create a widget with that values and then update the widget data' , function ( ) {
19+ it ( 'Verify default values of page and create a widget with that values and then update the widget data' , function ( ) {
2020 widgetsHelpers . clickAddNewWidgetButton ( ) ;
2121 widgetsHelpers . verifySettingsPageDefaultElements ( ) ;
2222 widgetsHelpers . typeWidgetName ( "My New Widget" ) ;
@@ -141,6 +141,7 @@ describe('Create New Widget', () => {
141141 widgetsHelpers . typeAddCommentCheckboxLabelText ( widget . addCommentCheckboxLabelText ) ;
142142 widgetsHelpers . clickContactViaCheckbox ( ) ;
143143 widgetsHelpers . typeContactViaCheckboxLabelText ( widget . contactViaCheckboxLabelText ) ;
144+ widgetsHelpers . clickAddUserConsentCheckbox ( ) ;
144145 widgetsHelpers . typeButtonCallOut ( widget . buttonCallOut ) ;
145146 widgetsHelpers . typeThanksMessage ( widget . thanksMessage ) ;
146147 widgetsHelpers . clickNextStepButton ( ) ;
@@ -166,6 +167,8 @@ describe('Create New Widget', () => {
166167 commentCheckboxLabelText : widget . comment ,
167168 isCheckedViaContact : true ,
168169 viaContactCheckboxLabelText : widget . contactVia ,
170+ isCheckedAddConsent : true ,
171+ consentText : "I agree to the Terms and Conditions and Privacy Policy." ,
169172 submitButtonText : widget . buttonCallOut ,
170173 submitButtonColor : widget . mainColor ,
171174 submitButtonFontColor : widget . FontColor ,
@@ -186,7 +189,7 @@ describe('Create New Widget', () => {
186189
187190 widgetsHelpers . clickNextStepButton ( ) ,
188191
189- widgetsHelpers . clickShowOnlyCheckbox ( ) ;
192+ widgetsHelpers . clickShowOnlyCheckbox ( ) ;
190193 widgetsHelpers . typeShowOnlyPages ( ...[ '/homepage' , '/shopping' , '/checkout' ] ) ;
191194
192195 widgetsHelpers . clickSaveButton ( ) ;
@@ -270,11 +273,11 @@ describe('Create New Widget', () => {
270273 } ) ;
271274 } ) ;
272275
273- it ( 'Create a widget with updated text then stop the widget from details page' , function ( ) {
276+ it ( 'Create a widget with updated text then stop the widget from details page' , function ( ) {
274277 const widget = generateWidgetFixture ( ) ;
275278
276279 widgetsHelpers . clickAddNewWidgetButton ( ) ,
277- widgetsHelpers . typeWidgetName ( widget . widgetName ) ;
280+ widgetsHelpers . typeWidgetName ( widget . widgetName ) ;
278281 widgetsHelpers . typeQuestion ( widget . question ) ;
279282 widgetsHelpers . typeEmojiOneText ( widget . emojiOneText ) ;
280283 widgetsHelpers . typeEmojiTwoText ( widget . emojiTwoText ) ;
@@ -285,6 +288,12 @@ describe('Create New Widget', () => {
285288 widgetsHelpers . typeAddCommentCheckboxLabelText ( widget . addCommentCheckboxLabelText ) ;
286289 widgetsHelpers . clickContactViaCheckbox ( ) ;
287290 widgetsHelpers . typeContactViaCheckboxLabelText ( widget . contactViaCheckboxLabelText ) ;
291+ widgetsHelpers . clickAddUserConsentCheckbox ( ) ;
292+ widgetsHelpers . typeAddUserConsentText ( widget . consentText ) ;
293+ widgetsHelpers . typeAddUserConsentLinkText ( 0 , widget . firstConsentLinkText ) ;
294+ widgetsHelpers . typeAddUserConsentLinkUrl ( 0 , widget . firstConsentLinkUrl ) ;
295+ widgetsHelpers . typeAddUserConsentLinkText ( 1 , widget . secondConsentLinkText ) ;
296+ widgetsHelpers . typeAddUserConsentLinkUrl ( 1 , widget . secondConsentLinkUrl ) ;
288297 widgetsHelpers . typeButtonCallOut ( widget . buttonCallOut ) ;
289298 widgetsHelpers . typeThanksMessage ( widget . thanksMessage ) ;
290299 widgetsHelpers . clickNextStepButton ( ) ;
@@ -310,6 +319,8 @@ describe('Create New Widget', () => {
310319 commentCheckboxLabelText : widget . comment ,
311320 isCheckedViaContact : true ,
312321 viaContactCheckboxLabelText : widget . contactVia ,
322+ isCheckedAddConsent : true ,
323+ consentText : widget . consentText ,
313324 submitButtonText : widget . buttonCallOut ,
314325 submitButtonColor : widget . mainColor ,
315326 submitButtonFontColor : widget . FontColor ,
@@ -330,7 +341,7 @@ describe('Create New Widget', () => {
330341
331342 widgetsHelpers . clickNextStepButton ( ) ,
332343
333- widgetsHelpers . clickShowOnlyCheckbox ( ) ;
344+ widgetsHelpers . clickShowOnlyCheckbox ( ) ;
334345 widgetsHelpers . typeShowOnlyPages ( ...[ '/homepage' , '/shopping' , '/checkout' ] ) ;
335346
336347 widgetsHelpers . clickSaveButton ( ) ;
@@ -363,6 +374,7 @@ describe('Create New Widget', () => {
363374 contactViaCheckboxLabelText : widget . contactViaCheckboxLabelText ,
364375 contactEmail : widgetRate . contactEmail ,
365376 submitButtonText : widget . submitButtonText ,
377+ consentText : widget . consentText ,
366378 selectedMainColor : widget . mainColor ,
367379 selectedFontColor : widget . FontColor ,
368380 hasPoweredByLogo : true ,
@@ -400,13 +412,12 @@ describe('Create New Widget', () => {
400412 index : 0 ,
401413 question : widget . question ,
402414 internalName : widget . widgetName ,
403- //There is still an issue TODO
404- //pages: "/homepage, /shopping, /checkout",
415+ pages : "/homepage, /shopping, /checkout" ,
405416 isActive : false
406417 } ) ;
407418 } ) ;
408419
409- it ( 'Verify next step button activation, the entered data exist when returning to the previous pages and creating a passive widget and deleting the widget' , function ( ) {
420+ it ( 'Verify next step button activation, the entered data exist when returning to the previous pages and creating a passive widget and deleting the widget' , function ( ) {
410421 const widget = generateWidgetFixture ( ) ;
411422
412423 widgetsHelpers . clickAddNewWidgetButton ( ) ;
@@ -429,6 +440,12 @@ describe('Create New Widget', () => {
429440 widgetsHelpers . typeAddCommentCheckboxLabelText ( widget . addCommentCheckboxLabelText ) ;
430441 widgetsHelpers . clickContactViaCheckbox ( ) ;
431442 widgetsHelpers . typeContactViaCheckboxLabelText ( widget . contactViaCheckboxLabelText ) ;
443+ widgetsHelpers . clickAddUserConsentCheckbox ( ) ;
444+ widgetsHelpers . typeAddUserConsentText ( widget . consentText ) ;
445+ widgetsHelpers . typeAddUserConsentLinkText ( 0 , widget . firstConsentLinkText ) ;
446+ widgetsHelpers . typeAddUserConsentLinkUrl ( 0 , widget . firstConsentLinkUrl ) ;
447+ widgetsHelpers . typeAddUserConsentLinkText ( 1 , widget . secondConsentLinkText ) ;
448+ widgetsHelpers . typeAddUserConsentLinkUrl ( 1 , widget . secondConsentLinkUrl ) ;
432449 widgetsHelpers . typeButtonCallOut ( widget . buttonCallOut ) ;
433450 widgetsHelpers . clickNextStepButton ( ) ;
434451
@@ -458,6 +475,17 @@ describe('Create New Widget', () => {
458475 addCommentCheckboxLabelText : widget . addCommentCheckboxLabelText ,
459476 isCheckedViaContact : true ,
460477 contactViaCheckboxLabelText : widget . contactViaCheckboxLabelText ,
478+ consentText : widget . consentText ,
479+ consentItems : [
480+ {
481+ text : widget . firstConsentLinkText ,
482+ link : widget . firstConsentLinkUrl
483+ } ,
484+ {
485+ text : widget . secondConsentLinkText ,
486+ link : widget . secondConsentLinkUrl
487+ }
488+ ] ,
461489 submitButtonText : widget . buttonCallOut ,
462490 thanksMessageText : widget . thanksMessage ,
463491 } ) ;
@@ -505,7 +533,7 @@ describe('Create New Widget', () => {
505533 widgetsHelpers . shouldBeWidgetDeleted ( widget . question ) ;
506534 } ) ;
507535
508- it ( 'Verify widget details comment and rating tab data' , function ( ) {
536+ it ( 'Verify widget details comment and rating tab data' , function ( ) {
509537 widgetsHelpers . clickAddNewWidgetButton ( ) ;
510538 const widget = generateWidgetFixture ( ) ;
511539
0 commit comments