Code Monkey home page Code Monkey logo

webtester2-core's Introduction

License GitHub version Maven Central Version Javadocs Build Status Codecov BCH compliance

testIT WebTester

This is the Java 8 optimized version of WebTester (v2.x), for Java 6 and 7 versions see 1.x.

testIT WebTester is a web-application UI test automation framework based on Selenium.

It is the product of years of consulting experience in various projects and aims at providing a very intuitive, declarative and extendable API for writing programmatic UI tests in Java.

Features

  • Optimized for Java 8 and above
  • Intuitive Page Object Pattern with simple annotation-driven element identification
  • Useful predefined element classes (e.g. Button, TextField, ...)
  • Simple API for runtime element identification
  • Boost reuse with easy composition of pages and page fragments
  • Highlighting of used elements for visual debugging
  • Custom event handling: from a simple screenshot on exception to custom report generation
  • Seamless integration with common frameworks like: AssertJ, Hamcrest, JUnit, Spring, etc.
  • Selenium is always just a method call away!

Migrating from WebTester v1.x?

If you are migrating from an earlier version of WebTester, you might be interested in this guide.

Documentation

The user documentation is part of the repository and is generated as an HTML. The latest version can be found here. Older versions of the documentation are linked in the Wiki.

If you have further questions please get in touch with us.

Contribute

See contribution document.

Get in touch

You can contact us by creating an issue.

Licensing

WebTester is licensed under The Apache License, Version 2.0.

Sponsoring

WebTester is mainly developed by NovaTec Consulting GmbH, a German consultancy firm that drives quality in software development projects.

webtester2-core's People

Contributors

dbe-it avatar drakojin avatar slu-it avatar

Stargazers

 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

webtester2-core's Issues

Update to new Mockito 2

Mockito released their second major version (v2.1.0). We could use some of the new features and should update ASAP.

JUnit 5 Support Module Features should also be available for JUnit 4

