@@ -297,3 +297,67 @@ def test_rh_flatpak_mirror_repo_dependancy_alert(
297297 assert len (details ['table' ]) == 1
298298 assert details ['table' ][0 ]['Name' ] == repo_name
299299 assert details ['table' ][0 ]['Last mirrored' ] != 'Never'
300+
301+
302+ @pytest .mark .parametrize ('function_flatpak_remote' , ['RedHat' ], indirect = True )
303+ def test_rh_flatpak_cv_publish_dependancy_alert (
304+ target_sat , function_org , function_product , function_flatpak_remote
305+ ):
306+ """Verify dependency warning in Content View publish wizard for Flatpak repos.
307+
308+ :id: 8f5e0f0d-1e56-4d74-9dbe-5fdf4ad0f5a0
309+
310+ :setup:
311+ 1. Create a Red Hat flatpak remote in an Organization and scan it.
312+
313+ :steps:
314+ 1. Mirror a flatpak app repo into a product.
315+ 2. Create a Content View with the app repository.
316+ 3. Open Publish wizard and verify the flatpak dependency warning.
317+
318+ :expectedresults:
319+ 1. Dependency warning appears for content views with flatpak apps.
320+
321+ :verifies: SAT-28473
322+ """
323+ app_repos = [
324+ repo
325+ for repo in function_flatpak_remote .repos
326+ if 'flatpak' in repo .name and 'runtime' not in repo .name and 'sdk' not in repo .name
327+ ]
328+ assert app_repos , 'No flatpak app repositories found for dependency warning test'
329+ app_repo = app_repos [0 ]
330+ target_sat .cli .FlatpakRemote ().repository_mirror (
331+ {
332+ 'flatpak-remote-id' : function_flatpak_remote .remote ['id' ],
333+ 'id' : app_repo ['id' ],
334+ 'product-id' : function_product .id ,
335+ }
336+ )
337+ target_sat .wait_for_tasks (
338+ search_query = 'Actions::Katello::Flatpak::MirrorRemoteRepository' ,
339+ max_tries = 5 ,
340+ search_rate = 5 ,
341+ poll_rate = 10 ,
342+ poll_timeout = 30 ,
343+ )
344+
345+ app_repo_info = target_sat .cli .Repository .list (
346+ {'product-id' : function_product .id , 'name' : app_repo ['name' ]}
347+ )[0 ]
348+ app_repo_entity = target_sat .api .Repository (id = app_repo_info ['id' ]).read ()
349+
350+ cv_with_deps = target_sat .api .ContentView (
351+ organization = function_org ,
352+ name = gen_string ('alpha' ),
353+ repository = [app_repo_entity ],
354+ ).create ()
355+
356+ with target_sat .ui_session () as session :
357+ session .organization .select (function_org .name )
358+ warning_text = session .contentview_new .read_flatpak_dependencies_alert (cv_with_deps .name )
359+ assert warning_text
360+ assert (
361+ 'Make sure the runtimes required by the Flatpak apps in this content view are available to the host(s).'
362+ in warning_text
363+ )
0 commit comments