GithubHelp home page GithubHelp logo

xceptance / neodymium-library Goto Github PK

View Code? Open in Web Editor NEW
80.0 23.0 11.0 36.26 MB

A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.

License: MIT License

Java 97.97% Gherkin 0.19% JavaScript 1.84%
java automation-test test-automation bdd test-automation-framework selenide webdriver

neodymium-library's Introduction

Maven Central Join the chat at https://gitter.im/neodymium-library/community

Neodymium

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.

Included Projects

We combine and use several open source frameworks. Here are some honorable mentions:

  • JUnit: It is the base test framework because JUnit support can be found everywhere, so it is the perfect base for easy integration and comprehensive IDE support. Right now it is on version 4, but as soon as version 5 features are high in demand, version 5 support will be added.
  • WebDriver: Of course WebDriver is the core, because it is the only way to communicate with browsers consistently without using proprietary technologies.
  • Selenide: There are plenty of UI automation libraries available that are built on top of WebDriver. Selenide is one of the most popular approaches that is compact, fluent, and solves a lot of the basic challenges, hence we included it.
  • Allure: The Allure Framework is a flexible lightweight multi-language test report tool that not only shows a very concise representation of what has been tested in a neat web report form, but allows everyone participating in the development process to extract the maximum of useful information from daily test execution.
  • BDD/Cucumber: Neodymium supports BDD. If you prefer this testing style, you can organize your tests using Cucumber. See our example projects for more information.
  • Owner: Organize and implement configurations throughout the different stages of test projects.

Quicklinks

If you already know what you want to do, you can pick one of the demo test suites or our test suite template. If you are new to Neodymium, please read on.

  • Neodymium Template: A template to start a new test automation suite quickly either as Cucumber or as pure Java.
  • Neodymium Pure Java Example: A demo test suite against the Xceptance reference demo store Posters as pure Java version.
  • Neodymium Cucumber Example: For the fans of BDD/Cucumber, this is almost the same test suite as before but driven by BDD syntax.
  • Neodymium Showcase: This repository contains different showcases. Each of them demonstrates and comments on the usage of a single feature of Neodymium. Feel free to request more examples by creating an issue.

Neodymium in the media

We have a talk (in German) about the features and some best practices for Neodymium available on YouTube.

Here is an article on describing the main features of Neodymium and our motivation why we saw the need to create it.

Additional Features

These are our additions to make test automation nicer, quicker, and less painful.

  • Multi Browser Support: Simple setup and use of different browsers including remote browsers. Annotation per test case defines what browsers are supported by this very test case. Automatic execution of the test case per browser.
  • Page and Component Concept: Our example test suites demonstrate a page and component concept for easier test design. (Structural guidance)
  • Test Data: Externalized test data for Java test cases including automatic execution per test data set.
  • Localization: Simple concept to run localized test cases in conjunction with test data management.
  • Concurrent Execution: Concurrent execution of tests with Maven.

Getting Started

We recommend starting with our template instead of writing a suite from scratch. If you need more guidance, you can also start from one of our full demo test suites.

Please hop over to the Wiki for a full tour of Neodymium and a Getting Started guide.

If you are still impatient, here is the quickest way to get Neodymium added to your project. Don't forget to update the version number if you prefer a particular version.

<dependency>
    <groupId>com.xceptance</groupId>
    <artifactId>neodymium-library</artifactId>
    <version>INSERT_LATEST_VERSION_HERE</version>
</dependency>

To write a simple unit test:

Add the @NeodymiumTest annotation to your test method. This enables test execution with Neodymium.

public class MyTests
{
    @NeodymiumTest 
    public void testMethod()
    {
        // test code
    }
}

Please be aware that Neodymium (starting at version 5.0.0) is using JUnit5. If you want to run your tests with JUnit4 Neodymium still supports this and you can have a look here.

If your project is already driven by Neodymium but you want to update to the latest version, please, check the migration notes

