diff --git a/README.md b/README.md index 9dabcbfd8..029cff89c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Maven Central](https://img.shields.io/maven-central/v/com.xceptance/neodymium-library.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.xceptance%22%20AND%20a:%22neodymium-library%22) [![Join the chat at https://gitter.im/neodymium-library/community](https://badges.gitter.im/neodymium-library/community.svg)](https://gitter.im/neodymium-library/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -# Neodymium v4.1.4 +# Neodymium v4.1.5 Neodymium tries to solve your typical and most pressing UI test automation problems by combining JUnit, WebDriver, BDD/Cucumber, and proper reporting. It gives you ready to use templates, assembles well-known open source projects, and enhances this all with additional functionality that is often missing. Neodymium is basically the combination of state of the art open source test libraries with additional glue to make it stick reliably together. @@ -47,7 +47,7 @@ If you are still impatient, here is the quickest way to get Neodymium added to y com.xceptance neodymium-library - 4.1.4 + 4.1.5 ``` Add the `@RunWith` annotation to your test class or its superclass. This enables test execution with Neodymium. diff --git a/config/browser.properties b/config/browser.properties index 0e2894c32..14c5b5c4d 100644 --- a/config/browser.properties +++ b/config/browser.properties @@ -118,6 +118,7 @@ browserprofile.Chrome_headless.browser = chrome browserprofile.Chrome_headless.browserResolution = 1024x768 browserprofile.Chrome_headless.arguments = -ignore-certificate-errors browserprofile.Chrome_headless.headless = true +browserprofile.Chrome_headless.acceptInsecureCertificates = true # Local headless Chrome browserprofile.Chrome_1500x1000_headless.name = Headless Google Chrome 1500x1000 diff --git a/pom.xml b/pom.xml index dfd12526b..9f9e8159e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.xceptance neodymium-library - 4.1.4 + 4.1.5 neodymium-library https://github.com/Xceptance/neodymium-library @@ -223,7 +223,7 @@ org.yaml snakeyaml - 1.31 + 1.33 io.cucumber diff --git a/src/test/java/com/xceptance/neodymium/testclasses/proxy/RunWithProxy.java b/src/test/java/com/xceptance/neodymium/testclasses/proxy/RunWithProxy.java index 9d1bb0382..1ac546320 100644 --- a/src/test/java/com/xceptance/neodymium/testclasses/proxy/RunWithProxy.java +++ b/src/test/java/com/xceptance/neodymium/testclasses/proxy/RunWithProxy.java @@ -25,11 +25,11 @@ public void testProxyConfiguration() }); } - // the test is expected to run since we configured a bypass for "www.xceptance.com" + // the test is expected to run since we configured a bypass for "posters.xceptance.io" @Test public void testProxyBypassConfiguration() { - Selenide.open("https://www.xceptance.com"); - $("#page #navigation").shouldBe(visible); + Selenide.open("https://posters.xceptance.io:8443/posters/"); + $("#header-search-trigger").shouldBe(visible); } } diff --git a/src/test/java/com/xceptance/neodymium/testclasses/softassertion/UseSoftAssertions.java b/src/test/java/com/xceptance/neodymium/testclasses/softassertion/UseSoftAssertions.java index f2948e880..6d0bf4599 100644 --- a/src/test/java/com/xceptance/neodymium/testclasses/softassertion/UseSoftAssertions.java +++ b/src/test/java/com/xceptance/neodymium/testclasses/softassertion/UseSoftAssertions.java @@ -28,12 +28,12 @@ public class UseSoftAssertions public void validateSoftAssertion() { Neodymium.softAssertions(true); - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); Assert.assertEquals(Configuration.assertionMode, AssertionMode.SOFT); $("#notFound1").should(exist); $("#notFound2").should(exist); - $("#masthead .search-toggle").click(); + $("#header-search-trigger").click(); $("#notFound3").should(exist); Assert.assertThrows(ElementNotFound.class, () -> { $("#notFound4").click(); diff --git a/src/test/java/com/xceptance/neodymium/tests/ProxyConfigurationTest.java b/src/test/java/com/xceptance/neodymium/tests/ProxyConfigurationTest.java index 9858ea5a0..2115f28e4 100644 --- a/src/test/java/com/xceptance/neodymium/tests/ProxyConfigurationTest.java +++ b/src/test/java/com/xceptance/neodymium/tests/ProxyConfigurationTest.java @@ -21,7 +21,7 @@ public class ProxyConfigurationTest extends NeodymiumTest private static final String PORT = "1323"; - private static final String BYPASS = "www.xceptance.com"; + private static final String BYPASS = "posters.xceptance.io"; private static final String SOCKET_USERNAME = "username"; diff --git a/src/test/java/com/xceptance/neodymium/util/DebugUtilsTest.java b/src/test/java/com/xceptance/neodymium/util/DebugUtilsTest.java index 14e4a8bd1..a59c93c15 100644 --- a/src/test/java/com/xceptance/neodymium/util/DebugUtilsTest.java +++ b/src/test/java/com/xceptance/neodymium/util/DebugUtilsTest.java @@ -27,20 +27,20 @@ public void testHighlighting() { Neodymium.configuration().setProperty("neodymium.debugUtils.highlight.duration", "500"); - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); DebugUtils.injectJavaScript(); assertJsSuccessfullyInjected(); - final List list = $("body").findElements(By.cssSelector("#masthead")); + final List list = $("body").findElements(By.cssSelector("#globalNavigation")); DebugUtils.highlightElements(list, Neodymium.getDriver()); $(".neodymium-highlight-box").shouldBe(visible); DebugUtils.resetAllHighlight(); $(".neodymium-highlight-box").shouldNot(exist); - final List list2 = $("body").findElements(By.cssSelector("#content article")); + final List list2 = $("body").findElements(By.cssSelector("#productList li")); DebugUtils.highlightElements(list2, Neodymium.getDriver()); - $$(".neodymium-highlight-box").shouldHaveSize(10); + $$(".neodymium-highlight-box").shouldHaveSize(3); DebugUtils.resetAllHighlight(); $(".neodymium-highlight-box").shouldNot(exist); @@ -51,11 +51,11 @@ public void testHighlightingWithoutImplicitWaitTime() { Neodymium.configuration().setProperty("neodymium.debugUtils.highlight.duration", "500"); - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); DebugUtils.injectJavaScript(); assertJsSuccessfullyInjected(); - final List list = $("body").findElements(By.cssSelector("#masthead")); + final List list = $("body").findElements(By.cssSelector("#globalNavigation")); DebugUtils.highlightElements(list, Neodymium.getDriver()); $(".neodymium-highlight-box").shouldBe(visible); @@ -72,32 +72,32 @@ public void testWaiting() Neodymium.configuration().setProperty("neodymium.debugUtils.highlight", "true"); // one wait due to navigation - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); Assert.assertEquals(0, eventListener.implicitWaitCount); // one wait due to find - $("body #masthead").should(exist); + $("body #globalNavigation").should(exist); Assert.assertEquals(1, eventListener.implicitWaitCount); assertJsSuccessfullyInjected(); // two waits due to chain finding - $("body").findElements(By.cssSelector("#content article")); + $("body").findElements(By.cssSelector("#productList li")); Assert.assertEquals(3, eventListener.implicitWaitCount); // two waits due to find and click - $("#text-3 h1").click(); + $("#titleIndex").click(); Assert.assertEquals(4, eventListener.implicitWaitCount); // additional two waits due to find and click - $("#masthead .search-toggle").click(); + $("#header-search-trigger").click(); Assert.assertEquals(5, eventListener.implicitWaitCount); // three waits due to find and change value (consumes 2 waits) - $("#search-container .search-form input.search-field").val("abc"); + $("#searchForm input").val("abc"); Assert.assertEquals(6, eventListener.implicitWaitCount); // two waits due to find and press enter - $("#search-container .search-form input.search-field").pressEnter(); + $("#searchForm input").pressEnter(); Assert.assertEquals(7, eventListener.implicitWaitCount); } diff --git a/src/test/java/com/xceptance/neodymium/util/JavaScriptUtilsTest.java b/src/test/java/com/xceptance/neodymium/util/JavaScriptUtilsTest.java index 61bdb59b6..5aa8cde0f 100644 --- a/src/test/java/com/xceptance/neodymium/util/JavaScriptUtilsTest.java +++ b/src/test/java/com/xceptance/neodymium/util/JavaScriptUtilsTest.java @@ -17,7 +17,7 @@ public class JavaScriptUtilsTest public void testWaitingAnimationSelectorUnconfigured() { Neodymium.configuration().setProperty("neodymium.javaScriptUtils.timeout", "10000"); - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); final long start = System.currentTimeMillis(); JavaScriptUtils.waitForReady(); final long end = System.currentTimeMillis(); @@ -28,10 +28,10 @@ public void testWaitingAnimationSelectorUnconfigured() @Test public void testWaitingAnimationSelectorExistsOnPage() { - Neodymium.configuration().setProperty("neodymium.javaScriptUtils.loading.animationSelector", "#main-content"); + Neodymium.configuration().setProperty("neodymium.javaScriptUtils.loading.animationSelector", "#main"); Neodymium.configuration().setProperty("neodymium.javaScriptUtils.timeout", "10000"); - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); final long start = System.currentTimeMillis(); JavaScriptUtils.waitForReady(); final long end = System.currentTimeMillis(); @@ -46,7 +46,7 @@ public void testWaitingAnimationSelectorUnavailableOnPage() Neodymium.configuration().setProperty("neodymium.javaScriptUtils.loading.animationSelector", ".cantFindThisClass"); Neodymium.configuration().setProperty("neodymium.javaScriptUtils.timeout", "10000"); - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); final long start = System.currentTimeMillis(); JavaScriptUtils.waitForReady(); final long end = System.currentTimeMillis(); diff --git a/src/test/java/com/xceptance/neodymium/util/SelenideAddonsTest.java b/src/test/java/com/xceptance/neodymium/util/SelenideAddonsTest.java index 249e36ce9..5c177a976 100644 --- a/src/test/java/com/xceptance/neodymium/util/SelenideAddonsTest.java +++ b/src/test/java/com/xceptance/neodymium/util/SelenideAddonsTest.java @@ -36,99 +36,99 @@ @Browser("Chrome_headless") public class SelenideAddonsTest { - private void openBlogPage() + private void openPostersStartPage() { - Selenide.open("https://blog.xceptance.com/"); + Selenide.open("https://posters.xceptance.io:8443/posters/"); } @Test public void testMatchesAttributeCondition() { - openBlogPage(); - $("#masthead .search-toggle").click(); + openPostersStartPage(); + $("#header-search-trigger").click(); - $("#search-container .search-field").should(SelenideAddons.matchesAttribute("placeholder", "Search")); + $("#searchForm input").should(SelenideAddons.matchesAttribute("placeholder", "Search")); } @Test public void testMatchAttributeCondition() { - openBlogPage(); - $("#masthead .search-toggle").click(); + openPostersStartPage(); + $("#header-search-trigger").click(); - $("#search-container .search-field").should(SelenideAddons.matchAttribute("placeholder", "^S.a.c.\\s…")); - $("#search-container .search-field").should(SelenideAddons.matchAttribute("placeholder", "\\D+")); + $("#searchForm input").should(SelenideAddons.matchAttribute("placeholder", "^S.a.c.")); + $("#searchForm input").should(SelenideAddons.matchAttribute("placeholder", "\\D+")); } @Test public void testMatchAttributeConditionError() { - openBlogPage(); - $("#masthead .search-toggle").click(); + openPostersStartPage(); + $("#header-search-trigger").click(); Assert.assertThrows(ElementShould.class, () -> { - $("#search-container .search-field").should(SelenideAddons.matchAttribute("placeholder", "\\d+")); + $("#searchForm input").should(SelenideAddons.matchAttribute("placeholder", "\\d+")); }); } @Test public void testMatchAttributeConditionErrorMissingAttribute() { - openBlogPage(); - $("#masthead .search-toggle").click(); + openPostersStartPage(); + $("#header-search-trigger").click(); Assert.assertThrows(ElementShould.class, () -> { - $("#search-container .search-field").should(SelenideAddons.matchAttribute("foo", "bar")); + $("#searchForm input").should(SelenideAddons.matchAttribute("foo", "bar")); }); } @Test public void testMatchesValueCondition() { - openBlogPage(); - $("#masthead .search-toggle").click(); - $("#search-container .search-field").val("searchphrase").submit(); + openPostersStartPage(); + $("#header-search-trigger").click(); + $("#searchForm input").val("mozzarella").submit(); - $("#content .search-field").should(SelenideAddons.matchesValue("earchphras")); + $("#searchForm input").should(SelenideAddons.matchesValue("ozzarell")); } @Test public void testMatchValueCondition() { - openBlogPage(); - $("#masthead .search-toggle").click(); - $("#search-container .search-field").val("searchphrase").submit(); + openPostersStartPage(); + $("#header-search-trigger").click(); + $("#searchForm input").val("mozzarella").submit(); - $("#content .search-field").should(SelenideAddons.matchValue("^s.a.c.p.r.s.$")); - $("#content .search-field").should(SelenideAddons.matchValue("\\D+")); + $("#searchForm input").should(SelenideAddons.matchValue("^m.z.a.e.l.$")); + $("#searchForm input").should(SelenideAddons.matchValue("\\D+")); } @Test public void testMatchValueConditionError() { - openBlogPage(); - $("#masthead .search-toggle").click(); - $("#search-container .search-field").val("searchphrase").submit(); + openPostersStartPage(); + $("#header-search-trigger").click(); + $("#searchForm input").val("mozzarella").submit(); Assert.assertThrows(ElementShould.class, () -> { - $("#content .search-field").should(SelenideAddons.matchValue("\\d+")); + $("#searchForm input").should(SelenideAddons.matchValue("\\d+")); }); } @Test() public void testWrapAssertion() { - openBlogPage(); + openPostersStartPage(); SelenideAddons.wrapAssertionError(() -> { - Assert.assertEquals("Passionate Testing | Xceptance Blog", Selenide.title()); + Assert.assertEquals("Posters - The Ultimate Online Shop", Selenide.title()); }); } @Test public void testWrapAssertionError() { - openBlogPage(); + openPostersStartPage(); Assert.assertThrows(UIAssertionError.class, () -> { SelenideAddons.wrapAssertionError(() -> { @@ -161,11 +161,10 @@ public void beforeEvent(LogEvent currentLog) } }); - openBlogPage(); + openPostersStartPage(); Neodymium.softAssertions(true); try { - SelenideAddons.wrapAssertionError(() -> { Assert.assertEquals(errMessage, "MyPageTitle", Selenide.title()); }); @@ -202,7 +201,7 @@ public void beforeEvent(LogEvent currentLog) } }); - openBlogPage(); + openPostersStartPage(); Neodymium.softAssertions(true); try { @@ -223,7 +222,7 @@ public void testWrapAssertionErrorWithoutMessage() final String errMessage = "AssertionError: No error message provided by the Assertion."; try { - openBlogPage(); + openPostersStartPage(); SelenideAddons.wrapAssertionError(() -> { Assert.assertTrue(Selenide.title().startsWith("MyPageTitle")); }); @@ -323,7 +322,7 @@ public void testSafeSupplier() final Iterator iterator = runArray.iterator(); // testing the error path after three exceptions - openBlogPage(); + openPostersStartPage(); long startTime = new Date().getTime(); try { @@ -501,7 +500,7 @@ public void testRightwardDragAndDrop() SelenideElement slider = $(".balSlider span[role=slider]"); slider.shouldHave(attribute("aria-valuenow", "0")); - SelenideAddons.dragAndDrop(slider, 32, 0); + SelenideAddons.dragAndDrop(slider, 42, 0); slider.shouldHave(attribute("aria-valuenow", "2")); } @@ -512,7 +511,7 @@ public void testLeftwardDragAndDrop() SelenideElement slider = $(".balSlider span[role=slider]"); slider.shouldHave(attribute("aria-valuenow", "0")); - SelenideAddons.dragAndDrop(slider, -32, 0); + SelenideAddons.dragAndDrop(slider, -42, 0); slider.shouldHave(attribute("aria-valuenow", "-2")); }