From 04a57df8343e6654c472496f7f7bdeb61c29fd7b Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 15 Sep 2021 07:51:06 +0200 Subject: [PATCH] Update test case to verify the right version in CodeQuarkus This change is kind of expected as CodeQuarkus frontend has been refactored and the new platform focuses on streams ID (2.2) instead of the dependency version. However, the dependency version is still present in the div title. --- .../java/io/quarkus/ts/startstop/CodeQuarkusSiteTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/src/it/java/io/quarkus/ts/startstop/CodeQuarkusSiteTest.java b/testsuite/src/it/java/io/quarkus/ts/startstop/CodeQuarkusSiteTest.java index 5b2f0a0e..3157282a 100644 --- a/testsuite/src/it/java/io/quarkus/ts/startstop/CodeQuarkusSiteTest.java +++ b/testsuite/src/it/java/io/quarkus/ts/startstop/CodeQuarkusSiteTest.java @@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; - +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Tests for checking presence of element on webpage @@ -41,7 +41,7 @@ public class CodeQuarkusSiteTest { public static final String elementIconByXpath = "//link[@rel=\"shortcut icon\"][@href=\"https://www.redhat.com/misc/favicon.ico\"]"; public static final String elementRedHatLogoByXpath= "//img[@class=\"logo\"][@alt=\"Red Hat Logo\"]"; public static final String elementSupportedFlagByXpath = "//a[@class=\"extension-tag supported\"]"; - public static final String elementQuarkusPlatformVersionByXpath = "normalize-space(//div[@class=\"quarkus-version\"]/span/text()[last()])"; + public static final String elementQuarkusPlatformVersionByXpath = "normalize-space(//div[@class=\"current-quarkus-stream\"]/@title)"; private WebClient webClient; @@ -111,7 +111,7 @@ public void validateQuarkusVersionMatch(TestInfo testInfo) throws Exception{ String quarkusPlatformVersionFromWeb = page.getFirstByXPath(elementQuarkusPlatformVersionByXpath); assertNotNull(quarkusPlatformVersionFromWeb, "Element: " + elementQuarkusPlatformVersionByXpath + " is missing!"); - assertEquals(quarkusPlatformVersion, quarkusPlatformVersionFromWeb, + assertTrue(quarkusPlatformVersionFromWeb.contains(quarkusPlatformVersion), "Quarkus versions doesn't match. Found on the web: " + quarkusPlatformVersionFromWeb + ". Expected: " + quarkusPlatformVersion); }