The (currently under development - #18) JUnit 5 support module will have many features which are lacking in the JUnit 4 module:

  • Page Initialization
  • Variables in @EntryPoint annotations
  • Replacement of @Primary with a name based concept
  • Introduction of the @Managed annotation

All of these should also be implemented for the JUnit 4 module since JUnit 5 will need some time to replace it's predecessor.

Important: These changes should be compatible with the current implementation. The @Resource annotation for instance should still be usable. All code which is replaced with newer implementation (@Resource , @Primary etc.) should be marked as deprecated and removed in v2.2.

Check API for Kotlin "Look and Feel"

Kotlin is currently a hot topic and will only get hotter. I think we can assume that some of our potential users will be using Kotlin to write fixture code.

We should check our current API classes for "compatibility" with the way Kotlin is commonly used. The fixture code should always feel native to the used language.

it is completely possible, that we don't do anything which is not Kotlin-esk!

A little bit of background:
Spring has put a lot of effort into making sure that Spring 5.0 and Spring Boot 2.0 APIs are 100% Kotlin friendly.

Documentation of WebTester's underlying Concepts and Principles

We need an in dept documentation / article about the underlying concepts and principles of WebTester 2.

It should cover the following topics:

  • Why Interfaces instead of Classes?
  • Composition through multiple inheritance over class hierarchy (traits)
  • Design of Pages
  • Design of Page Fragments
  • Nesting of Pages and Page Fragments
  • Which methods should be declared on which object

Browser Factory for Microsoft's Edge Browser

As with the BrowserFactory implementatins for Firefox, Chrome, Internet Explorer etc., we should provide an out of the box EdgeFactory for Microsoft's Edge browser.

  • The BrowserFactory should be called EdgeFactory.
  • Our default performance optimizations should be applied.

PopUp Window / Multi-Window handling abstraction layer

Currently it is very cumbersome to handle multiple windows (for example pop-ups) with either Selenium or WebTester. There should be an abstraction layer for seamlessly switching between windows and executing code. Within this issue a concept should be created / discussed.

Automatic validation of Pages in PostConstruct by Context Path

In a similar fashion as with @Mapping for PageFragement subclasses we could validate if a Page was initialized for a valid context path / url.

Examples

@ContextPath("/html/index")
public interface LandingPage extends Page {
    // implementation
}
  • If the currently displayed page had the URL http://localhost/html/index and an instance of LandingPage is created there would be no problem since the context path matches the expectation.
  • If the currently displayed page had the URL http://localhost/html/main an exception would be thrown as soon as a LandingPage instance is being created.
  • For page definitions without @ContextPath every URL is valid

Default WaitConfig is not overwritten by property

The values for
wait.timeout
and
wait.intervall

are read by the DefaultConfigurationBuilder, but only used at one place:
WaitConfig.from(Configuration)

this in turn is only use by the WaitConfig internal "from(browser)" which in turn is only used by "from(pagefragment)". The last one is only used with Wait.until(T fragment)...which again is only used by Mouse.moveTo().

Nowhere is the WaitConfig overwritten by the configured properties.

JUnit 4 runner extension for managing EventListener fields

This issue can't be implemented until #19 is done!

It should be possible to automatically initialize and register EventListener fields with the Browser's EventSystem. As with @Initialize and @ConfigurationValue multiple Browser fields should be handled by referencing their name as one of the targets.

  • static fields are not supported
  • only fields annotated with @Registered are considered by the extension
  • if a field is pre-initialized it's value will be used by the extension
  • if a field is not pre-initialized a new instance for the field's type will be instantiated using the default constructor
  • all of the defined EventListener fields are registered at the beginning of a test and de-registered at it's end
  • the extension is executed after Browser fields were initialized
  • in case there is only one @Managed Browser instance, this instance should be used to register the listener at
  • in case of multiple @Managed Browser instances, the name should be used to identify one or mor targets to register at
@RunWith(WebTesterJUnitRunner.class)
public class SingleBrowserTest {

    @Managed
    Browser browser;

    @Registered
    MyEventListener created; // will have new instance

    @Registered
    EventListener preInitialized = new MyEventListener(); // this instance will be used

    ...

}

@RunWith(WebTesterJUnitRunner.class)
public class MultiBrowserTest {

    @Managed("browser-1")
    Browser browser1;
    @Managed("browser-2")
    Browser browser2;

    @Registered(targets="browser-1")
    MyEventListener forBrowser1;
    @Registered(targets="browser-2")
    MyEventListener forBrowser2;

    @Registered(targets={"browser-1", "browser-2"})
    MyEventListener forBothBrowsers;

    ...

}

Support Module for TestNG

As with the webtester-support-junit4 and webtester-support-junit5 modules, it would be nice to have a webtester-support-testng module which offers the same kinds of features as the JUnit modules.

  • Browser management
  • Entry points
  • Configuration value injection
  • Page initialization
  • Event Listeners

@Mapping should be an inherited annotation

Currently the @Mapping and @Mappings annotations are not inherited in case the annotated class is subclasses.

Example:

@Mapping(tag = "foo")
public interface FooFragment extens PageFragment {
    // can only be initialized for <foo> elements
}

public interface SpecialFooFragment extens FooFragment {
    // can be initialized for every element
}

The behavior should be changed in a way that inherits the annotation if it is not overridden by the subclass.

JUnit 5 extension for managing EventListener fields

It should be possible to automatically initialize and register EventListener fields with the Browser's EventSystem. As with @Initialize and @ConfigurationValue multiple Browser fields should be handled by referencing their name as one of the targets.

  • static fields are not supported
  • only fields annotated with @Registered are considered by the extension
  • if a field is pre-initialized it's value will be used by the extension
  • if a field is not pre-initialized a new instance for the field's type will be instantiated using the default constructor
  • all of the defined EventListener fields are registered at the beginning of a test and de-registered at it's end
  • the extension is executed after Browser fields were initialized
  • in case there is only one @Managed Browser instance, this instance should be used to register the listener at
  • in case of multiple @Managed Browser instances, the name should be used to identify one or more targets to register at (if not, an exception should be thrown)
@EnableWebTesterExtensions
public class SingleBrowserTest {

    @Managed
    Browser browser;

    @Registered
    MyEventListener created; // will have new instance

    @Registered
    EventListener preInitialized = new MyEventListener(); // this instance will be used

    ...

}

@EnableWebTesterExtensions
public class MultiBrowserTest {

    @Managed("browser-1")
    Browser browser1;
    @Managed("browser-2")
    Browser browser2;

    @Registered(targets="browser-1")
    MyEventListener forBrowser1;
    @Registered(targets="browser-2")
    MyEventListener forBrowser2;

    @Registered(targets={"browser-1", "browser-2"})
    MyEventListener forBothBrowsers;

    ...

}

Implicit wait of WebDriver needs an abstraction

Currently the WebDriver's implicit wait can collide with our Wait-API. The implicit wait should be configurable via the Browser. This way we could provide more dynamic options, like a temporary setting, etc.

NEEDS TO BE DEFINED...

Migration Guide from WebTester v1 to v2

We need a (short) migration guide for the transition from WebTester v1 to v2.

It should cover the following topics:

  • Changes to IdentifyUsing
  • Changes to Pages and Page Fragments
  • Changes to Wait API
  • Changes to the Browser abstraction
  • Changes to the Event System

Remove Browser support modules

The following modules should be removed:

  • webtester-support-firefox
  • webtester-support-ie
  • webtester-support-marionette
  • webtester-support-chrome

To replace them, the corresponding factory implementations should be moved to the core module. Any driver dependencies must be scoped as optional.

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.