And now is the time to dive into the features we added to make the most out of it. Please head over to our Wiki.

License

Neodymium is licensed under the MIT License.

Who Are We

We are Xceptance. A software testing company with strong commerce knowledge and projects with customers from all around the world. Besides Neodymium, we have developed Xceptance Load Test (XLT), a load and performance test tool that is open source too (APL 2.0). It provides an extensive range of awesome features to make the tester's and developer's life easier.

If you are looking for test automation that also covers the performance side of life, take a look at XLT. You can write and run load tests with real browsers including access to data from the Web Performance Timing API. In case browsers are too heavy, XLT has other modes of load testing to offer as well.

We offer professional support for Neodymium and XLT as well as implementation and training services.

neodymium-library's People

Contributors

ajakobi avatar andre-becker avatar dependabot[bot] avatar gitter-badger avatar h-arlt avatar jeremi-thebeau avatar occupant23 avatar oomelianchuk avatar rkl-xc avatar robertavemarg avatar rschwietzke avatar wurzelkuchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neodymium-library's Issues

Adjust and document Configuration

Rename Configuration to NeodymiumConfiguration

Add documentation how to use test.properties and credentials.properties and how they work together.

Include localization support

Provide localization support using an approach from MFRA test suite (YAML setup). That helps to look up phrases and text instead of hard coding it or providing redundant data,

DesiredCapabilities

Refacture the usage of DesiredCapabilities in order to remove the following info message during execution.

"Using new SafariOptions() is preferred to DesiredCapabilities.safari()"

Property files for data sets

At the moment we can not support property files as source for data sets. Its the nature of properties that data is flat. We need to decide whether we define a key format that allows to define multiple data sets or we drop support properties for data set and use e.g. yaml instead

Thoughts on key format:

0.<Key> = <Value>
1. ...

properties for first iteration
<Key> = <Value>   ===   0.<Key> = <Value>  

how to handle the gap?
0.<Key>
2.<Key>

special case
<Key>
2.<Key>

Rework WebDriverCache

Fix synchronization, instance handling, spelling and naming of methods and add comments.

JUnit categories

Add JUnit categories support to group tests. Consider Maven parameter that constain the tests that will be executed. Also provide an commandline override switch.

Improve localization feature

Change localization feature so it will accept any locale (even invalid locales) as key and will simply look up the yaml file. Only if it couldn't be found then use the apache localization tool as backup. Also adjust documentation in wiki

Slowdown test execution

For debugging/test creation purpose it would be nice to slow down test execution so the user is able to follow the execution flow.

Proxy Configuration

Refacture:

  • naming of properties file
  • naming of properties

Add documentation and basic test cases.

Improve DataUtils

Add a methods that allows you to gather a specific data type and return a default value in case they where not found.
This methods should prevent NPE if the key is not present but should still raise conversion errors.

e.g.
public static int asInt(String key, int defaultValue)

Attachments do not appear in Allure report for Cucumber test cases

Attachments, like screenshots that are created on test failure, do not appear in the Allure report.
These files are created and can be found inside allure-result folder but they were not linked to any test case and so do not appear in the generated report.

