From b0e08faef46c078d4245577f3e41fc319c1f24c8 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Mon, 13 Nov 2023 16:57:47 +0100 Subject: [PATCH] [6.14] improved webhook event trigger test (#13077) improved webhook event trigger test --- tests/foreman/api/test_webhook.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/foreman/api/test_webhook.py b/tests/foreman/api/test_webhook.py index a220b19af99..019ac42484c 100644 --- a/tests/foreman/api/test_webhook.py +++ b/tests/foreman/api/test_webhook.py @@ -148,7 +148,9 @@ def test_positive_end_to_end(self, target_sat): (not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url' ) @pytest.mark.tier2 - def test_positive_event_triggered(self, module_org, module_target_sat): + @pytest.mark.e2e + @pytest.mark.parametrize('setting_update', ['safemode_render=False'], indirect=True) + def test_positive_event_triggered(self, module_org, target_sat, setting_update): """Create a webhook and trigger the event associated with it. @@ -159,13 +161,14 @@ def test_positive_event_triggered(self, module_org, module_target_sat): :CaseImportance: Critical """ - hook = module_target_sat.api.Webhooks( + hook = target_sat.api.Webhooks( event='actions.katello.repository.sync_succeeded', http_method='GET' ).create() - repo = module_target_sat.api.Repository( + repo = target_sat.api.Repository( organization=module_org, content_type='yum', url=settings.repos.yum_0.url ).create() - with module_target_sat.api.session.shell() as shell: + with target_sat.session.shell() as shell: shell.send('foreman-tail') repo.sync() assert_event_triggered(shell, hook.event) + target_sat.wait_for_tasks(f'Deliver webhook {hook.name}')