Closed kazurayam closed 7 months ago
Failed tests includes:
task testFailed(type: Test) {
include '**/CarryingCookieOverSessionsViaChromeProfileTest*'
include '**/ChromeDriverFactoryTest*'
include '**/ChromeOptionsTest*'
include '**/LaunchedChromeDriverTest*'
include '**/PrintEmployedOptions*'
}
I found
5
I had the same issue with deserializing java.time.Instant with gson during java upgrade version 11 to 17, Please refer the gson documentation sheds light on why it happens: https://github.com/google/gson/blob/main/UserGuide.md#gsons-expose
Solution: create Gson by using- new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create()
example:
Gson gson = new GsonBuilder().setPrettyPrinting() .excludeFieldsWithoutExposeAnnotation() .create();
In the ChromeOptionsTest, I had
@Before
void setup() {
driver = null
gson = new GsonBuilder().setPrettyPrinting().create()
}
I changed to
@Before
void setup() {
driver = null
gson = new GsonBuilder().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().create()
}
Then the test passed
Changed the project source JDK compatibility from 1.8 to 17. Also updated Gson version to the new one
Several test failed