From ad97925b4671ad8d0c518c308c0000fa261e72e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Wed, 25 Jan 2023 16:49:57 +0100 Subject: Squish: Read expected version from version.log as fallback Change-Id: If5838639bbb37ea8286c5c315289d961ad0ef56a Reviewed-by: Miguel Costa --- .../suite_installation/shared/scripts/install_utils.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Tests/system/suite_installation/shared/scripts/install_utils.py b/Tests/system/suite_installation/shared/scripts/install_utils.py index 93b8e670..afcaa3a8 100644 --- a/Tests/system/suite_installation/shared/scripts/install_utils.py +++ b/Tests/system/suite_installation/shared/scripts/install_utils.py @@ -5,8 +5,6 @@ # -*- coding: utf-8 -*- -from xml.dom import minidom - import globalnames @@ -42,6 +40,11 @@ def changesScheduledLabelExists(): return object.exists(names.changes_scheduled_Label) +def readFile(filename): + with open(filename, "r") as f: + return f.read() + + def readExpectedVsToolsVersion(): expectedVersion = os.getenv("SQUISH_VSTOOLS_VERSION") if expectedVersion: @@ -50,8 +53,7 @@ def readExpectedVsToolsVersion(): "The environment variable SQUISH_VSTOOLS_VERSION is not set. Falling back to " "reading the expected version from version.targets") try: - versionXml = minidom.parse("../../../../version.targets") - return versionXml.getElementsByTagName("QtVSToolsVersion")[0].firstChild.data + return readFile("../../../../version.log") except: test.fatal("Can't read expected VS Tools version from sources.") return "" @@ -60,5 +62,6 @@ def readExpectedVsToolsVersion(): def verifyVsToolsVersion(): displayedVersion = waitForObjectExists(names.manage_Extensions_Version_Label).text expectedVersion = readExpectedVsToolsVersion() - test.compare(displayedVersion, expectedVersion, - "Expected version of VS Tools is displayed?") + if expectedVersion: + test.compare(displayedVersion, expectedVersion, + "Expected version of VS Tools is displayed?") -- cgit v1.2.3