kazurayam / chromedriverfactory

A Java library that enables you to launch Selenium ChromeDriver using an existing user Profile. That let you to carry cookies over multiple HTTP sessions via user Profile.
0 stars 0 forks source link

should rewrite the codes in Java, rather than Groovy #17

Closed kazurayam closed 2 years ago

kazurayam commented 2 years ago

For better portability, I should write it in Java 8.

kazurayam commented 2 years ago

In https://github.com/kazurayam/webdriverfactory/blob/0.2.4/src/main/groovy/com/kazurayam/webdriverfactory/chrome/ChromeDriverFactoryImpl.groovy

there are lines:

            driver.metaClass.userProfile = Optional.of(cup)
            driver.metaClass.userDataAccess = Optional.of(instruction)

These are too much "Groovyish". This library should not use Groovy Metaprograming feature.

kazurayam commented 2 years ago

ChromeOptionsModifiers class uses Grovy's Closure, which require care to translate into Java

kazurayam commented 2 years ago

I will start doing this as v0.6.0

kazurayam commented 2 years ago

A fundamental difficulty I found.

com.kazurayam.webdriverfactory.chrome.ChromeOptionsModifiers uses groovy.lang.Closure class. If I want to convert this class from Groovy to Java, I have to find out a way how to live without Closure.

The Closure of Groovy and Lambda of Java is not equivalent. It is not straight forward to rewrite it.

kazurayam commented 2 years ago

The 0.6.0-SNAPSHOT has done it.