diff --git a/cypress/integration/User.SettingNotifications.feature b/cypress/integration/User.SettingNotifications.feature new file mode 100644 index 000000000..7e4301b81 --- /dev/null +++ b/cypress/integration/User.SettingNotifications.feature @@ -0,0 +1,20 @@ +Feature: User sets donations info settings + As a user + I want to change my notifications settings + In order to manage the notifications + + Background: + Given the following "users" are in the database: + | email | password | id | name | slug | termsAndConditionsAgreedVersion | + | peterpan@example.org | 123 | id-of-peter-pan | Peter Pan | peter-pan | 0.0.4 | + | user@example.org | 123 | user | User | user | 0.0.4 | + And I am logged in as "peter-pan" + + Scenario: The notifications setting "Send e-mail notifications" is set to true by default and can be set to false + # When I navigate to my "Notifications" settings page + When I navigate to page "/settings/notifications" + Then the checkbox with ID "send-email" should "be.checked" + And I click on element with ID "send-email" + And the checkbox with ID "send-email" should "not.be.checked" + Then I click save + And I see a toaster with "Notifications settings saved!" diff --git a/cypress/integration/User.SettingNotifications/I_click_on_element_with_ID_{string}.js b/cypress/integration/User.SettingNotifications/I_click_on_element_with_ID_{string}.js new file mode 100644 index 000000000..251c38941 --- /dev/null +++ b/cypress/integration/User.SettingNotifications/I_click_on_element_with_ID_{string}.js @@ -0,0 +1,5 @@ +import { When } from "cypress-cucumber-preprocessor/steps"; + +When("I click on element with ID {string}", (id) => { + cy.get('#' + id).click() +}) diff --git a/cypress/integration/User.SettingNotifications/I_click_save.js b/cypress/integration/User.SettingNotifications/I_click_save.js new file mode 100644 index 000000000..32d702f1e --- /dev/null +++ b/cypress/integration/User.SettingNotifications/I_click_save.js @@ -0,0 +1,5 @@ +import { Then } from "cypress-cucumber-preprocessor/steps"; + +Then("I click save", () => { + cy.get(".save-button").click() +}) \ No newline at end of file diff --git a/cypress/integration/User.SettingNotifications/I_click_the_checkbox_show_donations_progress_bar_and_save.js b/cypress/integration/User.SettingNotifications/I_click_the_checkbox_show_donations_progress_bar_and_save.js new file mode 100644 index 000000000..b4289dd5e --- /dev/null +++ b/cypress/integration/User.SettingNotifications/I_click_the_checkbox_show_donations_progress_bar_and_save.js @@ -0,0 +1,6 @@ +import { Then } from "cypress-cucumber-preprocessor/steps"; + +Then("I click the checkbox show donations progress bar and save", () => { + cy.get("#showDonations").click() + cy.get(".donations-info-button").click() +}) \ No newline at end of file diff --git a/cypress/integration/UserProfile.ChangePassword/I_submit_the_form copy.js b/cypress/integration/UserProfile.ChangePassword/I_submit_the_form.js similarity index 100% rename from cypress/integration/UserProfile.ChangePassword/I_submit_the_form copy.js rename to cypress/integration/UserProfile.ChangePassword/I_submit_the_form.js diff --git a/cypress/integration/UserProfile.ChangePassword/I_see_a_{string}_message.js b/cypress/integration/common/I_see_a_{string}_message.js similarity index 61% rename from cypress/integration/UserProfile.ChangePassword/I_see_a_{string}_message.js rename to cypress/integration/common/I_see_a_{string}_message.js index 90ddf0bd3..6cc2cbf6b 100644 --- a/cypress/integration/UserProfile.ChangePassword/I_see_a_{string}_message.js +++ b/cypress/integration/common/I_see_a_{string}_message.js @@ -1,5 +1,5 @@ import { Then } from "cypress-cucumber-preprocessor/steps"; -Then("I see a {string} message:", (type, message) => { +Then("I see a {string} message:", (_type, message) => { cy.contains(message); }); \ No newline at end of file diff --git a/cypress/integration/common/the_checkbox_with_ID_{string}_should_{string}.js b/cypress/integration/common/the_checkbox_with_ID_{string}_should_{string}.js new file mode 100644 index 000000000..ad3f7f3cc --- /dev/null +++ b/cypress/integration/common/the_checkbox_with_ID_{string}_should_{string}.js @@ -0,0 +1,5 @@ +import { When } from "cypress-cucumber-preprocessor/steps"; + +When("the checkbox with ID {string} should {string}", (id, value) => { + cy.get('#' + id).should(value) +}) diff --git a/webapp/pages/settings/notifications.vue b/webapp/pages/settings/notifications.vue index 3d1a7eb62..a2828a1a9 100644 --- a/webapp/pages/settings/notifications.vue +++ b/webapp/pages/settings/notifications.vue @@ -5,7 +5,9 @@ - {{ $t('actions.save') }} + + {{ $t('actions.save') }} +