I think to remember that this was already working. This might be an issue due to the version change of Cucumber from 1.2.5 to 2.3.1.
It is most likely an issue that is caused by the new "allure-cucumber2-jvm" dependency (see allure-framework/allure-java#157).
Before that change we had "allure-cucumber-jvm" (https://github.com/allure-framework/allure-cucumberjvm) which was also known to have this issue (allure-framework/allure-cucumberjvm#41) but it was already solved.

Desired Cabibilities

We still see some warnings regarding the usage of DesiredCapabilities.firefox();
Remove the usage of the functionality and check the reason for it.

Remove XLT reference

Remove xlt from the properties such as browsers or any other place where it might turn up in the code or properties.

Unify window width/height functions of context

Context.getWindowWidth() was changed to use Javascript to correctly determine viewport width in Chrome emulation. The version before had used web driver values that returned the window width wich is totally different from viewport.
Unify the getWindowWidth/Height functions and maybe add another set of functions that use an different aproach.

Context is not cleared

The Context should be cleared for every test execution.

STR:
dataSet.json with 2 datasets the first dataset has more key value pairs than the second
the values from the first data set are still available during the execution of the second data set

I think we cleared thius for browsers but not for test data. Not sure if there are more places where we need to do this.

Move test resources

Move test resources to the resources folder in test to reestablish the default behavior.

Move the driver setup for the Context

Currently the driver is set manually in the test class.

   @Before
    public void before()
    {
        Context.get().driver = getWebDriver();

Could the setup be moved to NeodymiumRunner or similar where the webdriver is already known?

Refactoring

Validate that the naming of the public API is clear and does not conflict with other things in our 'universe'.

Update or add documentation and tests where necessary.
Create TODO's what needs to be done in the example projects once the changes are release

Duplicate screenshots in Allure report

When execute a mixed set of unit and cucumber tests with Maven then attached files of failed tests are duplicated in Allure report.

chrome_2017-11-27_13-45-13

The reason for this error is that NeodymiumRunListener#testFailure(Failure failure) is called from both NeodymiumRunner and NeodymiumCucumberRunner with similar but different failures. So there is no easy way to match that these calls are basically for the same error.

NPE in JavaScript helper

Function waitForReady of class JavaScript throws an NPE is no "javascriptLoadingAnimationSelector" is defined.

Refactoring Context to enable setup of custom configurations

With issue #9 the user looses the ability to setup an own configuration containing project specific values.

  • remove the configuration from the constructur
  • add a setup method for establishing a configuration that
  • remove the setup of the com.selenide.Configuration from the AbstractTest class and add it to the setupMethod.
    public void before()
    {
        Configuration.timeout = Context.get().configuration.timeout();
        Configuration.collectionsTimeout = 2 * Configuration.timeout;
    }

Jira or Confluence integration

Check if Jenkins plugins are able to cover the needs. Also add wiki entry for plugin installation(?) and a project configuration.

Jenkins, Gitlab or other CI/CD

Setup and document how to use Jenkins with Neo as well as how to use GitLab with Neo. Especially important is build and reporting.

  • How to configure build
  • How to use parallel execution
  • How to access the report
  • How to do historical reporting

Include a global context

Provide global context using an approach from MFRA test suite. That helps to interact with data, webdriver and configuration.

Selenide timeout settings

Set timeouts in Selenide configuration class for both Java and Cucumber tests. Since most Selenide functions are affected from this timeout the configuration should be set immediately after driver is built.

Configuration.timeout = Context.get().configuration.timeout();
Configuration.collectionsTimeout = Configuration.timeout * 2;

Update Selenide

Update Selenide dependency to a newer version. There are some issues with this task as dependencies change too. For instance GSON is now runtime only dependency but we need it to have it at compile time. Same issue for Apache-Commons library. Furthermore Selenium changed internally from Apache-HTTP to OkHTTP which raises more structural issues to solve.

Establish global test data class instead of map in test case

For easier handling, the test data should be setup in a global class that is nice for test data management aka TestData and has several methods to work with it. The new test data map per test case is established here and not in the test case where we manually have to put that into an super class.

Nexus cleanup

The dependencies below are currently deployed on our nexus since there is no public release available.

io/qameta/allure/allure-java-commons/2.0-SNAPSHOT
io/qameta/allure/allure-selenide/2.0-SNAPSHOT

Delete these dependencies once a release is available. Also remove the following section of the pom.xml if no other dependency was meanwhile added that requires that configuration.

<repositories>
    <repository>
        <id>xceptance-public</id>
        <url>https://lab.xceptance.de/nexus/content/repositories/public/</url>
    </repository>
</repositories>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.