praegus / toolchain-fixtures

FitNesse fixtures used in the open source toolchain
Apache License 2.0
6 stars 5 forks source link

Can we have WebBrowser<T extends WebElement> extends BrowserTest<T> ? #38

Closed pvbemmelen62 closed 11 months ago

pvbemmelen62 commented 1 year ago

I have a class VnwWebBrowser derived from WebBrowser derived from BrowserTest<WebElement> . BrowserTest defines the method

    protected T getElement(String place) {
        return getSeleniumHelper().getElement(place);
    }

where the T comes from

public class BrowserTest<T extends WebElement> extends SlimFixture {

I want to override that method in VnwWebBrowser , and currently have the code

  @Override
  protected WebElement getElement(String place) {
    place = vernieuwingPlace(place);
    return super.getElement(place);
  }

I would prefer it to be

  @Override
  protected T getElement(String place) {
    place = vernieuwingPlace(place);
    return super.getElement(place);
  }

That is, have return type T rather than WebElement. That way the method would be more similar to the original in BrowserTest . That requires that

public class WebBrowser extends BrowserTest {

is changed to

public class WebBrowser<T extends WebElement> extends BrowserTest<T> {

Is that a change that can be made ?

tcnh commented 11 months ago

Sorry for the major delay, I thought we'd already done this. This is fixed in 1.36-JDK11