Skip to content

Commit 73c1257

Browse files
authored
Merge pull request #5646 from Countly/QT-234v2
[QT-234] Fix Widget demo page click Agree checkbox fail
2 parents b389b02 + d14af5f commit 73c1257

File tree

4 files changed

+247
-96
lines changed

4 files changed

+247
-96
lines changed

ui-tests/cypress/e2e/dashboard/feedback/ratings/widgets.cy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Create New Widget', () => {
1616
navigationHelpers.goToFeedbackRatingsWidgetsPage();
1717
});
1818

19-
it.skip('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");
@@ -222,7 +222,7 @@ describe('Create New Widget', () => {
222222
contactViaCheckboxLabelText: widget.contactViaCheckboxLabelText,
223223
contactEmail: widgetRate.contactEmail,
224224
submitButtonText: widget.submitButtonText,
225-
hasAggrementCheckbox: true,
225+
consentText: 'I agree to the Terms and Conditions and Privacy Policy.',
226226
selectedMainColor: widget.mainColor,
227227
selectedFontColor: widget.FontColor,
228228
hasPoweredByLogo: true,

ui-tests/cypress/lib/dashboard/feedback/ratings/demoWidgetPage.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const demoPageElements = {
1616
CONTACT_VIA_CHECKBOX: '#countly-feedback-show-email',
1717
CONTACT_VIA_LABEL: '#cf-email-text',
1818
CONTACT_VIA_INPUT: '#countly-feedback-contact-me-email',
19+
CONSENT: '#consent',
1920
SUBMIT_BUTTON: '#cf-submit-button',
2021
LOGO_IMAGE: '#powered-by-countly',
2122
SUCCESS_ICON: '#thanks-area-logo',
@@ -54,7 +55,7 @@ const verifyDemoPageElementsAndRate = ({
5455
submitButtonText,
5556
submitButtonColor,
5657
submitButtonFontColor,
57-
hasAggrementCheckbox = false,
58+
consentText = null,
5859
hasPoweredByLogo = true,
5960
thankYouMessageText,
6061
successIconColor
@@ -133,8 +134,8 @@ const verifyDemoPageElementsAndRate = ({
133134
cy.shouldNotExist(demoPageElements.LOGO_IMAGE);
134135
}
135136

136-
if (hasAggrementCheckbox) {
137-
cy.contains('label', 'I agree to the terms and conditions and privacy policy')
137+
if (consentText != null) {
138+
cy.getElement(demoPageElements.CONSENT)
138139
.find('input[type="checkbox"]')
139140
.click();
140141
}

0 commit comments

Comments
 (0)