testit-webtester / webtester-core Goto Github PK
View Code? Open in Web Editor NEWJava 6/7 version of WebTester
License: Apache License 2.0
Java 6/7 version of WebTester
License: Apache License 2.0
WebTester v2 introduced a new classification system for our default properties file adapters in:
testIT-WebTester/webtester2-core@bfe83ce
This should also be applied to WebTester v1.
With testIT-WebTester/webtester2-core#19 the JUnit 4 support module for WebTester 2 will be superior to WebTester 1's. It's changes should be migrated to this version as well.
WebTester 2.0 introduced a lot of new PageObjects (PageFragments), these should also be available in this version of WebTester.
EmailField
Form
GenericList
GenericSelect
GenericTextField
(done)MultiSelect
OrderedList
Paragraph
SearchField
SingleSelect
TelephoneField
UnorderedList
UrlField
TBD
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);
}
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
.
@Registered
are considered by the extensionEventListener
fields are registered at the beginning of a test and de-registered at it's endBrowser
fields were initialized@Managed
Browser
instance, this instance should be used to register the listener at@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;
...
}
TBD
TBD
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.
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
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
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.
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...
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.
As with webtester-support-firefox
, webtester-support-chrome
and others we should provide a support module for Microsoft's Edge browser.
webtester-support-edge
.BrowserFactory
should be called EdgeFactory
.All code marked for removal in v1.3 should be removed after the release of v1.2
For WebTester 2 there is an issue for providing an abstraction layer for the interaction with other windows:
testIT-WebTester/webtester2-core#32
When there is a suitable solution, it should be adapted for WebTester 1 as well.
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:
@IdentifyUsing
annotation with the class reference and deprecate the method
propertyIn WebTester 2.0 an additional type of marking was introduced: 'READ'
This should also be available in this version of WebTester.
TBD
WebTester saves Screenshots as "jpg". The selenium webdrivers generate PNG files.
So the extension must be changed
See
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:
integration
test package as JUnit tests with eclipseWith the release of v0.9.9 the @AfterInitialization annotation was deprecated (to be removed in v1.1.0). This was done in favor of using Java's @PostConstruct annotation.
Note: This annotation must remain in the v1.0.x branch!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.