Skip to content

Commit f1b2244

Browse files
committed
fix(e2e tests): test_email_notifications
Adapt test to use the new "Apply" button instead of the removed "Apply & create another rule" one. CMK-32999 Change-Id: Id96edb45106c12a2688fc88502a5cf210ad9696d
1 parent 1e48c57 commit f1b2244

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

tests/gui_e2e/test_email_notifications.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_filesystem_email_notifications(
124124
notification_configuration_page.page, rule_position=0
125125
)
126126
default_notification_rule_page.check_disable_rule(True)
127-
default_notification_rule_page.apply_and_create_another_rule_button.click()
127+
default_notification_rule_page.apply_button.click()
128128

129129
logger.info(
130130
(
@@ -212,7 +212,7 @@ def test_filesystem_email_notifications(
212212
navigate_to_notification_configuration=False,
213213
)
214214
default_notification_rule_page.check_disable_rule(False)
215-
default_notification_rule_page.apply_and_create_another_rule_button.click()
215+
default_notification_rule_page.apply_button.click()
216216

217217
email_manager.clean_emails(expected_notification_subject)
218218

tests/gui_e2e/testlib/playwright/pom/setup/notification_rules.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ def add_new_entry_button(self) -> Locator:
199199
def select_user_dropdown(self) -> Locator:
200200
return self._recipient_group.locator("button").filter(has_text="Select user")
201201

202+
@property
203+
def apply_button(self) -> Locator:
204+
return self.main_area.locator().locator("button").filter(has_text=re.compile(r"^Apply$"))
205+
202206
@property
203207
def apply_and_create_another_rule_button(self) -> Locator:
204208
return self.main_area.locator().get_by_text("Apply & create another rule")
@@ -314,15 +318,11 @@ def modify_notification_rule(self, user: str, service: str, description: str) ->
314318
self.description_text_field.fill(description)
315319

316320
logger.info("Save the changes")
317-
self.apply_and_create_another_rule_button.click()
318-
319-
self.validate_page()
321+
self.apply_button.click()
320322

321-
success_message = "Notification rule successfully edited!"
322-
expect(
323-
self.main_area.page_menu_popups,
324-
message=f"'{success_message}' message not displayed",
325-
).to_contain_text(success_message)
323+
self.page.wait_for_url(
324+
url=re.compile(quote_plus("wato.py?mode=notifications")), wait_until="load"
325+
)
326326

327327

328328
class EditNotificationRule(BaseNotificationPage):

0 commit comments

Comments
 (0)