playwright-java icon indicating copy to clipboard operation
playwright-java copied to clipboard

[Feature]: Change java.util.Date to java.time.LocalDateTime in Clock API

Open lubomsky opened this issue 1 year ago • 1 comments

🚀 Feature Request

Implementing code using Clock is not as pleasant as it could be.

Example

Now, I have to write something like this:

Instant instant = Instant.now().plus(10, ChronoUnit.MINUTES);
Date date = Date.from(instant);

page.clock().setSystemTime(date)

But I would like to write just like this:

page.clock().setSystemTime(LocalDateTime.now().plusMinutes(10))

Motivation

To use more modern and more convenient java.

First article

Second article

lubomsky avatar Oct 16 '24 09:10 lubomsky

Definitely 100% support for this. Please don't use the very old and broken Date API, modern code should always use the java.time API.

jhyot avatar Nov 28 '24 12:11 jhyot