kazurayam / inspectus4selenium-sample-project

A sample project that performs automated Web App UI test on Selenium4 using the Inspectus library
0 stars 0 forks source link

move the com.kazurayam.inspectus.WebDriverFormulars class outside of this project #4

Closed kazurayam closed 10 months ago

kazurayam commented 1 year ago

I believe that WebDriverForumulas class is worth sharing.

I should make a library to be used by other projects.

kazurayam commented 1 year ago

Should I bring it into the inspectus project?

No. It is not a good idea to move the com.kazurayam.inspectus.WebDriverFormulas class into the inspectus project.

Because the inspectus project should not be dependent on Selenium at all. The inspectus would only depend on the materialstore plus some really generic libraries (gson, slft4j, ...).

kazurayam commented 1 year ago

Should I create 2 new projects?

Why?

v0.1.2, WebDriverFormulas has the following code:

import org.openqa.selenium.support.ui.WebDriverWait
...
    public final void waitForElementPresent(WebDriver driver,
                                            By handle,
                                            int timeout) {
        new WebDriverWait(driver, Duration.ofSeconds(timeout))
                .until(ExpectedConditions.presenceOfElementLocated(handle));
    }

This code compiles only with Selenium 4.

With Selenium 3, as [javadoc] tells, I have to change this to:

import org.openqa.selenium.support.ui.WebDriverWait
...
    public final void waitForElementPresent(WebDriver driver,
                                            By handle,
                                            long timeout) {
        new WebDriverWait(driver, timeout)
                .until(ExpectedConditions.presenceOfElementLocated(handle));
    }

Selenium 4 has a backward incompatibility to Selenum 3. I need to accept this.

I have no idea how to create one single project that can manage dependencies to Selenium3 and Selenium4 together.

So I will create 2 projects. OK?

kazurayam commented 1 year ago

Not yet. Think more.

Maybe I can hide the incompatibility of Selenium 3 & 4 using Java Reflection API.

kazurayam commented 1 year ago

Also I should change the package name:

com.kazurayam.inspectus.selenium -> com.kazurayam.inspectus.support.selenium

Because the WebDriverFormula class is not the first class citizen in the inspectus regime. It is just a by-product.

kazurayam commented 10 months ago

already there is