Skip to content

Commit

Permalink
Merge pull request #223 from Xceptance/dependency-update-snakeyaml
Browse files Browse the repository at this point in the history
Dependency update snakeyaml
  • Loading branch information
RobertAvemarg authored Dec 13, 2022
2 parents dc18726 + 09230de commit f4801d8
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 65 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -47,7 +47,7 @@ If you are still impatient, here is the quickest way to get Neodymium added to y
<dependency>
<groupId>com.xceptance</groupId>
<artifactId>neodymium-library</artifactId>
<version>4.1.4</version>
<version>4.1.5</version>
</dependency>
```
Add the `@RunWith` annotation to your test class or its superclass. This enables test execution with Neodymium.
Expand Down
1 change: 1 addition & 0 deletions config/browser.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.xceptance</groupId>
<artifactId>neodymium-library</artifactId>
<version>4.1.4</version>
<version>4.1.5</version>

<name>neodymium-library</name>
<url>https://github.com/Xceptance/neodymium-library</url>
Expand Down Expand Up @@ -223,7 +223,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.31</version>
<version>1.33</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
26 changes: 13 additions & 13 deletions src/test/java/com/xceptance/neodymium/util/DebugUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<WebElement> list = $("body").findElements(By.cssSelector("#masthead"));
final List<WebElement> 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<WebElement> list2 = $("body").findElements(By.cssSelector("#content article"));
final List<WebElement> 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);
Expand All @@ -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<WebElement> list = $("body").findElements(By.cssSelector("#masthead"));
final List<WebElement> list = $("body").findElements(By.cssSelector("#globalNavigation"));
DebugUtils.highlightElements(list, Neodymium.getDriver());
$(".neodymium-highlight-box").shouldBe(visible);

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down
75 changes: 37 additions & 38 deletions src/test/java/com/xceptance/neodymium/util/SelenideAddonsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(() -> {
Expand Down Expand Up @@ -161,11 +161,10 @@ public void beforeEvent(LogEvent currentLog)
}
});

openBlogPage();
openPostersStartPage();
Neodymium.softAssertions(true);
try
{

SelenideAddons.wrapAssertionError(() -> {
Assert.assertEquals(errMessage, "MyPageTitle", Selenide.title());
});
Expand Down Expand Up @@ -202,7 +201,7 @@ public void beforeEvent(LogEvent currentLog)
}
});

openBlogPage();
openPostersStartPage();
Neodymium.softAssertions(true);
try
{
Expand All @@ -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"));
});
Expand Down Expand Up @@ -323,7 +322,7 @@ public void testSafeSupplier()
final Iterator<Runnable> iterator = runArray.iterator();

// testing the error path after three exceptions
openBlogPage();
openPostersStartPage();
long startTime = new Date().getTime();
try
{
Expand Down Expand Up @@ -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"));
}

Expand All @@ -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"));
}

Expand Down

0 comments on commit f4801d8

Please sign in to comment.