Skip to content

Commit

Permalink
test: Adjust TestMachinesConsoles.testExternalConsole to Firefox 134
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinpitt committed Jan 13, 2025
1 parent 6d94aa5 commit 77ad717
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/check-machines-consoles
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Cockpit; If not, see <http://www.gnu.org/licenses/>.

import os
import time

import machineslib
Expand Down Expand Up @@ -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)")
Expand Down

0 comments on commit 77ad717

Please sign in to comment.