dmcgill50
dmcgill50

Reputation: 540

OpenTest Doesn't Take a Standard JS Date for the ReadEmailImap function

I am attempting to pass a value for sentAfter to org.opentest.ReadEmailImap function that contains a string formatted as YYYY:MM:DD HH:DD:MM per this documentation

The closest that I have come to this format is .toISOString(). ref

Upvotes: 0

Views: 52

Answers (1)

Adrian Theodorescu
Adrian Theodorescu

Reputation: 12327

You can either build the date yourself using the JavaScript API, like here, or you can use a library like Moment.js (The moment.js file can be included in your test as described here). The first method is better for a quick and dirty, one time solution. The second is best if you have more advanced date/time logic that you need to execute.

Upvotes: 1

Related Questions