Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I set the browser timezone #918

Closed
thanhvodad opened this issue Jun 18, 2021 · 3 comments
Closed

How can I set the browser timezone #918

thanhvodad opened this issue Jun 18, 2021 · 3 comments
Labels
question Someone is looking for answers

Comments

@thanhvodad
Copy link

thanhvodad commented Jun 18, 2021

How can I set the browser timezone ?
Thanks SUpportr

@mdmintz mdmintz added the question Someone is looking for answers label Jun 18, 2021
@mdmintz
Copy link
Member

mdmintz commented Jun 18, 2021

@thanhvodad Try adding this to your script: (example)

tz_params = {'timezoneId': 'America/New_York'}
self.driver.execute_cdp_cmd('Emulation.setTimezoneOverride', tz_params)

(From https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTimezoneOverride)

@thanhvodad
Copy link
Author

How can I pass parameters from run command pytest abc.py birthday=abcxyz
ex:
def test_demo_site(self, birthday):
self.open("https://whoer.net/" birthday)

@mdmintz
Copy link
Member

mdmintz commented Jun 18, 2021

@thanhvodad There are a few predefined variable names that you can use for passing data into tests:

--data=DATA  # (Extra test data. Access with "self.data" in tests.)
--var1=DATA  # (Extra test data. Access with "self.var1" in tests.)
--var2=DATA  # (Extra test data. Access with "self.var2" in tests.)
--var3=DATA  # (Extra test data. Access with "self.var3" in tests.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Someone is looking for answers
Projects
None yet
Development

No branches or pull requests

2 participants