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

Fixing #592 win32 downloaded on 64-bit windows #635

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions tests/test_chrome_driver.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import json
import os

import platform
from random import random
import pytest
import browsers
from selenium import webdriver
from mock import patch
from mock import patch, create_autospec

from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.constants import ROOT_FOLDER_NAME
Expand Down Expand Up @@ -105,3 +106,29 @@ def test_chrome_manager_cached_driver_with_selenium():
def test_can_get_chrome_for_os(os_type):
path = ChromeDriverManager(os_system_manager=OperationSystemManager(os_type)).install()
assert os.path.exists(path)


def test_can_get_chrome_for_win64(delete_drivers_dir):
os_sys_manager = OperationSystemManager("win64")
path = ChromeDriverManager(os_system_manager=os_sys_manager).install()
assert os.path.basename(os.path.dirname(path)) == "chromedriver-win64"


def test_can_get_chrome_for_win32(delete_drivers_dir):
os_sys_manager = OperationSystemManager("win32")
path = ChromeDriverManager(os_system_manager=os_sys_manager).install()
assert os.path.basename(os.path.dirname(path)) == "chromedriver-win32"


@patch("webdriver_manager.core.os_manager.platform")
def test_can_get_chrome_for_mac64(mock_platform, delete_drivers_dir):
mock_platform.processor = create_autospec(platform.processor, return_value="i386")
os_sys_manager = OperationSystemManager("mac64")
path = ChromeDriverManager(os_system_manager=os_sys_manager).install()
assert os.path.basename(os.path.dirname(path)) == "chromedriver-mac-x64"


def test_can_get_chrome_for_mac64_m1(delete_drivers_dir):
os_sys_manager = OperationSystemManager("mac64_m1")
path = ChromeDriverManager(os_system_manager=os_sys_manager).install()
assert os.path.basename(os.path.dirname(path)) == "chromedriver-mac-arm64"
4 changes: 2 additions & 2 deletions webdriver_manager/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def install(self) -> str:

def get_os_type(self):
os_type = super().get_os_type()
if "win" in os_type:
return "win32"
if os_type in ["win32", "win64"]:
return os_type

if not self._os_system_manager.is_mac_os(os_type):
return os_type
Expand Down
Loading