Git Product home page Git Product logo

webtester-core's People

Contributors

benhamidene avatar dbe-it avatar drakojin avatar nicopaul avatar slu-it 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

Watchers

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

webtester-core's Issues

StaleElementRecoveryException when sending a form by pressing ENTER in a text field

When sending a form (i.e. a search query in Jira) by pressing enter using our TextField's append method (basically WebElement#sendKeys(...)) a stale element recovery exception is thrown. This happens when the text of the field is read in order to generate the text changed event.

Issue came up during a workshop when trying to implement a search for our Cloud Jira instance:
https://github.com/testIT-WebTester/webtester-examples/blob/workshop-2015-12-04/workshop-2015-12-04/src/test/java/workshop/IssueCreationTest.java

Doesn't work:

public SearchResultPage searchForIssue(String query){
    quickSearch.setText(query).appendText(Keys.ENTER.toString());
    return create(SearchResultPage.class);
}

Works:

public SearchResultPage searchForIssue(String query){
    quickSearch.setText(query);
    quickSearch.getWebElement().sendKeys(Keys.ENTER);
    return create(SearchResultPage.class);
}

Extending JUnit Support with EventListener managemen

This issue can't be implemented until #55 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-junit module, 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

Unuseful UndeclaredThrowableExceptions

During the identification of elements on pages Selenium throws some time UndeclaredThrowableExceptions.

This results in very long StackTraces and unneeded scrolling activities ;)

It would be nice oif WebTester could extract the real causes behind them and give and throw it instead of the UndeclaredThrowables

Move BrowserFactory implementations into core module and remove corresponding support modules

Like with WebTester 2 we should limit the number of JAR modules. The browser support modules generally only provide a single BrowserFactory implementation class. These classes should be moved to the core module. Unneccessary transitive dependencies can be prevented by making the driver dependencies optional.

All of the BrowserFactory classes should be moved to the info.novatec.testit.webtester.browser.factories in the core module.

More details can be taken from the actual changes to WebTester 2 in this PR:
testIT-WebTester/webtester2-core#43

Upgrading the compile level to Java 7

Since Selenium upgraded to Java 7 with version 2.47.0 it is time to drop our support of Java 6 as well.
To do this the compile level of all WebTester components should be upgraded to "1.7".

This will only affect the current version. The branch of version 1.0.x will still be targeted at Java 6 in order to allow users who still need to use that version to be able to use WebTester as well. These Selenium version for that branch will be frozen at 2.46.

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 of new Wait API from WebTester 2.x

With WebTester 2.0 the Wait API was greatly overhauled. These changes should be migrated to this version of WebTester as well. The current API must be deprecated with a planned removal in v1.3.

Support Module for Microsoft's Edge Browser

As with webtester-support-firefox, webtester-support-chrome and others we should provide a support module for Microsoft's Edge browser.

  • The name of the new module should be webtester-support-edge.
  • The corresponding BrowserFactory should be called EdgeFactory.
  • Any performance optimizations possible should be activated by default.

Using a class reference instead of the Enum in @IdentifyUsing like in WebTester 2.x

Currently the method of identifying a PageObject is provided via an enumeration value on the @IdentifyUsing annotation. This does not allow for custom implementations by the user. In WebTester 2.0 this mechanism was replaced with a class reference to a ByProducer implementation.

Since we need to have at least one minor version of deprecation time, implementing this solution is a two step process:

  1. extend the @IdentifyUsing annotation with the class reference and deprecate the method property
  2. remove the method property in v1.3 with #51

Exception when running integration tests using Eclipse

When executing webtester-core's integration tests in eclipse the following exception is logged:

Exception in thread "Thread-2" org.openqa.selenium.remote.SessionNotFoundException: The FirefoxDriver cannot be used after quit() was called.
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'nbookslu2', ip: '172.16.176.63', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:377)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:670)
    at org.openqa.selenium.remote.RemoteWebDriver.getWindowHandle(RemoteWebDriver.java:537)
    at info.novatec.testit.webtester.eventsystem.events.browser.AbstractBrowserEvent.<init>(AbstractBrowserEvent.java:21)
    at info.novatec.testit.webtester.eventsystem.events.browser.ExceptionEvent.<init>(ExceptionEvent.java:24)
    at info.novatec.testit.webtester.browser.WebDriverBrowser.executeAction(WebDriverBrowser.java:537)
    at info.novatec.testit.webtester.browser.WebDriverBrowser.close(WebDriverBrowser.java:156)
    at info.novatec.testit.webtester.browser.WebDriverBrowserBuilder$1.run(WebDriverBrowserBuilder.java:88)

This does not occur in IntelliJ.

Steps for reproduction:

  • execute the integration test package as JUnit tests with eclipse
  • wait for tests to finish
  • look into the console

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.