Change Firefox browser time zone using Selenium on Windows

Viewed 239

I am testing some web functions on firefox that depends on the browser time zone, therefore every test need to run as it would be on an different time zone.

Change the system time is not an option because we are planning to run simultaneos tests.

I tried to mock the time zone using TimeShift.js that overwrite the Date object but it does work because our functions are based on the Intl object. It gets the time zone from

Intl.DateTimeFormat().resolvedOptions().timeZone

Would be a library to overwrite the Intl object or other similar solution?

On chrome dev-tools you can override location and change the TimezoneID, using selenium 4 you can automate that. Maybe is it a similar way on firefox?

On macOs you can do something like run every task on a different tz by something like changing the TZ variable

TZ=America/New_York

Will be there a similar on windows?

What others solution exists for firefox on windows?

0 Answers
Related