From ac57bd85e8b9fbc5daa5f9aa3f320ba813f8a374 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 11 Apr 2025 10:03:08 +0200 Subject: [PATCH] e2e: add user muting step to chat notification test --- cypress/e2e/Chat.Message.Notification.feature | 1 + .../common/{string}_mutes_{string}.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 cypress/support/step_definitions/common/{string}_mutes_{string}.js diff --git a/cypress/e2e/Chat.Message.Notification.feature b/cypress/e2e/Chat.Message.Notification.feature index 3cb672e27..1547cd72a 100644 --- a/cypress/e2e/Chat.Message.Notification.feature +++ b/cypress/e2e/Chat.Message.Notification.feature @@ -12,6 +12,7 @@ Feature: Notifications for Chat Messages via E-Mail | Bob der Baumeister | bob-der-baumeister | moderator@example.org | 1234 | u2 | 0.0.4 | | Jenny Rostock | jenny-rostock | user@example.org | 1234 | u3 | 0.0.4 | | Nathan Narrator | nathan-narrator | narrator@example.org | abcd | u_nn | 0.0.4 | + And "Bob der Baumeister" mutes "Nathan Narrator" Scenario: No Chat Notification Email when Online Given I am logged in as "bob-der-baumeister" diff --git a/cypress/support/step_definitions/common/{string}_mutes_{string}.js b/cypress/support/step_definitions/common/{string}_mutes_{string}.js new file mode 100644 index 000000000..a387bc4c9 --- /dev/null +++ b/cypress/support/step_definitions/common/{string}_mutes_{string}.js @@ -0,0 +1,14 @@ +import { defineStep } from '@badeball/cypress-cucumber-preprocessor' +import './../../factories' + +defineStep('{string} mutes {string}', (muterName, mutedName) => { + cy.neode() + .firstOf('User', { name: mutedName }) + .then(mutedUser => { + cy.neode() + .firstOf('User', { name: muterName }) + .then(muterUser => { + cy.wrap(muterUser).relateTo(mutedUser, 'muted') + }) + }) +})