File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -458,7 +458,7 @@ def orientation(self, value: str) -> None:
458458 """
459459 allowed_values = ['LANDSCAPE' , 'PORTRAIT' ]
460460 if value .upper () in allowed_values :
461- self .execute (Command .SET_SCREEN_ORIENTATION , {'orientation' : value })
461+ self .execute (Command .SET_SCREEN_ORIENTATION , {'orientation' : value . upper () })
462462 else :
463463 raise WebDriverException ("You can only set the orientation to 'LANDSCAPE' and 'PORTRAIT'" )
464464
Original file line number Diff line number Diff line change @@ -486,6 +486,21 @@ def test_orientation_setter(self):
486486 'orientation' : 'PORTRAIT' ,
487487 }
488488
489+ @httpretty .activate
490+ def test_orientation_setter_normalizes_case (self ):
491+ driver = android_w3c_driver ()
492+ httpretty .register_uri (httpretty .POST , appium_command ('/session/1234567890/orientation' ), body = '{"value": ""}' )
493+
494+ driver .orientation = 'landscape'
495+ assert get_httpretty_request_body (httpretty .last_request ()) == {
496+ 'orientation' : 'LANDSCAPE' ,
497+ }
498+
499+ driver .orientation = 'portrait'
500+ assert get_httpretty_request_body (httpretty .last_request ()) == {
501+ 'orientation' : 'PORTRAIT' ,
502+ }
503+
489504 @httpretty .activate
490505 def test_orientation_setter_invalid (self ):
491506 driver = android_w3c_driver ()
You can’t perform that action at this time.
0 commit comments