From 77ad7170c20c02d260caca46482eeb7b1fb31926 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 13 Jan 2025 08:06:13 +0100 Subject: [PATCH] test: Adjust TestMachinesConsoles.testExternalConsole to Firefox 134 Firefox 134 behaves more similar to Chromium now, it downloads the console file. However, it still doesn't have a .vv extension, so determine the dynamically generated file name and check its contents. --- test/check-machines-consoles | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/check-machines-consoles b/test/check-machines-consoles index cb2da18a4..08c93a985 100755 --- a/test/check-machines-consoles +++ b/test/check-machines-consoles @@ -17,6 +17,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . +import os import time import machineslib @@ -71,11 +72,12 @@ fullscreen=0 # "download". As we want to download this as "$vmName.vv" in the end # work around the issue for now. if b.browser == "chromium": - self.waitDownloadFile("download", content=content) + fname = "download" else: - b.wait_visible("#dynamically-generated-file") # is .vv file generated for download? - self.assertEqual(b.attr("#dynamically-generated-file", "href"), - u"data:application/x-virt-viewer,%5Bvirt-viewer%5D%0Atype%3Dspice%0Ahost%3D127.0.0.1%0Aport%3D5900%0Adelete-this-file%3D1%0Afullscreen%3D0%0A") + testlib.wait(lambda: len(os.listdir(b.driver.download_dir)) == 1) + fname = os.listdir(b.driver.download_dir)[0] + + self.waitDownloadFile(fname, expected_size=len(content), content=content) # Go to the expanded console view b.click("button:contains(Expand)")