Skip to content

Commit

Permalink
test: Check appstream data missing alert
Browse files Browse the repository at this point in the history
  • Loading branch information
leomoty committed Sep 6, 2023
1 parent ef37084 commit 2dc5ba7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/verify/check-apps
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TestApps(packagelib.PackageCase):
self.appstream_collection = set()
self.machine.upload(["verify/files/test.png"], "/var/tmp/")

def createAppStreamPackage(self, name, version, revision):
def createAppStreamPackage(self, name, version, revision, install=False):
self.createPackage(name, version, revision, content={
f"/usr/share/metainfo/org.cockpit-project.{name}.metainfo.xml": f"""
<component type="addon">
Expand All @@ -43,7 +43,7 @@ class TestApps(packagelib.PackageCase):
<launchable type="cockpit-manifest">{name}</launchable>
</component>
""",
"/usr/share/pixmaps/test.png": {"path": "/var/tmp/test.png"}})
"/usr/share/pixmaps/test.png": {"path": "/var/tmp/test.png"}}, install=install)
self.appstream_collection.add(name)

def createAppStreamRepoPackage(self):
Expand Down Expand Up @@ -102,12 +102,20 @@ class TestApps(packagelib.PackageCase):
b.wait_visible(".pf-v5-c-empty-state")

self.createAppStreamPackage("app-1", "1.0", "1")
self.createAppStreamPackage("app-2", "1.0", "1", install=True)
self.createAppStreamRepoPackage()

b.enter_page('/apps')

with b.wait_timeout(30):
b.wait_in_text(".pf-v5-c-alert.pf-m-inline h4.pf-v5-c-alert__title",
"Warning alert:Appstream data package is missing, only installed applications are shown.")

# Refresh package info
b.click("#refresh")

with b.wait_timeout(30):
b.wait_not_present(".pf-v5-c-alert.pf-m-inline")
b.click(".app-list #app-1")
b.wait_visible('a[href="https://app-1.com"]')
b.wait_visible(f'#app-page img[src^="{urlroot}/cockpit/channel/"]')
Expand Down

0 comments on commit 2dc5ba7

Please sign in to comment.