Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Conflicts:
	pom.xml: bumped version to 2.0.0
  • Loading branch information
Marcus Kaufmann committed Aug 7, 2018
2 parents ba3ab65 + 7d1d8df commit e207bfe
Show file tree
Hide file tree
Showing 61 changed files with 1,225 additions and 773 deletions.
13 changes: 0 additions & 13 deletions config/browser.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,6 @@ neodymium.webDriver.keepBrowserOpen = false
# Warning: The webdriver process might stay alive even if you close the browser afterwards
neodymium.webDriver.keepBrowserOpenOnFailure = false

## HTTP proxy settings. Specify host and port of the proxy server and
## whether it should be used at all. If the proxy requires user authentication,
## make sure to provide the credentials needed.
## You may also configure a list of hosts that can be used directly, thus
## bypassing the proxy. Note that the host definitions are interpreted as
## regular expressions so ensure proper use of escape characters.
#neodymium.proxy = false
#neodymium.proxy.host = 127.0.0.1
#neodymium.proxy.port = 8888
#neodymium.proxy.userName =
#neodymium.proxy.password =
#neodymium.proxy.bypassForHosts = localhost 127\\.0\\.0\\.1 ^192[.]168

################################################################################
#
# See also https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
Expand Down
195 changes: 195 additions & 0 deletions config/neodymium.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# This file contains properties that will be read by Neodymium to alter properties of test execution
# All duration and timeout values are expected to be expressed in milliseconds

# These are default values for available properties. In order to change a value uncomment the line and change its value.

#############################
#
# Site properties
#
#############################
#
# The URL of the web site to test
# neodymium.url = ${neodymium.url.protocol}://${neodymium.url.host}${neodymium.url.path}
#
# The protocol used to access the site
# neodymium.url.protocol =
#
# The host encoded in the URL
# neodymium.url.host =
#
# The path on the site that is used as test entry point
# neodymium.url.path = /
#
# The site/channel part of the url
# neodymium.url.site =
#
#########
#
# Localization
#
#########
#
# The locale that should be used to lookup translations in localization feature
# neodymium.locale = en_US
#
# Path to the yaml formatted file that contains localized (translated) data for the site
# neodymium.localization.file = config/localization.yaml
#
#############################
#
# Basic authentication properties
#
#############################
#
# Username that should be used for basic authentication
# neodymium.basicauth.username =
#
# Password that should be used for basic authentication
# neodymium.basicauth.password =
#
#############################
#
# Selenide properties
#
#############################
#
# These properties are used to configure Selenide (This is a global setting and has effect on every element selection)
#
# How long should Selenide wait to match a condition
# neodymium.selenide.timeout = 3000
#
#############################
#
# Debugging properties
#
#############################
#
# Should elements highlighted that are selected by Selenide
# neodymium.debugUtils.highlight = false
#
# How long should an element be highlighted
# neodymium.debugUtils.highlight.duration = 100
#
# How to display test execution in Eclipse JUnit view. tree - a hierarchical representation, flat - a flat list of tests
# neodymium.junit.viewmode = tree
#
#############################
#
# Neodymium context properties
#
#############################
# The following setting reassemble responsive design breakpoints. They determine at which page width a site is considered to be displayed on a small, medium, large oder extra large device.
# You can use the by calling e.g. Neodymium.isSmallDesktop()
#
# neodymium.context.device.breakpoint.small = 544
# neodymium.context.device.breakpoint.medium = 769
# neodymium.context.device.breakpoint.large = 992
# neodymium.context.device.breakpoint.xlarge = 1200
#
#############################
#
# JavaScriptUtils properties
#
#############################
# The following properties are taken into account if you use functions form the JavaScripUtils class.
#
# neodymium.javaScriptUtils.timeout = 2000
# neodymium.javaScriptUtils.pollingInterval = 200
# neodymium.javaScriptUtils.loading.jQueryIsRequired = true
# neodymium.javaScriptUtils.loading.animationSelector = [String]
#
#############################
#
# SelenidetAddons properties
#
#############################
# The following properties are taken into account if you use functions form the SelenidUtils class.
#
# How often should Selenide try to match a condition if the element is affected by staleness
# neodymium.selenideAddons.staleElement.retry.count = 3
#
# How long should Selenide wait between retries in case of element staleness
# neodymium.selenideAddons.staleElement.retry.timeout = 500

