Skip to content

Commit

Permalink
Merge pull request #5646 from Countly/QT-234v2
Browse files Browse the repository at this point in the history
[QT-234] Fix Widget demo page click Agree checkbox fail
  • Loading branch information
can-angun authored Oct 7, 2024
2 parents b389b02 + d14af5f commit 73c1257
Show file tree
Hide file tree
Showing 4 changed files with 247 additions and 96 deletions.
4 changes: 2 additions & 2 deletions ui-tests/cypress/e2e/dashboard/feedback/ratings/widgets.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Create New Widget', () => {
navigationHelpers.goToFeedbackRatingsWidgetsPage();
});

it.skip('Verify default values of page and create a widget with that values and then update the widget data', function() {
it('Verify default values of page and create a widget with that values and then update the widget data', function() {
widgetsHelpers.clickAddNewWidgetButton();
widgetsHelpers.verifySettingsPageDefaultElements();
widgetsHelpers.typeWidgetName("My New Widget");
Expand Down Expand Up @@ -222,7 +222,7 @@ describe('Create New Widget', () => {
contactViaCheckboxLabelText: widget.contactViaCheckboxLabelText,
contactEmail: widgetRate.contactEmail,
submitButtonText: widget.submitButtonText,
hasAggrementCheckbox: true,
consentText: 'I agree to the Terms and Conditions and Privacy Policy.',
selectedMainColor: widget.mainColor,
selectedFontColor: widget.FontColor,
hasPoweredByLogo: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const demoPageElements = {
CONTACT_VIA_CHECKBOX: '#countly-feedback-show-email',
CONTACT_VIA_LABEL: '#cf-email-text',
CONTACT_VIA_INPUT: '#countly-feedback-contact-me-email',
CONSENT: '#consent',
SUBMIT_BUTTON: '#cf-submit-button',
LOGO_IMAGE: '#powered-by-countly',
SUCCESS_ICON: '#thanks-area-logo',
Expand Down Expand Up @@ -54,7 +55,7 @@ const verifyDemoPageElementsAndRate = ({
submitButtonText,
submitButtonColor,
submitButtonFontColor,
hasAggrementCheckbox = false,
consentText = null,
hasPoweredByLogo = true,
thankYouMessageText,
successIconColor
Expand Down Expand Up @@ -133,8 +134,8 @@ const verifyDemoPageElementsAndRate = ({
cy.shouldNotExist(demoPageElements.LOGO_IMAGE);
}

if (hasAggrementCheckbox) {
cy.contains('label', 'I agree to the terms and conditions and privacy policy')
if (consentText != null) {
cy.getElement(demoPageElements.CONSENT)
.find('input[type="checkbox"]')
.click();
}
Expand Down
Loading

0 comments on commit 73c1257

Please sign in to comment.