Skip to content

Commit

Permalink
Merge pull request #2989 from seleniumbase/mobile-mode-update
Browse files Browse the repository at this point in the history
Update Mobile Mode
  • Loading branch information
mdmintz authored Aug 3, 2024
2 parents e8c2147 + c1d0497 commit feca61a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.29.5"
__version__ = "4.29.6"
16 changes: 8 additions & 8 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ def uc_special_open_if_cf(
)
uc_metrics = {}
if (
isinstance(device_width, (int, float))
and isinstance(device_height, (int, float))
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, (int, float))
):
uc_metrics["width"] = device_width
Expand Down Expand Up @@ -1519,8 +1519,8 @@ def _set_chrome_options(
emulator_settings = {}
device_metrics = {}
if (
isinstance(device_width, (int, float))
and isinstance(device_height, (int, float))
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, (int, float))
):
device_metrics["width"] = device_width
Expand Down Expand Up @@ -3269,8 +3269,8 @@ def get_local_driver(
emulator_settings = {}
device_metrics = {}
if (
isinstance(device_width, (int, float))
and isinstance(device_height, (int, float))
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, (int, float))
):
device_metrics["width"] = device_width
Expand Down Expand Up @@ -4496,8 +4496,8 @@ def get_local_driver(
if mobile_emulator:
uc_metrics = {}
if (
isinstance(device_width, (int, float))
and isinstance(device_height, (int, float))
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, (int, float))
):
uc_metrics["width"] = device_width
Expand Down
6 changes: 3 additions & 3 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -14818,16 +14818,16 @@ def setUp(self, masterqa_mode=False):
metrics_list = metrics_string.split(",")
exception_string = (
"Invalid input for Mobile Emulator device metrics!\n"
"Expecting a comma-separated string with three\n"
"integer values for Width, Height, and Pixel-Ratio.\n"
"Expecting a comma-separated string with integer values\n"
"for Width/Height, and an int or float for Pixel-Ratio.\n"
'Example: --metrics="411,731,3" '
)
if len(metrics_list) != 3:
raise Exception(exception_string)
try:
self.__device_width = int(metrics_list[0])
self.__device_height = int(metrics_list[1])
self.__device_pixel_ratio = int(metrics_list[2])
self.__device_pixel_ratio = float(metrics_list[2])
self.mobile_emulator = True
except Exception:
raise Exception(exception_string)
Expand Down

0 comments on commit feca61a

Please sign in to comment.