#############################
#
# AllureAddons properties
#
#############################
# The following properties are taken into account if you use functions form the AllureAddons class.
#
# Whether or not a screenshot should be taken per step
# neodymium.allureAddons.screenshots.perstep.always = false
#
#############################
#
# DataUtils properties
#
#############################
# The following properties are taken into account if you use functions form the DataUtils class.
#
#########
#
# E-Mail generator properties
#
#########
#
# The domain used for the generated email address
# neodymium.dataUtils.email.domain = example.com
#
# The prefix used in email address generation prefix<generated>@domain
# neodymium.dataUtils.email.local.prefix = test
#
#########
#
# Password generator properties
#
#########
#
# The amount of capital letters
# neodymium.dataUtils.password.uppercaseCharAmount = 2
#
# The amount of small letters
# neodymium.dataUtils.password.lowercaseCharAmount = 5
#
# The amount of digits
# neodymium.dataUtils.password.digitAmount = 2
#
# The amount of special characters
# neodymium.dataUtils.password.specialCharAmount = 2
#
# The special characters that should be used
# neodymium.dataUtils.password.specialChars = +-#$%%&.;,_
#
#############################
#
# Proxy configuration properties
#
#############################
# HTTP proxy settings. Specify host and port of the proxy server and whether it should be used at all.
# If the proxy requires user authentication, make sure to provide the credentials needed.
# You may also configure a comma separated list of hosts that can be used directly, thus bypassing the proxy.
# Note that the host definitions are interpreted as regular expressions so ensure proper use of escape characters.
#
# Decide whether or not a proxy is used
# neodymium.proxy = false
#
# The host of the proxy
# neodymium.proxy.host = 127.0.0.1
#
# The host of the proxy
# neodymium.proxy.port = 8888
#
# The host of the proxy
# neodymium.proxy.bypassForHosts = localhost,127\\.0\\.0\\.1,^192[.]168
#
# The socket username of the proxy
# neodymium.proxy.socket.userName =
#
# The socket password of the proxy
# neodymium.proxy.socket.password =
#
# The socket version of the proxy
# neodymium.proxy.socket.version =
#
17 changes: 0 additions & 17 deletions config/visualassertion.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#######################################################################
#The possible properties and their default values are:
#neodymium.imageComparison.waitTime=300
#neodymium.imageComparison.markBlockX=10
#neodymium.imageComparison.markBlockY=10
#neodymium.imageComparison.directory=no default
#neodymium.imageComparison.pixelPerBlockXY=20
#neodymium.imageComparison.colTolerance=0.1
#neodymium.imageComparison.pixTolerance=0.2
#neodymium.imageComparison.trainingMode=false
#neodymium.imageComparison.closeMask=false
#neodymium.imageComparison.closeWidth=5
#neodymium.imageComparison.closeHeight=5
#neodymium.imageComparison.differenceImage=true
#neodymium.imageComparison.algorithm=FUZZY
#########################################################################

# Global flag to turn visual asserations off, nothing will be done, all code is skipped
neodymium.visualassertion.enabled=true

Expand Down
26 changes: 14 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.xceptance</groupId>
<artifactId>neodymium-library</artifactId>
<version>1.1.0</version>
<version>2.0.0</version>

<name>neodymium-library</name>
<url>https://github.com/Xceptance/neodymium-library</url>
Expand Down Expand Up @@ -47,7 +47,7 @@
<maven.compiler.source.version>1.8</maven.compiler.source.version>
<maven.compiler.target.version>1.8</maven.compiler.target.version>
<surefire.version>2.21.0</surefire.version>
<allure.version>2.6.0</allure.version>
<allure.version>2.7.0</allure.version>
<cucumber.version>2.4.0</cucumber.version>
<log4j.version>2.9.1</log4j.version>
</properties>
Expand Down Expand Up @@ -90,6 +90,10 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.config.file>logging.properties</java.util.logging.config.file>
</systemPropertyVariables>

<forkCount>4</forkCount>
<reuseForks>false</reuseForks>
<includes>
Expand All @@ -114,7 +118,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -123,14 +127,6 @@
</goals>
</execution>
</executions>
<!-- remove pin of commons-lang3 when upgraded to 3.1.0 -->
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -235,7 +231,13 @@
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>4.12.2</version>
<version>4.12.3</version>
<exclusions>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.slf4j.LoggerFactory;

import com.codeborne.selenide.logevents.SelenideLogger;
import com.xceptance.neodymium.util.Context;
import com.xceptance.neodymium.util.Neodymium;

import io.qameta.allure.Attachment;
import io.qameta.allure.selenide.AllureSelenide;
Expand All @@ -29,7 +29,7 @@ public NeodymiumCucumberRunListener()
@Override
public void testStarted(Description description) throws Exception
{
Context.clearThreadContext();
Neodymium.clearThreadContext();
LOGGER.debug("Test started: " + description.toString());
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/xceptance/neodymium/NeodymiumRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.xceptance.neodymium.module.StatementBuilder;
import com.xceptance.neodymium.module.order.DefaultStatementRunOrder;
import com.xceptance.neodymium.module.statement.browser.multibrowser.Browser;
import com.xceptance.neodymium.util.Context;
import com.xceptance.neodymium.util.Neodymium;

/**
* This class executes {@link JUnit4} test classes (aka JUnit Runner) and adds several features to test execution e.g.
Expand Down Expand Up @@ -73,8 +73,8 @@ public NeodymiumRunner(Class<?> klass) throws InitializationError

public enum DescriptionMode
{
flat,
tree,
flat,
tree,
};

private List<FrameworkMethod> computedTestMethods;
Expand Down Expand Up @@ -202,7 +202,7 @@ protected List<FrameworkMethod> computeTestMethods()

public Description createTestDescriptions(List<FrameworkMethod> methods)
{
switch (Context.get().configuration.junitViewMode())
switch (Neodymium.configuration().junitViewMode())
{
case flat:
return createFlatTestDescription(methods);
Expand Down Expand Up @@ -290,7 +290,7 @@ protected Description describeChild(FrameworkMethod method)
protected void runChild(FrameworkMethod method, RunNotifier notifier)
{
// clear the context before next child run
Context.clearThreadContext();
Neodymium.clearThreadContext();
super.runChild(method, notifier);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.events.AbstractWebDriverEventListener;

import com.xceptance.neodymium.util.HighlightAndWait;
import com.xceptance.neodymium.util.DebugUtils;

public class NeodymiumWebDriverListener extends AbstractWebDriverEventListener
{
@Override
public void beforeFindBy(By by, WebElement element, WebDriver driver)
{
HighlightAndWait.injectHighlightingJs();
HighlightAndWait.highlightAllElements(by, driver);
DebugUtils.injectHighlightingJs();
DebugUtils.highlightAllElements(by, driver);
}
}
Loading

0 comments on commit e207bfe

Please sign in to comment.